corvus-ch / rabbitmq-cli-consumer

Consume RabbitMQ messages into any cli program
MIT License
236 stars 37 forks source link

Request - Max Retry #78

Open cansozeri opened 4 years ago

cansozeri commented 4 years ago

Hi,

Is there anyway to add max retry functionality to this consumer like Laravel --tries=3 ?

I think every reject action, consumer can add a property if not exist to the message like "attempts_count" = 1 and if exists, increment like "attempts_count" = 2. This functionality will be great ...

But as I see the project is very dependent on streadway/amqp library, so I think it is not possible to add this on Delivery package in this project right now ?

cansozeri commented 4 years ago

I think when a message rejected or an error occured - we could send an ack to the RabbitMq server, and push the message payload to the queue with adding a property like "attempts_count" +1.

We can control this property while consuming and throw an error if the max try option has been exceeded which is placed in the configuration file or passed as an argument?