This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Scheduled(cron = "${spring.session.cleanup.cron.expression:0 * * * * *}") | |
| public void cleanupExpiredSessions() { | |
| this.expirationPolicy.cleanExpiredSessions(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void cleanExpiredSessions() { | |
| long now = System.currentTimeMillis(); | |
| long prevMin = roundDownMinute(now); | |
| if (logger.isDebugEnabled()) { | |
| logger.debug("Cleaning up sessions expiring at " + new Date(prevMin)); | |
| } | |
| String expirationKey = getExpirationKey(prevMin); | |
| Set<Object> sessionsToExpire = this.redis.boundSetOps(expirationKey).members(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class RedisOperationsSessionRepository implements | |
| FindByIndexNameSessionRepository<RedisOperationsSessionRepository.RedisSession>, | |
| MessageListener { | |
| ... | |
| @SuppressWarnings("unchecked") | |
| public void onMessage(Message message, byte[] pattern) { | |
| byte[] messageChannel = message.getChannel(); | |
| byte[] messageBody = message.getBody(); | |
| if (messageChannel == null || messageBody == null) { | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Configuration | |
| @EnableScheduling | |
| public class RedisHttpSessionConfiguration extends SpringHttpSessionConfiguration | |
| implements EmbeddedValueResolverAware, ImportAware { | |
| @Bean | |
| public RedisMessageListenerContainer redisMessageListenerContainer( | |
| RedisConnectionFactory connectionFactory, | |
| RedisOperationsSessionRepository messageListener) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @EnableRedisHttpSession | |
| public class RedisOperationsSessionRepositoryConfigNoOp { | |
| /** | |
| * Avoid changing Redis configuration for publishing specific events (gxE) | |
| * (see EnableRedisKeyspaceNotificationsInitializer - overrides ConfigureNotifyKeyspaceEventsAction which setting default event configuration ) | |
| * @return | |
| */ | |
| @Bean | |
| public static ConfigureRedisAction configureRedisAction() { | |
| return ConfigureRedisAction.NO_OP; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @EnableRedisHttpSession | |
| public class RedisOperationsSessionRepositoryConfigNoListener { | |
| /** | |
| * Prevent server from subscription to Redis events (see RedisHttpSessionConfiguration) | |
| * @param connectionFactory | |
| * @param messageListener | |
| * @return | |
| */ | |
| @Bean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @EnableRedisHttpSession | |
| public class RedisOperationsSessionRepositoryConfigNoListener { | |
| @Bean | |
| public RedisMessageListenerContainer redisMessageListenerContainer( | |
| RedisConnectionFactory connectionFactory, | |
| RedisOperationsSessionRepository messageListener) { | |
| return new RedisMessageListenerContainer(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu | |
| MAINTAINER Kimbro Staken | |
| RUN apt-get install -y python-software-properties python python-setuptools ruby rubygems | |
| RUN add-apt-repository ppa:chris-lea/node.js | |
| RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list | |
| RUN apt-get update | |
| RUN apt-get install -y nodejs | |
| RUN apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @RestController | |
| @Slf4j | |
| class BeerNamesController { | |
| @Output(Source.OUTPUT) | |
| @Autowired | |
| private MessageChannel messageChannel; | |
| @Autowired | |
| RestTemplate restTemplate; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @RestController | |
| @Slf4j | |
| class BeerNamesController { | |
| @Output(Source.OUTPUT) | |
| @Autowired | |
| private MessageChannel messageChannel; | |
| @Autowired | |
| RestTemplate restTemplate; |