rebus-org / Rebus.RabbitMq

:bus: RabbitMQ transport for Rebus
https://mookid.dk/category/rebus
Other
65 stars 45 forks source link

Cannot customize the error queue #59

Closed virtualcca closed 4 years ago

virtualcca commented 5 years ago

I hope to implement the delayed automatic retry mechanism based on the dead letter mechanism of rabbitmq itself.

like this: https://gagnechris.wordpress.com/2015/09/19/easy-retries-with-rabbitmq/

but i see RabbitMqTransport.cs line:259

In order to achieve this, for example, I need the queue to support ttl, but it seems that I can't specify the error queue to support this feature because it uses the default configuration.

mookid8000 commented 5 years ago

You should be able to create the queue manually beforehand, and then you can configure Rebus to use it like this:

Configure.With(...)
    .Transport(t => t.UseRabbitMq(...))
    .Options(o => o.SimpleRetryStrategy(errorQueueAddress: "delay"))
    .Start();

Would this work for you?

virtualcca commented 5 years ago

I specified a pre-created queue with ttl in SimpleRetryStrategy. But the application is unable to start, the error message is as shown in the figure.

Snipaste_2019-09-05_19-33-34 Snipaste_2019-09-05_19-33-55

mookid8000 commented 4 years ago

Hi @virtualcca , sorry for not getting back to you sooner... have you figured something out, or is this still a problem?

virtualcca commented 4 years ago

I think this may be a function that needs to be optimized. Currently, the error queue cannot be customized, and we hope to retry based on the dead letter queue.

mookid8000 commented 4 years ago

I think you can make it work by disabling queue declaration alltogether:

Configure.With(...)
    .Transport(t => {
        t.UseRabbitMq(...)
            .Declarations(declareInputQueue: false);
    })
    .Options(o => o.SimpleRetryStrategy(errorQueueAddress: "delay"))
    .Start();

although this is not optimal,because you'll need to manually create all of your queues.....