Clustered MSMQ and WCF

Breath_of_the_Dying

[H]ard|Gawd
Joined
Jan 8, 2007
Messages
1,454
Anyone have experience with this? I don't see how a remote MSMQ fires off WCF services. I think I understand how it works with a local MSMQ to invoke a service call, but for queues not on the same server as the WCF service, how does the service know when to fire off a method. Does the WCF framework continuously poll the remote queue location? Is that how it works locally anyway?

We're looking at multiple services pulling from the same location on the MSMQ cluster, so any service that's available can pull the next available message.
 
Anyone have experience with this? I don't see how a remote MSMQ fires off WCF services. I think I understand how it works with a local MSMQ to invoke a service call, but for queues not on the same server as the WCF service, how does the service know when to fire off a method. Does the WCF framework continuously poll the remote queue location? Is that how it works locally anyway?
Sending MSMQs is (kind of) a fire-and-forget messaging system. A listener, with proper permissions, would have to watch the queue for new messages, take the next message, and (presumably) execute certain business rules based on the message body. As long as the queue's host machine is accessible and the permissions on the queue are setup correctly, then you can push/take items on the queue from a remote location.

We're looking at multiple services pulling from the same location on the MSMQ cluster, so any service that's available can pull the next available message.
Ok, this sounds a little different: the first part seems more like you have external machines dumping messages to a central location and acting on the messages as processed. But this second part sounds like you're wanting to reverse the logic, and have a bunch of worker processes call in to pick up tasks from a central location.

Could you clarify what it is you're trying to do?
 
I'm working on both sides of the queue, the clients that put messages on the queue, and the WCF services that read from the queue. The client side is pretty straightforward with a channel factory, I just don't know if the service side is as easy.

Lets say I have 2 instances of a WCF service I want to read from the same queue. I don't care which one processes each message, but I want both to work greedily so the work is relatively balanced. This seems easy to do writing a MSMQ listener that just waits until it gets one, but can I configure WCF to do this with the binding. I've got MSMQ bindings to work on local queues relative to the service, can I just point the cluster as the address in the configuration? When multiple WCF services are reading from the same address, does anything need to change for all of them to take messages successfully?
 
Lets say I have 2 instances of a WCF service I want to read from the same queue. I don't care which one processes each message, but I want both to work greedily so the work is relatively balanced. This seems easy to do writing a MSMQ listener that just waits until it gets one, but can I configure WCF to do this with the binding. I've got MSMQ bindings to work on local queues relative to the service, can I just point the cluster as the address in the configuration? When multiple WCF services are reading from the same address, does anything need to change for all of them to take messages successfully?
Assuming that the queue permissions are setup correctly and it is a public queue, then what you are trying should be feasible. From what I've seen and read, having multiple listeners is not a problem -- assuming that all of the listeners are capable of doing the same thing.
 
Back
Top