Uploaded image for project: 'Spring AMQP'
  1. Spring AMQP
  2. AMQP-776

Consumer connection/disconnection event


    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 1.7.5, 2.0.1
    • Component/s: RabbitMQ
    • Labels:


      In rabbitmq there is a possibility to connect to queue with consumer in exclusive mode - #80

      When working with such consumers it's now impossible to tell if the consumer is actually connected to the queue or is it waiting when another consumer will disconnect freeing exclusive lock on the queue.

      It would be nice to be able to receive some event when consumer connects to the queue and when it disconnects.

      What I want to achieve is active/backup instances. When active instance is working with the queue, backup instance simply waits for connection. When we stop active instance, backup instance should start from that point where active instance left. To do that it needs to update status from the database to see what previous active instance have done and the simplest way from my opinion would be to intercept the moment when consumer connects to the queue. That would allow us to do status update before receiving any messages from the queue.

      Right now there is already two events - AsyncConsumerStartedEvent and AsyncConsumerStoppedEvent, but they are fired when consumer is created, not when it connects to the queue

      See github issue - #98




            • Assignee:
              grussell Gary Russell
              Shohou Dmitry Shohov
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: