Redis pub/sub channel listener should execute messages parallely. #2018
Unanswered
Prashant-Thorat
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Redis itself is single-threaded and the connection protocol is sequential. You can still offload work to a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi for my chatting application I'm planning to use the redis pub/sub for server scalability. wanted to use Redis pub/sub for broadcasting messages between servers.
`
String redisUrl = "redis://" + host + ":" + port;
redisClient = RedisClient.create(RedisURI.create(redisUrl));
syncPool = redisClient.connect();
isRunning = true;
StatefulRedisPubSubConnection<String, String> connection = redisClient.connectPubSub();
RedisPubSubAsyncCommands<String, String> async = connection.async();
async.subscribe("messages");
connection.addListener(new RedisMessageHandler());
`
RedisMessageHandler is processing messages in sequential manner(i.e. one after another). but I wanted to send received message in parallel.
Beta Was this translation helpful? Give feedback.
All reactions