none
WCF NetMsMqBinding - Self Hosting RRS feed

  • Question

  • I got struck up with a weird problem in WCF.

      We hosted a WCF msmq binding, our client is windows application,

    1. When client send a message using wcf endpoint exposed via NetMsmq,  message is getting posted into MSMQ.
    2. Our wcf service keeps listening to MSMQ, once message received it will be processed and removed from the MSMQ.
     When we didn't send any messages for a long time (if idle time is more than 2 r 3 hrs), all the message got struck up in the MSMQ.

     When i check my WCF service, still it's running other end points like HTTP can be accessed and it's working as expected. But service does not pick the message from MSMQ.

     In this scenario, we need to do a WCF service restart. I don't know, whats the problem.

    I need to knw, do  NetMsMqListener service has anything to do wit the above problem.

    Monday, February 22, 2016 12:26 PM

Answers

  • Hello,

    >>When we didn't send any messages for a long time (if idle time is more than 2 r 3 hrs), all the message got struck up in the MSMQ.

    If you did not send any message for a long time, then all the message got struck up in the MSMQ, where does the message come from? Do you mean that is it the message which you send 2 or 3 hours ago?

    >>do NetMsMqListener service has anything to do wit the above problem.

    In my mind this issue may have something to do with the NetMsMqListener service, for example the NetMsMqListener service restarts, then the WCF service is no longer able to read messages off the queue and the incoming messages will sit in the queue forever.
    Besides, I will recommend you enable the WCF Tracing. It may help you understanding what is happening with the help of the log files.
    The following is an .config example to enable tracing. Please make sure the .config file is located in the same folder of your WCF service host.

    <configuration>
       <system.diagnostics>
          <sources>
                <source name="System.ServiceModel" 
                        switchValue="Information, ActivityTracing"
                        propagateActivity="true">
                <listeners>
                   <add name="traceListener" 
                       type="System.Diagnostics.XmlWriterTraceListener" 
                       initializeData= "c:\log\Traces.svclog" />
                </listeners>
             </source>
          </sources>
       </system.diagnostics>
    </configuration>
    

    For more information about tracing, you could refer to the following article:
    https://msdn.microsoft.com/en-us/library/ms733025(v=vs.110).aspx .

    And Microsoft provides a Service Trace Viewer Tool (link as below) which you could read. svclog files:
    https://msdn.microsoft.com/en-us/library/ms732023.aspx?f=255&MSPPError=-2147217396 .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, February 24, 2016 8:40 AM
    Moderator