简体   繁体   中英

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

I am a subscriber application. I receive messages from 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. 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.

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.

ActiveMQ or IBM MQ would fit your usecase perfectly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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