Rework RedisHttpSessionConfiguration to bean method invocations
Closes: #1362
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014-2018 the original author or authors.
|
* Copyright 2014-2019 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -125,7 +125,8 @@ public class RedisHttpSessionConfiguration extends SpringHttpSessionConfiguratio
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public RedisMessageListenerContainer redisMessageListenerContainer() {
|
public RedisMessageListenerContainer redisMessageListenerContainer(
|
||||||
|
RedisOperationsSessionRepository sessionRepository) {
|
||||||
RedisMessageListenerContainer container = new RedisMessageListenerContainer();
|
RedisMessageListenerContainer container = new RedisMessageListenerContainer();
|
||||||
container.setConnectionFactory(this.redisConnectionFactory);
|
container.setConnectionFactory(this.redisConnectionFactory);
|
||||||
if (this.redisTaskExecutor != null) {
|
if (this.redisTaskExecutor != null) {
|
||||||
@@ -134,12 +135,13 @@ public class RedisHttpSessionConfiguration extends SpringHttpSessionConfiguratio
|
|||||||
if (this.redisSubscriptionExecutor != null) {
|
if (this.redisSubscriptionExecutor != null) {
|
||||||
container.setSubscriptionExecutor(this.redisSubscriptionExecutor);
|
container.setSubscriptionExecutor(this.redisSubscriptionExecutor);
|
||||||
}
|
}
|
||||||
container.addMessageListener(sessionRepository(), Arrays.asList(
|
container.addMessageListener(sessionRepository,
|
||||||
new ChannelTopic(sessionRepository().getSessionDeletedChannel()),
|
Arrays.asList(
|
||||||
new ChannelTopic(sessionRepository().getSessionExpiredChannel())));
|
new ChannelTopic(sessionRepository.getSessionDeletedChannel()),
|
||||||
container.addMessageListener(sessionRepository(),
|
new ChannelTopic(sessionRepository.getSessionExpiredChannel())));
|
||||||
|
container.addMessageListener(sessionRepository,
|
||||||
Collections.singletonList(new PatternTopic(
|
Collections.singletonList(new PatternTopic(
|
||||||
sessionRepository().getSessionCreatedChannelPrefix() + "*")));
|
sessionRepository.getSessionCreatedChannelPrefix() + "*")));
|
||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user