Multiple Consumers for a Single Queue at MassTransit

Is it possible for multiple consumers to listen on one instance of MSMQ and use the Selective Consumer interface so that each of them deals with a separate subset of messages? I can’t get this script to work correctly using pub / sub - one consumer in the queue is working fine, but when using> 1 consumer (multiple instances of the same executable) no messages appear anywhere. As far as I understand, this does not apply to “competing consumers,” since only one consumer processes one message.

Any help or pointers appreciated.

+5
source share
1 answer

If you use MassTransit to send messages from the MSMQ queue, it is recommended that the queue be local to the field.

If you have several processes that are read from the same queue to spread the load on messages, you can use selective trick to use only messages in each instance that are relevant to this process.

For example, if you have multiple instances of an application that sends messages to a service, and this service responds with a correlated message, you can subscribe to the correlated message by identifier, and only those signed messages will be sent. Messages that are not selected will remain in the queue until they are processed by any of the processes of interest.

- , .

/ .

+2

All Articles