简体   繁体   English

如何在消息队列集成模式中构建数据完整性检查?

[英]How to build data integrity checks in Message Queue integration pattern?

I am a subscriber application.我是订阅者应用程序。 I receive messages from Publisher.我收到来自 Publisher 的消息。 One message at a time.一次一条消息。

Question is: I would like to ensure:问题是:我想确保:

  1. I have received same number of messages from my publisher (and have not dropped anything in between)我从我的发布者那里收到了相同数量的消息(并且没有丢弃任何内容)
  2. I have received each message with completeness and accuracy (with all attributes)我收到了完整和准确的每条消息(具有所有属性)

Please advise if this is implicitly covered or do I need to do anything special for this?请告知这是否被隐含地涵盖,或者我需要为此做任何特别的事情吗?

在此处输入图像描述

You should use use a MQ product which has support for transactions and "only once" delivery.您应该使用支持事务和“仅一次”交付的 MQ 产品。 By using that kind of software the second point - the accuracy - is guaranteed as you cannot commit transaction if anything goes bad.通过使用这种软件,第二点 - 准确性 - 得到保证,因为如果出现任何问题,您将无法提交事务。 The first point - no messages dropped or skipped - is implied.第一点——没有消息被丢弃或跳过——是暗示的。 With transactions you just can't drop messages.有了事务,您就不能丢弃消息。 That will not happen.那不会发生。 You can skip them if some other subscriber reads them instead of you.如果其他订阅者而不是您阅读它们,您可以跳过它们。 But your picture implies that there is one subscriber to each q so you can sleep well.但是您的图片暗示每个 q 都有一个订阅者,因此您可以睡个好觉。

If you want to prevent tampering with messages you can use something like IBM MQ Advanced Message Security or build your own app level protocol on top of MQ.如果您想防止篡改消息,您可以使用 IBM MQ Advanced Message Security 之类的东西,或者在 MQ 之上构建您自己的应用程序级协议。

ActiveMQ or IBM MQ would fit your usecase perfectly. ActiveMQ 或 IBM MQ 将非常适合您的用例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM