RabbitTemplate with SIMPLE correlation causes uncached channels #2571
Unanswered
bjoernhaeuser
asked this question in
Q&A
Replies: 1 comment 7 replies
-
The But unfortunately no any explanation in the commit message. We can ask @garyrussell for insight, but looks like that condition in the
If we are on the same page, then I don't see why this discussion cannot be converted to issue with respective fix and so. Thanks |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I hope this discussion is at the right place.
We are using a CachingConnectionFactory with
CachingConnectionFactory.ConfirmType.SIMPLE
as publisher confirm type setting.Then we are using the RabbitTemplate something like this:
I thought this reuses channels, but after looking at the RabbitMQ stats I see a relatively high channel churn (in our case 50-100 channels/sec) and digging into this it looks like the RabbitTemplate is creating a new channel for every
.invoke()
call.After a debugging session through the code I saw that the
RabbitTemplate::invoke
method callsRabbitUtils.setPhysicalCloseRequired(channel, true);
Reference, when the connectionFactory says that publisher confirms are deactivated.Right now the
connectionFactory.isPublisherConfirms()
would only return true when theConfirmType
is set toCORRELATED
Reference.I am not familiar enough to judge if this is the right condition, but it looks to be that it should be changed to say
return !ConfirmType.NONE.equals(this.confirmType)
.Changing the value to be of confirmType
CORRELATED
changes the behaviour and channels are properly cached. Can someone please advise if my findings are correct and/or if I am using it simply wrong?Thank you very much!
Beta Was this translation helpful? Give feedback.
All reactions