1

Is there a way of publishing delayed messages with topics with EasyNetQ? I was able to send direct delayed messages using the FuturePublish method, but it doesn't allow me to specify a topic.

Links:

Scheduling Events with Future Publish

RabbitMQ gets support for delayed messages delivery

Thanks

peflorencio
  • 2,284
  • 2
  • 32
  • 40

1 Answers1

0

It should be possible, yes. The delayed message exchange allows you to specify the type of exchange to use after the delay: fanout, topic, direct.

Looking at the code samples in the second link you posted, you should only need to change the "direct" configuration to "topic".


IDictionary args = new Dictionary
{
    {"x-delayed-type", "topic"} //----------- here
};
channel.ExchangeDeclare("DelayedTest", "x-delayed-message", true, false, args);

then follow the rest of the example as shown and you can publish with a topic for the routing key.

Derick Bailey
  • 72,004
  • 22
  • 206
  • 219
  • I wanted to avoid using the Advanced API, but it seems that it is the only way. I wonder why they haven't added topic as a parameter, similar to the regular Publish – peflorencio Aug 06 '15 at 13:03