[rabbitmq-discuss] subscriptions after .NET upgrade

Isaac Cambron icambron at gmail.com
Thu Nov 11 09:04:59 GMT 2010


I have an older application that I'm trying to get onto the latest and
greatest version of Rabbit and the .NET client. I'm having a bit of a
problem getting it to work the same way across the API changes.

In my old app, I had a simple piece that broadcast to all of my consumers
who happen to be listening. Let's say they print the message's content to
the console when they get it. It was pretty simple. Each consumer just
creates a subscription:

Subscription sub = new Subscription(ch, someExchange, ExchangeType.Topic,
someTopic);

and listened to it. The broadcaster just did this:

ch.BasicPublish(someExchange, someTopic, null, someBytes);

Now, that signature for Subscription no longer exists. I've tried stuff like
this (which matches the old implementation from Subscription.cs):

ch.ExchangeDeclare(EXCHANGE, ExchangeType.Topic);
ch.QueueDeclare(STATUS_QUEUE);
ch.QueueBind(STATUS_QUEUE, EXCHANGE, TOPIC, false, null);
Subscription sub = new Subscription(ch, STATUS_QUEUE, true);

But the behavior I'm seeing is totally different:

1. Only one of the consumers gets the message and prints something. It's
round-robin instead of broadcast.
2. When a new consumer is created and subscribes, it gets all of the
messages I've ever put in the queue and prints them to the console.

I'm able to fix #2 by changing noAck to true, but not #1, and I suspect I
have something very wrong. Any ideas?

Thanks,
Isaac
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20101111/63845768/attachment.htm>


More information about the rabbitmq-discuss mailing list