Open glazkovalex opened 5 months ago
The best way to implement message deduplication I have seen in the "Azure Service Bus" If you make a dynamically configurable "window" for each topic separately, it will be optimal in terms of ease of use, maximizing performance and minimizing duplicates. Such a "window", which optionally would allow you to automatically send "rotten" messages older than the specified age inside the "window" of duplicates, immediately to the error queue.
The user interface is, of course, superfluous. Common global default settings, redefined for individual messages via the configuration (IOptions
Well, in the meantime, there is no such beauty in the Rebus, you will have to deduplicate the entire message, as always, using clumsy grandfather's methods 🙂
Hellow, @mookid8000! When a single handler is idempotent, everyone expects that it can be launched with the same parameters many times and at the same time be sure that repeated launches will not unnecessarily affect half of the services in information systems and will not spoil business data. The current implementation of the "idempotent Saga" in Rebus, regardless of transport, is idempotent only in relation to the internal status state of its states machine, but NOT the EVENTS generated by it. That is, the current implementation of the "idempotent Saga" in Rebus is NOT idempotent in relation to the business process it implements due to the following features of its implementation:
It is clear that the Saga cannot ensure the delivery of its messages only once and repeated deliveries of its messages are possible in any case. Therefore, all her clients should have idempotent handlers for her messages. But generating a batch of repeated messages with a lot of alarming messages and warnings is not at all what users expect from an "IDEMPOTENT" Saga.
As a general alternative solution to the problem of message deduplication, it would be possible not to change the "idempotent Saga", but to implement a separate package for custom deduplication of the necessary messages by "rbs2-msg-id", "rbs2-corr-id" and other message headers. I am sure that such a universal extension would be in great demand, since in almost every system it is necessary to implement deduplication of some messages.
Such a refinement of the "idempotent Saga" would greatly simplify the use of the "Idempotent Saga" of Rebus and would meet the expectations of its users.