Chathuri Gunawardhana
Chathuri Gunawardhana

Reputation: 171

Configure a queue for customl retry messages in Rebus

I was able to write a custom retry policy, using sql server as the deferred message storage. But now, for the scalability reasons I would like to run multiple workers(message handler tasks) deployed over different machines. Due to that reason I would like to have a central place to read deferred messages(like from a queue) rather than reading from sql server.

Is there any way to store the deferred messages in a queue? Is that a better approach? What would be the better approach to do this?

Upvotes: 1

Views: 215

Answers (1)

mookid8000
mookid8000

Reputation: 18628

Is there any way to store the deferred messages in a queue? Is that a better approach?

Not with any queues I am familiar with :) Most queues are really good at fifo, which conflicts with deferred messages in that the delay can vary on a per-message basis (at least in the general case).

The desire to access messages ordered potentially very differently from the order they were sent, makes databases with secondary indexes a pretty good technology for storing deferred messages.

What would be the better approach to do this?

I am not sure I understand what you think is wrong with storing deferred messages in SQL Server, though.

Of course, if you have many endpoints deferring messages, you might want to use an "external timeout manager" instead of having each individual endpoint poll the database – this can be had by doing this in your endpoints:

Configure.With(...)
    .(...)
    .Timeouts(t => t.UseExternalTimeoutManager("timeouts"))
    .Start();

and then simply start an endpoint with a configured timeout storage and the input queue timeouts.

Upvotes: 1

Related Questions