[rabbitmq-discuss] 2 WCF services on the same queue

Emile Joubert emile at rabbitmq.com
Mon Dec 5 13:58:53 GMT 2011


Hi Shaun,

Yes, that is my suggestion. I realise that this is not very natural, but
I don't see any other way when using WCF.


On 01/12/11 13:31, Shaun Xu wrote:
> Thanks Emile. If I do want to use WCF then I need to create endpoints
> for each service instances and then let the client, or something like
> routing component to call one of them. Is that correct?
> 
> Shaun
> 
> Sent from my iPad
> 
> 在 2011-12-1,19:13,Emile Joubert <emile at rabbitmq.com> 写道:
> 
>> On 01/12/11 06:09, Shaun Ziyan Xu wrote:
>>> I would like to scaling out my application service and decided to
>>> use a distributed queue to receive the client request, and
>>> multiple services listening on the same queue. I think this is
>>> very common pooling-based pattern. I'm trying to use RebbitMQ
>>> with WCF binding, and when I use one client and one service to
>>> works well. But when I created 2 services I found when the client
>>> invoked, it gave me an exception said the CommunicationObject
>>> State was Fault.
>> 
>> 
>> Unfortunately each Service creates a new AMQP binding and a new
>> queue for requests. Therefore each Service will receive all
>> requests, leading to the errors you see.
>> 
>> If you want to use WCF then you could create separate endpoints for
>> each worker and to round-robin at the request stage.
>> 
>> If you do not need to use WCF then use the RabbitMQ .net client
>> directly and follow the Work Queues and RPC tutorials: 
>> http://www.rabbitmq.com/getstarted.html
>> 
>> You will find C# implementations here: 
>> https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/dotnet



More information about the rabbitmq-discuss mailing list