Spring AMQP
  1. Spring AMQP
  2. AMQP-93

Re-establish connection when needed

    Details

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

      Description

      org.springframework.amqp.rabbit.connection.SingleConnectionFactory may lost connection. In that case it needs to re-establish it.

      "com.rabbitmq.client.AlreadyClosedException: clean connection shutdown; reason: Attempt to use closed connection"
      ,"com.rabbitmq.client.impl.AMQConnection.ensureIsOpen(AMQConnection.java:141)"
      ,"com.rabbitmq.client.impl.AMQConnection.createChannel(AMQConnection.java:384)"
      ,"org.springframework.amqp.rabbit.connection.SingleConnectionFactory.createChannel(SingleConnectionFactory.java:126)"
      ,"org.springframework.amqp.rabbit.connection.SingleConnectionFactory.getChannel(SingleConnectionFactory.java:121)"
      ,"org.springframework.amqp.rabbit.connection.SingleConnectionFactory$SharedConnectionInvocationHandler.invoke(SingleConnectionFactory.java:279)"
      ,"$Proxy115.createChannel(Unknown Source)"
      ,"org.springframework.amqp.rabbit.support.RabbitAccessor.createChannel(RabbitAccessor.java:99)"

        Activity

        Hide
        Kaan Yamanyar added a comment -
        Show
        Kaan Yamanyar added a comment - A fix sent, pls see: https://github.com/SpringSource/spring-amqp/pull/5
        Hide
        Dave Syer added a comment -

        Thanks for the pull request. CachedConnectionFactoryt actually already does this already, but we should attack the problem at a lower level. The issue is that not all clients will want an automatic connection, so the simplest possible approach is not appropriate. This issue is essentially a duplicate of AMQP-44 (so expect it will be closed as a duplicate or at the same time as AMQP-44 at the latest).

        Show
        Dave Syer added a comment - Thanks for the pull request. CachedConnectionFactoryt actually already does this already, but we should attack the problem at a lower level. The issue is that not all clients will want an automatic connection, so the simplest possible approach is not appropriate. This issue is essentially a duplicate of AMQP-44 (so expect it will be closed as a duplicate or at the same time as AMQP-44 at the latest).
        Hide
        Dave Syer added a comment -

        This should be covered by work done to implement AMQP-44. SingleConnectionFactory will reconnect if it detects a closed connection when it is asked to create a new channel. This does not cover the important other case of the broker not being available at all.

        Show
        Dave Syer added a comment - This should be covered by work done to implement AMQP-44 . SingleConnectionFactory will reconnect if it detects a closed connection when it is asked to create a new channel. This does not cover the important other case of the broker not being available at all.

          People

          • Assignee:
            Dave Syer
            Reporter:
            Kaan Yamanyar
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 0.25d
              0.25d
              Remaining:
              Remaining Estimate - 0.25d
              0.25d
              Logged:
              Time Spent - Not Specified
              Not Specified