Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSMQ wcf activation issue with .net 4.0 and server 2008

I have .net 4.0 application ported from net 3.5 that uses net.msmq running on server 2008 x64

Setup

  • net.msmq Service with address "net.msmq://localhost/private/msmqdataservice.svc"
  • net.msmq endpoing with address "net.msmq://localhost/private/msmqdataservice.svc"
  • queue in MSMQ -> name = "$private\msmqdataservice.svc"

everything is working on production right now with .net 3.5.

I installed .net 4.0 on server and created new site to for staging on same box.

New staging msmq setup is

  • net.msmq Service with address "net.msmq://localhost/private/staging/msmqdataservice.svc"
  • net.msmq endpoing with address "net.msmq://localhost/private/staging/msmqdataservice.svc"
  • queue in MSMQ -> name = "$private\staging/msmqdataservice.svc"

Created another queue for different site.

Another change i made with new site is this is different site in iis with listening on different ip address. I have left net.msmq binding to 'localhost'. Main site as well has same binding for net.msmq -> 'localhost'. I think that's how it should be. Please point out if need some different configuration.

Issue is my requests are making into queue but not getting picked up by application it just stays there

There is no indication of anything wrong in log. Only thing i am seeing in log related to this is a warning "msmqactivation cannot discover queue". Although this warning i have never understood correctly as we have been seeing this always with everything fine with msmq in 3.5.

Anything i can think is verified and it's correct.

  • Application's app pool is running as network service and it has full access to queue.
  • net.msmq activation service is running with network service
  • Tried different naming convention of service url with same result

Summary

Please provide any insight into multiple sites setup with net.msmq. I am using net.msmq binding with value = 'localhost' for both site. I think it's machinename identity.

Any way to diagnose this issue?

Any thing else you may think of may help.

We had to hold off release yesterday as after spending like 100 man hours we can't figure out what's the issue is. Also can't make it break in my development machine.

Edit

Issue was that after creating new site naming convention does not work like

net.msmq Service with address "net.msmq://localhost/private/staging/msmqdataservice.svc" net.msmq endpoing with address "net.msmq://localhost/private/staging/msmqdataservice.svc" queue in MSMQ -> name = "$private\staging/msmqdataservice.svc"

it worked with service name net.msmq://localhost/private/msmqdataservice.svc

but now i cannot have two sites using exactly same endpoint.

Any way to have same endpoint in two different site with different url and different queue in same machine?

like image 837
mamu Avatar asked Jun 01 '10 16:06

mamu


People also ask

How to enable Net MSMQ Listener Adapter service?

Search the list of services for the Net. Msmq Listener Adapter. Right-click and select Properties. Set the Startup Type to Automatic, click Apply and click the Start button.

What is MSMQ in IIS?

Microsoft Message Queuing (MSMQ) is a message queue implementation developed by Microsoft and deployed in its Windows Server operating systems since Windows NT 4 and Windows 95. Windows Server 2016 and Windows 10 also includes this component.

What is net Msmq?

MSMQ is a distributed or federated messaging system where every server hosts the queue infrastructure, and outgoing messages are sent locally before being delivered to their ultimate address.


1 Answers

The fix for me was to install AppFabric for Windows Server v1.1. (Must have for anyone using WAS/IIS hosted WCF services or WF applications.)

This also corrected an issue I was having with the WAS process crashing every time I created a non-WCF queue. The Just-In-Time debugger was throwing this:

 System.ServiceModel.EndpointNotFoundException was unhandled
      Message=The service '~/nonWcfQueueName' does not exist.
      Source=System.ServiceModel.Activation
      StackTrace:
           at System.ServiceModel.ServiceHostingEnvironment.NormalizeVirtualPath(String virtualPath)
           at System.ServiceModel.Channels.MsmqHostedTransportManager.HostedBindingFilter.MatchFound(String host, String name, Boolean isPrivate)
           at System.ServiceModel.Channels.MsmqBindingMonitor.MatchQueue(MatchState state)
           at System.ServiceModel.Channels.MsmqBindingMonitor.ProcessFoundQueues(MessageQueue[] queues, Dictionary`2 knownQueues, Boolean isPrivate)
           at System.ServiceModel.Channels.MsmqBindingMonitor.OnTimer(Object state)
           at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
           at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
           at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
      InnerException: 

I guess not many people need to mix WCF/non-WCF queues on the same machine. Hope this saves someone from the pain I've gone through this past week!

like image 170
teodulog Avatar answered Oct 16 '22 08:10

teodulog