2
votes

Hy, all.

I have an interesting case. I have tried to create a wcf service-client communication based on netmsmq binding hosted on windows service app. So I catch a problem with my host service - it can not receive any message from queue. MSDTC shows transaction rollback. And after some tries messages are moving into retry subqueue. ServiceHost become failed state and after i start in again in fails again and again. So in host application i have no exception and nothing except host fault state. I have service with two contracts (if it is important).

[ServiceContract]
public interface IService
{
    [OperationContract(IsOneWay = true)]
    void Send1(MyDataContract data);

    [OperationContract(IsOneWay = true)]
    void Send2(MyDataContract data);
}
[DataContract]
public class MyDataContract
{
    [DataMember]
    public string From { get; set; }
    [DataMember]
    public string Host { get; set; }
    [DataMember]
    public string To { get; set; }
    [DataMember]
    public DateTime SendTime { get; set; }
}

some service implementation

[OperationBehavior(TransactionScopeRequired = true, 
                 TransactionAutoComplete = true)]
public void Send1(MyDataContract dc)
{......}

service config:

<endpoint address="net.msmq://localhost/private/myservice" binding="netMsmqBinding" contract="IService" bindingConfiguration="NetMsmqBinding_IService" />

Messages are in queue - client service works fine. So at runtime method Send1 of service host never executes. But i handle HostFaulted events close after moving message from retry subqueue to incoming queue. That's all i can say.

any help?

1
It is difficult to envision the problem from the description above. Please mention the fault along with the code if possible.Deepansh Gupta
I've just add more imformation. Is it helpful?cyssima
Can you post the binding configuration for NetMsmqBinding_IService? I suspect that this is not set to Transactional where your queue has the transactional attribute set.DaveRead

1 Answers

0
votes

So, i spend around one day to detect the problem. So step by step: 1. I've got microsoft sample on msmq wcf 2. I found no difference 3. I understood, that i have big messages (larger 1Mb), so by default WCF can, not deserialize such big messages. It was neccessary to set maxBufferPoolSize and maxReceivedMessageSize

But that's the question - why wcf client successfuly send such big messages without any extended configurations :)

My advise: in WCF set package size and pools to max possible for you (if only you uses that service).