[rabbitmq-discuss] HA with C#. Ending server does not cause HandleBasicCancel

Mike Barry michael.john.barry at gmail.com
Wed Sep 19 13:22:31 BST 2012


Emile,

Sorry, I should have included that code, but I have a very simple consumer
that derives from DefaultBasicConsumer. Are you suggesting I do it in a
different manner to verify behavior? I should have mentioned I am using
2.8.6 and running the client and server on the same machine.

Thanks,
Mike

internal class FabricNotificationQueueConsumer : DefaultBasicConsumer
    {
        private static readonly Lazy<ILog> logger =

        internal FabricNotificationQueueConsumer()
        {
        }

        public override void HandleBasicDeliver(
            string consumerTag,
            ulong deliveryTag,
            bool redelivered,
            string exchange,
            string routingKey,
            IBasicProperties properties,
            byte[] body)
        {
            logger.Info("Message!");
        }

        public override void OnCancel()
        {
                logger.Value.Warn("OnCancel!");
        }

        public override void HandleBasicCancelOk(string consumerTag)
        {
            logger.Value.Warn("HandleBasicCancelOk!");
        }

        public override void HandleBasicCancel(string consumerTag)
        {
            logger.Value.Warn("HandleBasicCancel!");
     }

On Wed, Sep 19, 2012 at 5:50 AM, Emile Joubert <emile at rabbitmq.com> wrote:

>
> Hi Mike,
>
> On 18/09/12 19:37, Mike Barry wrote:
> > I would expect to get a HandleBasicCancel as
> > defined in the documentation, however I am only getting an OnCancel. Is
> > this expected?
>
> No, HandleBasicCancel should be called.
>
> > this.queueConsumer = new FabricNotificationQueueConsumer(this.region,
> > this.groupName, this.serializer,
>
> I'm not able to replicate this problem, which makes me wonder whether
> FabricNotificationQueueConsumer might be implicated somehow. Using
> DefaultBasicConsumer I can confirm that HandleBasicCancel is correctly
> called when the broker issues a basic.cancel. I suggest you try a
> simpler example using DefaultBasicConsumer to see if you still get this
> error.
>
>
> -Emile
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120919/881a3f33/attachment.htm>


More information about the rabbitmq-discuss mailing list