This blog promotes knowledge sharing through experience and collaboration. For more product information, visit our WebSphere Commerce CSE page. For easier navigation, utilize the Categories to find posts that match your interest.
Understanding Synchronous and Asynchronous Order Transfer
In this post, I outline the difference between synchronous and asynchronous modes when transferring orders to an external order management system (OMS). I will also explain how each mode is configured within your environment.
WebSphere Commerce supports order transfer in both synchronous and asynchronous modes. By default, order transfer has been configured as asynchronous, but you can change it to meet your business requirement.
Before I outline the difference between the synchronous and asynchronous modes, allow me to quickly break down the process of transferring an order to an external OMS. Transferring an order to external system is a two stage process.
1. The 'orderSubmit' event
2. Message communication
This event is triggered when order is submitted on storefront. Processing of this event can be either synchronous or asynchronous, based on the priority configured in WebSphere Commerce configuration file (wc-server.xml).
Priority can be configured as high/medium/low. Here, high implies for synchronous event processing, medium and low implies for asynchronous event processing:
Once OrderSubmitEventListener processes the orderSubmit event, it generates the order xml messages. These order xml messages are then transferred to external system using WebSphere Commerce messaging framework.
The actual process of transferring these order messages to an external order management system can be either synchronous or asynchronous, based on the configuration stored in the component configuration (wc-component-client.xml) file, under com.ibm.commerce.order.external. Look for the following element:
<_config:action name="ProcessOrder" asynchronous="false">
In synchronous message processing, the generated order xml messages are transferred immediately to external order management system, while WCS waits, in real time, for acknowledgement from the external system to complete the order transfer transaction flow. In asynchronous message transfer process, the generated order xml message is stored in MSGSTORE table first, and then the SendTransactedMsg schedule job picks up these messages to transfer it to external system; WCS does not wait for an acknowledgement from external order management system to complete the order transfer transaction flow. The advantage to using asynchronous order transfer is that the shopper doesn't have to wait for an acknowledgement to complete the order flow.
By default, both the orderSubmit event and messaging are configured to be asynchronous, but they can be configured to meet your business requirement. If your business needs to transfer the order immediately, as well as confirm the real time response from external order management system, you can use synchronous for both event and messaging.