MSMQ wcf activation issue with .net 4.0 and server 2008
Asked Answered
W

5

10

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?

Wilma answered 1/6, 2010 at 16:8 Comment(0)
C
3

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!

Camelliacamelopard answered 5/10, 2012 at 19:38 Comment(0)
I
0

How about using a different port? You can use the same host name and tell WAS to activate on the new port in a new vdir or site.

Isoclinal answered 11/10, 2010 at 16:53 Comment(1)
Msmq prortocol has no port option.Marginal
U
0

Unfortunately, the listener uses the service name to determine which queue to listen for so if your receiving service is called

MYOrganisation.Services.MyService.svc

your queue should be called

net.msmq://localhost/MYOrganisation.Services/MyService.svc

So, the queue is called:

MYOrganisation.Services/MyService.svc

Try this out and get back to me. I can post a full example of the config that works.

It occurs to me that even though you may not have 2 different endpoints, you could have the same service with a different namespace (or just rename the service) listening to a different queue. Not ideal, but it's the only thing I found that would work.

Ulani answered 11/6, 2011 at 12:39 Comment(0)
C
0

The URI of your service endpoint must match (more or less, cf http://msdn.microsoft.com/en-us/library/ms789042.aspx) the queue name. So here, the solution would be to create a virtual directory named staging and put your service there.

As for the binding info, localhost points to the server was queue listener shoudl be listen at so if your queues are installed on the same machine as IIS, this shoumld indeed be localhost.

Cherlynchernow answered 26/8, 2011 at 13:54 Comment(0)
D
0

Also an interesting point: The net.msmq listner adapter service seems to cache the fact that it couldn't access the queue. If it attempts to access a queue for your service and fails, and then you add permission for the net.msmq listener adapter, it still won't work. I restarted the service and then the queue started being watched again.

Disconsider answered 3/7, 2013 at 9:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.