WCF / MSMQ - Multiple Client Queues

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

So, how would one define multiple client queues?

In other words, this is how you declare a single client queue....

<client>
<endpoint name="ClientResponseEndpoint"
address="msmq.formatname:DIRECT=OS:.\private$\demoClient"
binding="msmqIntegrationBinding"
bindingConfiguration="MessageProcessorBinding"
contract="Service.IMessageProcessor">
</endpoint>
</client>

The need though is to be able to send the same message to multiple queues.
So various different clients can get the same message.

Or is there a better way? I want to stick with WCF though.
 
Nevermind, I figured it out...

You can have those queues such as:

<client>
<endpoint name="ClientResponseEndpoint"
address="msmq.formatname:DIRECT=OS:.\private$\queue1"
binding="msmqIntegrationBinding"
bindingConfiguration="MessageProcessorBinding"
contract="Service.IMessageProcessor">
</endpoint>
<endpoint name="ClientResponseEndpoint2"
address="msmq.formatname:DIRECT=OS:.\private$\queue2"
binding="msmqIntegrationBinding"
bindingConfiguration="MessageProcessorBinding"
contract="Service.IMessageProcessor">
</endpoint>
</client>

But you must specify the endpoint name when you use the contract class:

public partial class MessageProcessorClient :
System.ServiceModel.ClientBase<IMessageProcessor>, IMessageProcessor
{
public MessageProcessorClient(string configurationName)
:
base(configurationName)
{
}
}
 
Back
Top