NServiceBus: Requirement for a Process to Publish to more than 1 Queue
We have a process that uses NServiceBus already to publish messages to other processes running in our system. I want to add additional functionality to this process which will require it to publish messages to other processes, but I want to be able to write to another queue with the new type of message. Preferably, I don开发者_如何学Go’t want to mix messages together on the same queue as they have different priorities. All that I have seen indicates that NServiceBus only supports one queue per process. Is this correct?
If this is so, then can anyone suggest a good workaround? The only one I can think of is to house the new queue in a separate “NServiceBus Hub” process, then use the WCF integration feature to relay the new message inter-process from my process to the hub for insertion on the new queue.
Thanks.
Your concern about mixing high and low priority messages on a single queue is valid.
This needs to be addressed at both the sender and receiver side.
The sender does not write locally to it's own single queue. Rather when it sends a message to a recipient the sender writes to a temporary local queue specific to that recipient.
So you have two potential problems:
- The receiver processing high and low priority messages from the same queue.
- The sender is sending both high and low priority messages.
If this is the case you can do one or both of:
- Separate the receiver service into two services, one for high priority processing and one for low priority.
- You may also want to separate the high priority processing into it's own NServiceBus publisher service.
This will give you the multiple endpoints by priority with a clean separation between them.
精彩评论