Recently I had designed a system to process health data using JMS. The message must contain Patient Info such as Name, Health Card Number, etc. In addition the message may contain Patient Immunization record(s). I am using Spring Boot and I was able to process those messages concurrently by configuring multiple Message Listeners (up to 30). So I was able to gain a performance. However those messages are processed out of it chronological sequence causing data inconsistency. For example Message A represents new Patient record and message B represents an update to Patient created with message A. If processed subsequently (Message A and then Message B) the result is consistent with the upstream system. However if processed concurrently the results are not sync with reality (Message B may get processed before Message A). Clearly I shall not start processing Message B if there Message A. Let's say I have means to determine it (each message has event timestamp and status). But how to practically implement it? I would appreciate if anybody shares their experience. The actual technology does not matter, I am looking for some sort of Design pattern
Aucun commentaire:
Enregistrer un commentaire