Program: 15504
Project: 15504
Buggy source:
private void doRegisterConsumer(String name,MessageChannel moduleInputChannel,Queue queue,RabbitPropertiesAccessor properties,boolean isPubSub){
  SimpleMessageListenerContainer listenerContainer=new SimpleMessageListenerContainer(this.connectionFactory);
  listenerContainer.setAcknowledgeMode(properties.getAcknowledgeMode(this.defaultAcknowledgeMode));
  listenerContainer.setChannelTransacted(properties.getTransacted(this.defaultChannelTransacted));
  listenerContainer.setDefaultRequeueRejected(properties.getRequeueRejected(this.defaultDefaultRequeueRejected));
  if (!isPubSub) {
    int concurrency=properties.getConcurrency(this.defaultConcurrency);
    concurrency=concurrency > 0 ? concurrency : 1;
    listenerContainer.setConcurrentConsumers(concurrency);
    int maxConcurrency=properties.getMaxConcurrency(this.defaultMaxConcurrency);
    if (maxConcurrency > concurrency) {
      listenerContainer.setMaxConcurrentConsumers(maxConcurrency);
    }
  }
  listenerContainer.setPrefetchCount(properties.getPrefetchCount(this.defaultPrefetchCount));
  listenerContainer.setTxSize(properties.getTxSize(this.defaultTxSize));
  listenerContainer.setTaskExecutor(new SimpleAsyncTaskExecutor(queue.getName() + "String_Node_Str"));
  listenerContainer.setQueues(queue);
  int maxAttempts=properties.getMaxAttempts(this.defaultMaxAttempts);
  if (maxAttempts > 1) {
    RetryOperationsInterceptor retryInterceptor=RetryInterceptorBuilder.stateless().maxAttempts(maxAttempts).backOffOptions(properties.getBackOffInitialInterval(this.defaultBackOffInitialInterval),properties.getBackOffMultiplier(this.defaultBackOffMultiplier),properties.getBackOffMaxInterval(this.defaultBackOffMaxInterval)).recoverer(new RejectAndDontRequeueRecoverer()).build();
    listenerContainer.setAdviceChain(new Advice[]{retryInterceptor});
  }
  listenerContainer.afterPropertiesSet();
  AmqpInboundChannelAdapter adapter=new AmqpInboundChannelAdapter(listenerContainer);
  adapter.setBeanFactory(this.getBeanFactory());
  DirectChannel bridgeToModuleChannel=new DirectChannel();
  bridgeToModuleChannel.setBeanFactory(this.getBeanFactory());
  bridgeToModuleChannel.setBeanName(name + "String_Node_Str");
  adapter.setOutputChannel(bridgeToModuleChannel);
  adapter.setBeanName("String_Node_Str" + name);
  DefaultAmqpHeaderMapper mapper=new DefaultAmqpHeaderMapper();
  mapper.setRequestHeaderNames(properties.getRequestHeaderPattens(this.defaultRequestHeaderPatterns));
  mapper.setReplyHeaderNames(properties.getReplyHeaderPattens(this.defaultReplyHeaderPatterns));
  adapter.setHeaderMapper(mapper);
  adapter.afterPropertiesSet();
  Binding consumerBinding=Binding.forConsumer(name,adapter,moduleInputChannel,properties);
  addBinding(consumerBinding);
  ReceivingHandler convertingBridge=new ReceivingHandler();
  convertingBridge.setOutputChannel(moduleInputChannel);
  convertingBridge.setBeanName(name + "String_Node_Str");
  convertingBridge.afterPropertiesSet();
  bridgeToModuleChannel.subscribe(convertingBridge);
  consumerBinding.start();
}

Fixed version (ground truth):
private void doRegisterConsumer(String name,MessageChannel moduleInputChannel,Queue queue,RabbitPropertiesAccessor properties,boolean isPubSub){
  ClassLoader originalClassloader=Thread.currentThread().getContextClassLoader();
  try {
    ClassUtils.overrideThreadContextClassLoader(SimpleMessageListenerContainer.class.getClassLoader());
    SimpleMessageListenerContainer listenerContainer=new SimpleMessageListenerContainer(this.connectionFactory);
    listenerContainer.setAcknowledgeMode(properties.getAcknowledgeMode(this.defaultAcknowledgeMode));
    listenerContainer.setChannelTransacted(properties.getTransacted(this.defaultChannelTransacted));
    listenerContainer.setDefaultRequeueRejected(properties.getRequeueRejected(this.defaultDefaultRequeueRejected));
    if (!isPubSub) {
      int concurrency=properties.getConcurrency(this.defaultConcurrency);
      concurrency=concurrency > 0 ? concurrency : 1;
      listenerContainer.setConcurrentConsumers(concurrency);
      int maxConcurrency=properties.getMaxConcurrency(this.defaultMaxConcurrency);
      if (maxConcurrency > concurrency) {
        listenerContainer.setMaxConcurrentConsumers(maxConcurrency);
      }
    }
    listenerContainer.setPrefetchCount(properties.getPrefetchCount(this.defaultPrefetchCount));
    listenerContainer.setTxSize(properties.getTxSize(this.defaultTxSize));
    listenerContainer.setTaskExecutor(new SimpleAsyncTaskExecutor(queue.getName() + "String_Node_Str"));
    listenerContainer.setQueues(queue);
    int maxAttempts=properties.getMaxAttempts(this.defaultMaxAttempts);
    if (maxAttempts > 1) {
      RetryOperationsInterceptor retryInterceptor=RetryInterceptorBuilder.stateless().maxAttempts(maxAttempts).backOffOptions(properties.getBackOffInitialInterval(this.defaultBackOffInitialInterval),properties.getBackOffMultiplier(this.defaultBackOffMultiplier),properties.getBackOffMaxInterval(this.defaultBackOffMaxInterval)).recoverer(new RejectAndDontRequeueRecoverer()).build();
      listenerContainer.setAdviceChain(new Advice[]{retryInterceptor});
    }
    listenerContainer.afterPropertiesSet();
    AmqpInboundChannelAdapter adapter=new AmqpInboundChannelAdapter(listenerContainer);
    adapter.setBeanFactory(this.getBeanFactory());
    DirectChannel bridgeToModuleChannel=new DirectChannel();
    bridgeToModuleChannel.setBeanFactory(this.getBeanFactory());
    bridgeToModuleChannel.setBeanName(name + "String_Node_Str");
    adapter.setOutputChannel(bridgeToModuleChannel);
    adapter.setBeanName("String_Node_Str" + name);
    DefaultAmqpHeaderMapper mapper=new DefaultAmqpHeaderMapper();
    mapper.setRequestHeaderNames(properties.getRequestHeaderPattens(this.defaultRequestHeaderPatterns));
    mapper.setReplyHeaderNames(properties.getReplyHeaderPattens(this.defaultReplyHeaderPatterns));
    adapter.setHeaderMapper(mapper);
    adapter.afterPropertiesSet();
    Binding consumerBinding=Binding.forConsumer(name,adapter,moduleInputChannel,properties);
    addBinding(consumerBinding);
    ReceivingHandler convertingBridge=new ReceivingHandler();
    convertingBridge.setOutputChannel(moduleInputChannel);
    convertingBridge.setBeanName(name + "String_Node_Str");
    convertingBridge.afterPropertiesSet();
    bridgeToModuleChannel.subscribe(convertingBridge);
    consumerBinding.start();
  }
  finally {
    Thread.currentThread().setContextClassLoader(originalClassloader);
  }
}