FAQ
I am looking to enumerate in Pika the places or reasons that RabbitMQ may disconnect the client connection. There's the case of bad credentials and permission issues with the vhost for example. Is there a common module/function called within the RabbitMQ source to handle these types of disconnects? Any pointers to where to look in the Rabbit code base would be helpful.

Thanks,

Gavin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110512/36675253/attachment.htm>

Search Discussions

  • Simon MacMullen at May 13, 2011 at 11:21 am

    On 12/05/11 18:12, Gavin M. Roy wrote:
    I am looking to enumerate in Pika the places or reasons that RabbitMQ
    may disconnect the client connection. There's the case of bad
    credentials and permission issues with the vhost for example. Is there a
    common module/function called within the RabbitMQ source to handle these
    types of disconnects?
    In pretty much every case an #amqp_error{} record will be constructed,
    then thrown as an exception. #amqp_error{} is in general constructed and
    thrown by a call to rabbit_misc:protocol_error(), so that's probably the
    best thing to look for.

    Note that some AMQP exceptions lead to connections being disconnected
    ("hard" errors) while some lead to channels being disconnected ("soft"
    errors). Both go through rabbit_misc:protocol_error(). The 0-9-1 XML
    spec lists which are which (under "CONSTANTS", near the top).

    Can I ask why you want to know though? In general the spec document
    lists the error codes that can occur, and each error should be
    accompanied by a descriptive text. The only exception is for errors that
    happen while the connection is being established (is that what you're
    asking about? - in which case I think it's permissions as you already
    know, framing errors and internal errors.)

    Cheers, Simon

    --
    Simon MacMullen
    Staff Engineer, RabbitMQ
    SpringSource, a division of VMware
  • Simon MacMullen at May 13, 2011 at 11:35 am

    On 13/05/11 12:21, Simon MacMullen wrote:
    The only exception is for errors that
    happen while the connection is being established (is that what you're
    asking about? - in which case I think it's permissions as you already
    know, framing errors and internal errors.)
    Gah, not quite true. The "silent" disconnections include anything that
    goes wrong before sending connection.open-ok, which at a quick glance at
    rabbit_reader looks like the possibilities listed above plus the
    requested frame_max being out of bounds. In theory it could be that
    heartbeat or channel_max could be out of bounds too, but in practice our
    "negotiation" for those options is to grant whatever the client asks for.

    I don't like this bit of the spec.

    Cheers, Simon

    --
    Simon MacMullen
    Staff Engineer, RabbitMQ
    SpringSource, a division of VMware

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedMay 12, '11 at 5:12p
activeMay 13, '11 at 11:35a
posts3
users2
websiterabbitmq.com
irc#rabbitmq

2 users in discussion

Simon MacMullen: 2 posts Gavin M. Roy: 1 post

People

Translate

site design / logo © 2022 Grokbase