Spring AMQP
  1. Spring AMQP
  2. AMQP-44

Add Connection-retry logic in RabbitMQ ConnectionFactory

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 1.0.0.M3
    • Component/s: RabbitMQ
    • Labels:
      None

      Activity

      Hide
      Mark Lui added a comment -

      Thanks for the info. I will take a look at the current pull request. The code is currently on an internal GIT repository. I can put it up on github that would help.

      Show
      Mark Lui added a comment - Thanks for the info. I will take a look at the current pull request. The code is currently on an internal GIT repository. I can put it up on github that would help.
      Hide
      Mark Lui added a comment -

      Here is my reconnect code. https://gist.github.com/817505

      Show
      Mark Lui added a comment - Here is my reconnect code. https://gist.github.com/817505
      Hide
      Dave Syer added a comment -

      Thanks, that was helpful. I think I would refactor it to break the direct (cyclic) coupling between listener container and connection factory, but it looks like a useful approach. It doesn't deal with Channel death, only Connections, which makes it slightly distinct from some of the other suggestions.

      Do you have any specific scenarios in which you see the Connection dying in practice? Is the connection closed accidentally? By an environment glitch? By the application?

      Show
      Dave Syer added a comment - Thanks, that was helpful. I think I would refactor it to break the direct (cyclic) coupling between listener container and connection factory, but it looks like a useful approach. It doesn't deal with Channel death, only Connections, which makes it slightly distinct from some of the other suggestions. Do you have any specific scenarios in which you see the Connection dying in practice? Is the connection closed accidentally? By an environment glitch? By the application?
      Hide
      Mark Lui added a comment -

      We have not yet gone to production with RabbitMQ but have seen other messaging brokers lose their connection. This can happen if the message broker goes down for whatever reason and we need to restart. Or there can be a network glitch between colos that can cause the connection to go down.

      Show
      Mark Lui added a comment - We have not yet gone to production with RabbitMQ but have seen other messaging brokers lose their connection. This can happen if the message broker goes down for whatever reason and we need to restart. Or there can be a network glitch between colos that can cause the connection to go down.
      Hide
      Dave Syer added a comment -

      The SimpleMessageListenerContainer together with CachingConnectionFactory now gives us:
      1) automatic support for re-connection if the listener fails and the broker is still available
      2) the option to inject advice around the listener, so declarative retry can be applied

      I will add a test for the declarative retry (AMQP-103) and Mark has said he might provide some namespace support for it (or at least for the advice chain).

      Show
      Dave Syer added a comment - The SimpleMessageListenerContainer together with CachingConnectionFactory now gives us: 1) automatic support for re-connection if the listener fails and the broker is still available 2) the option to inject advice around the listener, so declarative retry can be applied I will add a test for the declarative retry ( AMQP-103 ) and Mark has said he might provide some namespace support for it (or at least for the advice chain).

        People

        • Assignee:
          Dave Syer
          Reporter:
          Mark Fisher
        • Votes:
          5 Vote for this issue
          Watchers:
          6 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: