Search code examples
rebusrebus-azureservicebus

Request-reply with more clients and one server


How does Rebus ensure that a requester gets the response destined for the requester from the server?

The context is a setup with multiple clients, one backend server and two azure servicebus queues one for the client side and one for the server side. One client's response must not be received by another client.

My concern is that Rebus doesn't support sessions on azure service bus.


Solution

  • How does Rebus ensure that a requester gets the response destined for the requester from the server?

    Rebus replies back to the queue specified with the rbs2-return-address header in the request, so if you have multiple instances consuming messages from that queue, then the reply will likely not be received by the original sender.

    That's pretty much how it works, so it's important that all Rebus instances that consume messages from the same queue have the same capabilities. This implies that e.g. keeping in-mem, non-distributed state in a process that may receive replies from requests sent by other Rebus instance is a no-go.

    If you describe the problem you're trying to solve, then maybe I can give you some inspiration on how to solve it.