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

SimpleMessageListenerContainer long wait for consumers to start when insufficient threads

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.7.4
    • Fix Version/s: 1.7.5, 2.0.1
    • Component/s: RabbitMQ
    • Labels:
    • Environment:
      jdk1.8

      Description

      private void restart(BlockingQueueConsumer oldConsumer) {
      		BlockingQueueConsumer consumer = oldConsumer;
      		synchronized (this.consumersMonitor) {
      			if (this.consumers != null) {
      				try {
      					// Need to recycle the channel in this consumer
      					consumer.stop();
      					// Ensure consumer counts are correct (another is going
      					// to start because of the exception, but
      					// we haven't counted down yet)
      					this.cancellationLock.release(consumer);
      					this.consumers.remove(consumer);
      					BlockingQueueConsumer newConsumer = createBlockingQueueConsumer();
      					newConsumer.setBackOffExecution(consumer.getBackOffExecution());
      					consumer = newConsumer;
      					this.consumers.add(consumer);
      					if (this.applicationEventPublisher != null) {
      						this.applicationEventPublisher
      								.publishEvent(new AsyncConsumerRestartedEvent(this, oldConsumer, newConsumer));
      					}
      				}
      				catch (RuntimeException e) {
      					logger.warn("Consumer failed irretrievably on restart. " + e.getClass() + ": " + e.getMessage());
      					// Re-throw and have it logged properly by the caller.
      					throw e;
      				}
      				this.taskExecutor.execute(new AsyncMessageProcessingConsumer(consumer));
      			}
      		}
      	}
      

      this function only remove this.consumers map, but doesn't remove the consumer in this.taskExecutor,if something wrong, the taskExecutor is increasing forerver

        Attachments

          Activity

            People

            • Assignee:
              grussell Gary Russell
              Reporter:
              liguang8882008 LiGuang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: