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

RedisKeyValueAdapter.destroy calls RedisConnectionFactory.destroy [DATAREDIS-507] #1083

spring-projects-issues opened this issue May 3, 2016 · 0 comments
type: bug


Copy link

@spring-projects-issues spring-projects-issues commented May 3, 2016

Mark Paluch opened DATAREDIS-507 and commented

The RedisKeyValueAdapter creates an exception during shutdown:

2016-05-03 12:07:02.343  WARN 94337 --- [       Thread-6]    : Invocation of destroy method failed on bean with name 'redisKeyValueAdapter': com.lambdaworks.redis.RedisException: Connection is closed

This is because RedisKeyValueAdapter closes the connection factory before the message listener containers are shut down:

	public void destroy() throws Exception {

		if (redisOps instanceof RedisTemplate) {
			RedisConnectionFactory connectionFactory = ((RedisTemplate<?, ?>) redisOps).getConnectionFactory();
			if (connectionFactory instanceof DisposableBean) {
				((DisposableBean) connectionFactory).destroy();


Closing the RedisConnectionFactory seems not necessary as the bean is managed by the container itself

Reference URL:

Referenced from: pull request #195

Backported to: 1.7.2 (Hopper SR2)

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

No branches or pull requests

2 participants