Route requests with a certain ID to same node

Hi all, I’m a software developer with no experience in DevOps and in my recent project I stumbled upon this problem that I don’t know if Consul can address.

Our use case is this: we have a VoIP app similar in idea to Discord. Users can join a voice channel and start talking. However, to forward the voice packets between users in a same voice channel, their WebRTC voice connections need to be handled by a same server process, so that we can process & forward all the voice packets in a voice channel in-memory.

In order to do this, we have a separate service (call it service X) in front of our voice service (service V) that receives a user request to join channel N, and based on N, assign a server in service V to the user. We need to guarantee that for the same channel N, X always picks the same server in V.

We implemented this in a non-scalable way just for quick prototyping. Now that we want to implement this properly, I’m wondering if Consul can help us in this scenario.

Any suggestion is appreciated! I have no experience in the DevOps area so please pardon my noob question.

Consul alone definitely cannot do this. You need some proxy/load balancer which can take a header or something and make the decision about which server to send it to.