EasyNetQ/RabbitMQ - Publishing a message based on topic

1k views Asked by At

I have created a subscriber in EasyNetQ/RabbitMQ with a topic. I think I have atleast because I can see that there is a binding under a queue name. It looks like the following :

enter image description here

The Queue name itself is a random GUID. But I don't think this matters.

However when I try and publish a message via EasyNetQ like so :

await _bus.PublishAsync(new Message<byte[]>(memoryStream.ToArray()), "QueueCallback");

The message never gets published onto the above queue.

1

There are 1 answers

0
MindingData On BEST ANSWER

Worked this out.

I was publishing inside a message wrapper, however I was subscribing as a byte array only. Even if the routing key is the same, if the object type is not an exact match it will never be routed.