Distributed Message Ordering

Posted by sbanwart on Stack Overflow See other posts from Stack Overflow or by sbanwart
Published on 2010-04-11T03:02:03Z Indexed on 2010/04/11 3:03 UTC
Read the original article Hit count: 314

I have an architectural question on handling message ordering. For purposes of this question, the transport is irrelevant, so I'm not going to specify one.

Say we have three systems, a website, a CRM and an ERP. For this example, the ERP will be the "master" system in terms of data ownership. The website and the CRM can both send a new customer message to the ERP system. The ERP system then adds a customer and publishes the customer with the newly assigned account number so that the website and CRM can add the account number to their local customer records. This is a pretty straight forward process.

Next we move on to placing orders. The account number is required in order for the CRM or website to place an order with the ERP system. However the CRM will permit the user to place an order even if the customer lacks an account number. (For this example assume we can't modify the CRM behavior) This creates the possibility that a user could create a new customer, and place an order before the account number gets updated in the CRM.

What is the best way to handle this scenario? Would it be best to send the order message sans account number and let it go to an error queue? Would it be better to have the CRM endpoint hold the message and wait until the account number is updated in the CRM? Maybe something completely different that I haven't thought of?

Thanks in advance for any help.

© Stack Overflow or respective owner

Related posts about architecture

Related posts about integration