I am using socket.io-redis-streams-adapter. Theoretically, when I connect to the same Redis-backed Socket.IO server from multiple Node processes, when I use io.sockets.adapter.sids.size to query the count, I find that the counts are different between the two processes. I am using a Koa service to connect and have attached io to the Koa context (ctx). There are two Node services behind an Nginx proxy. When I send requests to these two services, the response sizes are completely different. Have I used it incorrectly?
In multiple Node processes, I use the following method to check if a room exists and then retrieve the corresponding socket through ctx.io.sockets.sockets.get(socketId):
const members = ctx.io.sockets.adapter.rooms.get(roomid);
Does this mean that if I switch to another Node process, I cannot retrieve the socket in this way? In other words, is it not possible to use this method to determine if a socket exists?
Are ctx.io.sockets.adapter.rooms.get(roomId), ctx.io.sockets.sockets.get(socketId), io.sockets.adapter.rooms, and io.sockets.adapter.sids synchronized across multiple machines or Node processes after using redis-streams-adapter? What should I pay attention to when using them?
When ensuring that messages are always delivered reliably across multiple hosts or Node processes, can I only use io.to() with room names and not with individual socket.io instances?
I am using socket.io-redis-streams-adapter. Theoretically, when I connect to the same Redis-backed Socket.IO server from multiple Node processes, when I use io.sockets.adapter.sids.size to query the count, I find that the counts are different between the two processes. I am using a Koa service to connect and have attached io to the Koa context (ctx). There are two Node services behind an Nginx proxy. When I send requests to these two services, the response sizes are completely different. Have I used it incorrectly?
In multiple Node processes, I use the following method to check if a room exists and then retrieve the corresponding socket through ctx.io.sockets.sockets.get(socketId):
const members = ctx.io.sockets.adapter.rooms.get(roomid); Does this mean that if I switch to another Node process, I cannot retrieve the socket in this way? In other words, is it not possible to use this method to determine if a socket exists?
Are ctx.io.sockets.adapter.rooms.get(roomId), ctx.io.sockets.sockets.get(socketId), io.sockets.adapter.rooms, and io.sockets.adapter.sids synchronized across multiple machines or Node processes after using redis-streams-adapter? What should I pay attention to when using them?
When ensuring that messages are always delivered reliably across multiple hosts or Node processes, can I only use io.to() with room names and not with individual socket.io instances?