简体   繁体   中英

Message Queue service messages don't arrive

I've got this WCF service over message queuing.

The service is configured like this:

  <service name="EmailServices.EmailService" behaviorConfiguration="serviceBehaviour">
    <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="" name="mexEmailService" contract="IMetadataExchange" />
    <endpoint name="netMsmqEmailService" address="net.msmq://w2k8services/emailservices_w2k8services" contract="EmailServices.IEmailService"
            binding="netMsmqBinding" bindingConfiguration="netMsmq" />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8008/EmailService" />
      </baseAddresses>
    </host>
  </service>

The binding like this

  <netMsmqBinding>
    <binding name="netMsmq" exactlyOnce="true" receiveErrorHandling="Move" receiveTimeout="00:45:00" maxReceivedMessageSize="2147483647">
      <security mode="None" />
    </binding>   

Pretty basic message queue service which works fine locally

After generating a proxy and calling a function messages just do not arrive at the service. When stopping the service they won't come in any queue although sometimes you see one shortly appear in the outgoing queue of the client machine

A trace file says everything is ok, except that it cant see if the is transactional. It is...

I have no clue what to try anymore, I would say it should work but it just isn't. What else can I try?

...sometimes you see one shortly appear in the outgoing queue of the client machine

This means that the client is successfully enqueuing the message and that the message is being transmitted from one machine to another (assuming this is a transactional queue - which it needs to be as you've specified "exactlyOnce" in your binding).

So, assuming transactional queuing, the problem must be on the receiving side.

The first thing to check is queue permissions. To receive a message, the service account running the service needs the following queue permissions:

  • Receive
  • Peek
  • Get permissions
  • Get properties

If these are all granted, then the next thing is to enable msmq event logging . You should be able to see an event for the message arrival on the machine. Any problems after that you should be able to see using this log.

Check the Length of the message you are trying to send.

WCF by default sends only 8192 Characters.

You need to change if you want to send more than 8192 Characters.

I got similar issue and this worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM