Thanks Emile - I'll try that.<br><br><div class="gmail_quote">On Thu, Nov 11, 2010 at 4:30 AM, Emile Joubert <span dir="ltr"><<a href="mailto:emile@rabbitmq.com">emile@rabbitmq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Isaac,<br>
<div><div></div><div class="h5"><br>
On 11/11/10 09:04, Isaac Cambron wrote:<br>
> I have an older application that I'm trying to get onto the latest and<br>
> greatest version of Rabbit and the .NET client. I'm having a bit of a<br>
> problem getting it to work the same way across the API changes.<br>
><br>
> In my old app, I had a simple piece that broadcast to all of my<br>
> consumers who happen to be listening. Let's say they print the message's<br>
> content to the console when they get it. It was pretty simple. Each<br>
> consumer just creates a subscription:<br>
><br>
> Subscription sub = new Subscription(ch, someExchange,<br>
> ExchangeType.Topic, someTopic);<br>
><br>
> and listened to it. The broadcaster just did this:<br>
><br>
> ch.BasicPublish(someExchange, someTopic, null, someBytes);<br>
><br>
> Now, that signature for Subscription no longer exists. I've tried stuff<br>
> like this (which matches the old implementation from Subscription.cs):<br>
><br>
> ch.ExchangeDeclare(EXCHANGE, ExchangeType.Topic);<br>
> ch.QueueDeclare(STATUS_QUEUE);<br>
> ch.QueueBind(STATUS_QUEUE, EXCHANGE, TOPIC, false, null);<br>
> Subscription sub = new Subscription(ch, STATUS_QUEUE, true);<br>
><br>
> But the behavior I'm seeing is totally different:<br>
><br>
> 1. Only one of the consumers gets the message and prints something. It's<br>
> round-robin instead of broadcast.<br>
> 2. When a new consumer is created and subscribes, it gets all of the<br>
> messages I've ever put in the queue and prints them to the console.<br>
><br>
> I'm able to fix #2 by changing noAck to true, but not #1, and I suspect<br>
> I have something very wrong. Any ideas?<br>
<br>
</div></div>Subscriptions have indeed been simplified for release version 2.0.0.<br>
Preceding the use of Subscription with declarations and the binding, as<br>
you have done, is correct.<br>
<br>
If only one consumer gets messages then try setting the channel prefetch<br>
to a small number (e.g. 1) by calling ch.BasicQos() before creating the<br>
subscription.<br>
<br>
Regards<br>
<font color="#888888"><br>
<br>
Emile<br>
</font></blockquote></div><br>