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
One aspect of this problem is that the connection factory does not re-create channels that are closed automatically by the Rabbit client on exception. An easy way to see this is to simply try and access the broker in some "harmless" way, expecting an exception:
template.execute(new ChannelCallback<DeclareOk>() {
public DeclareOk doInRabbit(Channel channel) throws Exception {
DeclareOk ok = channel.queueDeclarePassive("test.queue");
return ok;
}
});
if the queue doesn't exist there is an exception. Catch it and then try:
admin.declareQueue(new Queue("test.queue"));
this should succeed but fails with {com.rabbitmq.client.AlreadyClosedException} because the template is trying to use the same channel that was closed in the first exception.
I committed a change to the CCF to refresh the channel when it dies after an exception. This has some overlap with #1613 ("connection retry") because it doesn't make sense for some clients to simply ignore a channel closing because it might have exclusive consumers (for instance). It does make sense in some cases though, and it fixes an integration test, so I decided to commit and re-visit when we get to the other retry use cases.
Mark Fisher opened AMQP-43 and commented
Consider transactions vs. non-transactional channels (keep separate since TX will always apply once started)
Consider the role of the Channel for async consumers (esp. on "rollback"... do we call basicRecover() or close()?)
No further details from AMQP-43
The text was updated successfully, but these errors were encountered: