Reputation: 3355
I have the logic of message processing is not idempotent. So before executing it I have each incoming message to check for duplicates through a special database table that long.
In the case of RabbitMQ, example, if a message is delivered to a consumer and then requeued then RabbitMQ will set the "redelivered" flag on it when it is delivered again. https://www.rabbitmq.com/reliability.html#consumer
Is there a way to know what rebus sent the message again after a failed attempt or need to check every message on duplicate?
If this is not possible, as usually quickly and reliably deduplicate messages, without using a database?
Upvotes: 2
Views: 487
Reputation: 18628
Is there a way to know what rebus sent the message again after a failed attempt or need to check every message on duplicate?
There's no general way to detect a redelivered message with Rebus.
Rebus' RabbitMQ transport could have had the ability to pass the "redelivered" flag on to the consumer as a special header, but it doesn't (at least not at the moment).
Upvotes: 2