Search code examples
javaspring-bootamqpspring-amqprmq

Spring AMQP - Publisher Confirms not closing unused channels


Publishing and getting acks/nacks is working as expected. My concern here is, it is not closing extra channels which are not in use. On the other hand with Publisher Confirms set to false the unused channels are getting closed as expected.

ConnectionFactory sample:

cachingConnectionFactory.setCacheMode(CachingConnectionFactory.CacheMode.CHANNEL);                                       
cachingConnectionFactory.setChannelCacheSize(confirmChannelCacheSize);                                      
cachingConnectionFactory.setPublisherConfirms(Boolean.TRUE);
cachingConnectionFactory.setPublisherReturns(Boolean.TRUE);

RabbitTemplate sample:

template.setMandatory(true);
template.setConfirmCallback(deepConfirmCallback);
template.setReturnCallback(returnCallback);

Spring AMQP dependency:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-amqp</artifactId>
    <version>2.1.1.RELEASE</version>
</dependency>

Solution

  • Reproduced; investigating.....

    I opened an issue on GitHub if you want to follow it.