Reputation: 165
We are running Rebus as a backbone for our batch system. We have several queues (i.e. message types) which can be handled by several workers. Each worker can only handle one message type. So for example for message_1 we have 2 workers (worker1 and worker2) which can handle this message. Currently the first worker which is free handle will handle the message. This is the default behavior and working good.
My query is if I can setup Rebus in any way so that if the message contains a worker id (for example for worker 2) only that worker should be able to process that message. If no worker id is in the message, then default behavior (see above) should prevail.
Upvotes: 0
Views: 427
Reputation: 18628
There's no way (at least not at the moment) to achieve the thing you're describing here.
If you have special requirements for certain message types (or certain message instances), I suggest you forward those messages to one or more special endpoints that can handle those kinds of messages.
The forwarding can be done based on headers and can thus be set up to work in a generic fashion without necessarily being able to deserialize the message contents.
If you tell me more about what problem it is you're trying to solve, maybe we can figure out a more elegant solution (or at least one that can be solved more elegantly with Rebus).
Upvotes: 1