Redis Dynamic Topic Subscription

Viewed 15

Currently, I am using Redis as pub/sub and using jedis client. I am subscribing to topic device/{deviceId}/{parameterId}

I want to read the values of deviceId and parameterId from the topic.

I tried. device/* device*

but I am not getting the complete topic details. Is it possible to do so using java?

@Bean
RedisMessageListenerContainer redisContainer() {
    final RedisMessageListenerContainer container = new RedisMessageListenerContainer();
    container.setConnectionFactory(jedisConnectionFactory());
    container.setTaskExecutor(Executors.newFixedThreadPool(4));
    container.addMessageListener(messageListnerAdapter(), new PatternTopic("device/*"));
    return container;
}
0 Answers
Related