admin管理员组文章数量:1317894
How do I make sure that there are no duplicate queue messages when they have a common correlation ID? How do I ignore the publishing of a queue message when there is already one on the queue with the same correlation ID?
This is needed to keep the queues clean. For example: Amazon SQS has a Message deduplication ID
Does MassTransit also have this functionality when using a postgres database?
I tried creating messages with the same correlation ID but duplicate ones are still added to the queue.
How do I make sure that there are no duplicate queue messages when they have a common correlation ID? How do I ignore the publishing of a queue message when there is already one on the queue with the same correlation ID?
This is needed to keep the queues clean. For example: Amazon SQS has a Message deduplication ID
Does MassTransit also have this functionality when using a postgres database?
I tried creating messages with the same correlation ID but duplicate ones are still added to the queue.
Share Improve this question asked Jan 22 at 15:08 BrianBrian 1511 silver badge13 bronze badges 1- I updated the answer to explain why. And how to deal with it properly. – Chris Patterson Commented Jan 25 at 14:38
1 Answer
Reset to default 2There is no deduplication ID in the SQL transport.
A message store should not be used as a database. Relying on the transport to deduplicate data is a bad idea in general. You should have an idempotent domain that can deal with duplicates.
Create a saga with a unique property (your de-duplication value) and ensure that any duplicate messages are properly handled. The saga repository (EF Core? it's a database table) then becomes your deduplicated data store – not the queue.
本文标签:
版权声明:本文标题:postgresql - How to achieve message deduplication when using MassTransit with postgres transport and EF Core for persistence - S 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742037368a2417373.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论