examples-spring-redis-amq
16 строк · 453.0 Байт
1package com.tasks.cache.service
2
3import org.redisson.api.RedissonClient
4import org.redisson.client.codec.StringCodec
5import org.springframework.stereotype.Service
6
7
8@Service
9class SubscribeInitializer(redissonClient: RedissonClient, expireMessageListener: ExpireMessageListener) {
10
11init {
12redissonClient.getTopic("__keyevent@0__:expired", StringCodec.INSTANCE)
13.addListener(String::class.java, expireMessageListener)
14}
15
16}