Hello,

I need help to understand which is the best way to handle this scenario.

*General information*:

1. I consume messages from an *Azure* queue that collects "status"
   messages. Each message rappresents a passing of state for a specific
   entity instance.
2. I have entity instance E1 with initial status S1
3. E1 status flow is:
    1. from status S1 -> S2
    2. from status S2 -> S3
    3. Is not valid other kind of status passage (for example S1 -> S3)

*Standard scenario*: when I consume messages where the status flow is valid there are no problems

 * In the queue there are both messages with "E1 - S2" and "E1 - S3"
 * I receive message with "E1 - S2" -> E1 status will be changed in S2
 * Then I receive message with "E1 - S3" -> E1 status will be changed in S3
 * CORRECT

*Particular scenario*: if my message consumer receives unsorted messages, I could lose information.

 * In the queue there are both messages with "E1 - S2" and "E1 - S3"
 * I receive message with "E1 - S3" -> NOT VALID, E1 status will still
   be S1
     o The message ackType is MODIFIED_FAILED because it is a trasient
       error. If in next consuming attempts I have consumed message "E1
       - S2" successfully, also this message can be consumed successfully
 * If I have maximum 10 retries before deadletter.
 * If I would consume 10 times message "E1 - S3" before "E1 - S2" ->
   Message "E1 - S3" would go in Deadletter and I would lose that
   information


Basically my scenario is composed by "consecutive" messages because they must follow a specific state diagram. Each status is important it must be consumed before the next; it wouldn't be acceptable just to take the latest one.

My question now is: how do AMQP and QPID handle this kind of scenario?

Best Regards
--
SMC Consulting <http://www.smcconsulting.it>

facebook <http://www.facebook.com/SMC-Consulting-Srl-597548223675024/> linkeding <http://www.linkedin.com/company/smc-consulting-srl> *Alessandro Crotti*
Senior Developer

tel:  +39 342 573 4450
skype:  crotti.alessandro

*SMC Consulting* <http://www.smcconsulting.it>
Via dell'industria, 87 41012 Carpi (MO) - Italy
tel: +39 059 664875

CONFIDENTIALITY NOTICE: This message may contain confidential and/or privileged information. If you are not the intended recipient, please do not use its contents for any purpose, advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.

Reply via email to