0

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>
Sravya
  • 3
  • 1
  • Boot 2.1.1. is nearly 18 months old; the current 2.1.x version is 2.1.14. If you still see a problem with that comment here. Bear in mind that the channel close is delayed until the confirmation is received. It will be force closed after 5 seconds if no confirmation is received. Don't ask the same question in multiple places; it is a waste of your time and ours; I have closed the GitHub issue; it can be reopened if this turns out to be a bug. Also, what value is `confirmChannelCacheSize` ? – Gary Russell May 07 '20 at 21:54
  • @GaryRussell. The channel is never getting closed even after few hours.I set confirmChannelCacheSize value to 5 to test this scenario. – Sravya May 07 '20 at 22:09
  • That's the whole point of the cache; we keep 5 channels available for re-use. Only the 6th and later channels will be physically closed. Again; try with the latest version; if you see 6 or more channels in use then I agree there's a problem. I am already done for the day so I can't test it until tomorrow. – Gary Russell May 07 '20 at 22:12
  • @GaryRussell Just to avoid any confusion- the issue I raised is if channel cache size is 5 , then 6 and later channels are not getting closed till we kill that connection. I tried with 2.1.14 version and I still see the same behavior. – Sravya May 07 '20 at 23:20
  • Ok. I will check it out tomorrow. – Gary Russell May 07 '20 at 23:28

1 Answers1

0

Reproduced; investigating.....

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

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • I am fixing the problem, but bear in mind that it's best to size the cache such that you don't exceed it in normal circumstances. Churning channels is not good practice. – Gary Russell May 08 '20 at 16:34