The example in which you are referring uses a simple queue without exchange, which ensures that only one consumer will process the message. To support pub / sub in RabbitMQ, you first need to create Exchange, and then each subscriber will bind a queue on this Exchange. The manufacturer then sends messages to Exchange, which will publish a message for each queue associated with it (at least with a simple type of Fanout exchange. Routing can be achieved by exchanging Direct and Topic.)
For a Java example (which can be easily converted to C #), see here .
Edit: An updated version of .Net can be found here.
dlev
source share