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
Description
I am using a ThreadChannelConnectionFactory within a RabbitTemplate with setChannelTransacted=true.
The rabbitTemplate.send is invoked within a transaction excuted with a TransactionTemplate.
When the transaction created by TransactionTemplate is committed, the corresponding RabbitMQ Channel is always closed.
The ThreadChannelConnection/RabbitTemplate is not used within a MessageListenerContainer.
I am expecting the ThreadChannelConnection to cache the channel and not to close it.
In my opinion the if-statement seems not to be correct. In my case transactional is true, this.txChannels.get() is != null, but this.channels.get() is null. So transactional && this.txChannels.get() == null is false, but this.channels.get() == null is true and the channel is closed.
Version
spring-rabbit:2.4.7
Description
I am using a ThreadChannelConnectionFactory within a RabbitTemplate with setChannelTransacted=true.
The rabbitTemplate.send is invoked within a transaction excuted with a TransactionTemplate.
When the transaction created by TransactionTemplate is committed, the corresponding RabbitMQ Channel is always closed.
The ThreadChannelConnection/RabbitTemplate is not used within a MessageListenerContainer.
I am expecting the ThreadChannelConnection to cache the channel and not to close it.
Code
The method:
ThreadChannelConnectionFactory.ConnectionWrapper.handleClose
if (transactional && this.txChannels.get() == null ? true : this.channels.get() == null) { physicalClose(channel); }
closes the channel.
In my opinion the if-statement seems not to be correct. In my case transactional is true, this.txChannels.get() is != null, but this.channels.get() is null. So
transactional && this.txChannels.get() == null
is false, butthis.channels.get() == null
is true and the channel is closed.Shouldn´t it look like this?
transactional && this.txChannels.get() == null || !transactional && this.channels.get() == null
The text was updated successfully, but these errors were encountered: