Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure proper use of Channel-caching in the CachingConnectionFactory [AMQP-43] #1610

Closed
spring-operator opened this issue Aug 5, 2010 · 4 comments

Comments

@spring-operator
Copy link
Contributor

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

@spring-operator
Copy link
Contributor Author

spring-operator commented Sep 29, 2010

Dave Syer commented

#1629 covered the trasnactional semantics for synchronous clients. It uses basicRecover(), so the async clients probably should as well.

@spring-operator
Copy link
Contributor Author

Dave Syer commented

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.

@spring-operator
Copy link
Contributor Author

spring-operator commented Oct 22, 2010

Dave Syer commented

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.

@spring-operator
Copy link
Contributor Author

spring-operator commented Mar 14, 2011

Dave Syer commented

This is now OK after #1613 was fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants