Closed bartkusters closed 7 years ago
Hello, @bartkusters - thanks for asking!
Looks like the only thing that the client needs to do is to add the x-delay
header. Depending on what version you are running (1.x or 2.0) this is done slightly differently.
For 1.x
await client.PublishAsync(new BasicMessage
{
Prop = "I am important!"
}, configuration: cfg => cfg.WithProperties(p => p.Headers.Add("x-delay", 5000)));
For 2.0
await client.PublishAsync(message, ctx => ctx
.UsePublisherConfiguration(cfg => cfg
.WithProperties(p => p.Headers.Add("x-delay", 5000)
)));
I haven't run the code myself, but hopefully this will get you started. There might be a null pointer exception if Header
is not defined, in that case just define it in the WithProperties
action.
Hope this helps!
Hi Par,
Thanks a lot for your quick reply. I'll give it a try.
Cheers
I was reading these links and was wondering how to achief this with RawRabbit?
https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq/ or https://github.com/rabbitmq/rabbitmq-delayed-message-exchange
Many thans in advance,
Bart