Spring AMQP
  1. Spring AMQP
  2. AMQP-192

SimpleMessageListenerContainer should check isRunning() in doStart() method

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.0.0.RC1, 1.0.0.RC2, 1.0.0.RC3, 1.0.0 GA
    • Fix Version/s: 1.1.0.GA
    • Component/s: None
    • Labels:
      None

      Description

      SimpleMessageListenerContainer should guard against being started twice by checking isRunning during startup.

      We discovered this because we were using our a custom amqp inbound channel adapter that allowed us to inject an instance of an AbstractMessageListenerContainer. In one particular instance, we created the listener container as a top-level bean but were not setting autoStartup to false in our inbound channel adapter. The container was being started twice. The effect is that it would create the consumers once, but add each one to TaskExecutor twice.

      Two threads would effectively consume from each channel. We were seeing this as a 406 error from RabbitMQ. This error usually indicates that duplicate acks were being sent, which would make sense if you have more than one consumer for a particular channel – which are supposed to be held by a single channel.

        Activity

        Hide
        Gary Russell added a comment -

        I didn't see this issue and found the same problem; fixed with AMQP-223. Already in BUILD-SNAPSHOT.

        Show
        Gary Russell added a comment - I didn't see this issue and found the same problem; fixed with AMQP-223 . Already in BUILD-SNAPSHOT.

          People

          • Assignee:
            Gary Russell
            Reporter:
            Justin Miller
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: