You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 calls RabbitUtils.setPhysicalCloseRequired(channel, true);Reference, when the connectionFactory says that publisher confirms are deactivated.
Right now the connectionFactory.isPublisherConfirms() would only return true when the ConfirmType is set to CORRELATEDReference.
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!
The text was updated successfully, but these errors were encountered:
Discussed in #2571
Originally posted by bjoernhaeuser December 15, 2023
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!
The text was updated successfully, but these errors were encountered: