[rabbitmq-discuss] Fault-tolerant subscriptions using the .NET client

OJ Reeves oj at buffered.io
Fri Apr 1 04:09:51 BST 2011

Hi Emile,

I see the issue now. My code looks like this:

var eventArgs = default(BasicDeliverEventArgs);
if (!_queueSubscripion.Next(500, out eventArgs))
    eventArgs = null;
return eventArgs;

I wasn't aware that in the case where the connection has been dropped that
the Next() call would return true but eventArgs would be null. That's my
mistake. I will make the chances now to utilise this behaviour.

Thanks again for taking the time to look into the issue. I appreciate it.

Best regards

On 30 March 2011 00:02, Emile Joubert <emile at rabbitmq.com> wrote:

> Hi OJ,
> On 25/03/11 20:35, OJ Reeves wrote:
>  I am surprised to hear that the Dispose() method is called when the
>> connection is broken yet subsequent calls to subscription.Next()
>> continue to function and return 'true'. This seems a little
>> counter-intuitive to me. I would expect that attempting to called Next()
>> on a subscription that has been disposed would result in some kind of
>> error.
> That's not what I see. As soon as a connection error occurs, the
> subscription is disposed and calls to Next() return null. Perhaps Dispose()
> is not getting called in your case. One possible reason for that is an
> incorrectly trapped exception.
> Regards
> Emile


OJ Reeves
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110401/25ef165a/attachment.htm>

More information about the rabbitmq-discuss mailing list