WCF / MSMQ - Multiple Client Queues

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.
 
G

Guest

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)
{
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top