Currently, our solution has two workflows called AddOrderCreateTransportShipment and ReceiveASN(modelled in webMethods BI and implemented in webMethods EI) implemented with an adapter called TDM Adapter
The AddOrderCreateTransportShipmentworkflow will perform the following business logic
-
Subscribe to document type addOrder
-
Upon receiving addOrder, the workflow will perform
the Operation (LockOrder)
-
Publish Document addOrderCreateTransportShipment
document
-
Upon receiving addOrderCreateTransportShipment
document, the workflow will perform the Operation
(Persist Order)
-
Publish Document postPersistOrder
-
Upon receiving postPersistOrder, the workflow will
perform the Operation (MapToShipmentPlanning)
-
Publish Document ShipmentPlanningRequest
-
Another Adapter (TransAdapter) will subscribe to the
document ShipmentPlanningRequest, create the
corresponding shipments in the Transportation
Planning System and publish the document:
postShipmentPlanningRequest
-
Upon receiving postShipmentPlanningRequest, the
workflow will perform Operation (PersistShipments)
-
Publish postPersistShipments
-
Upon receiving document postPersistShipments, the
workflow will perform the Operation (UnlockOrder)
The ReceiveASN workflow will essentially
-
Subscribe to document type ReceiveASN
-
Perform the Operation (Lock Order)
-
Perform the Operation (UpdateOrderFromASNInfo)
-
Perform the Operation (UnlockOrder)
Note 1:
since webMethods BI is used to model the workflows and generate the implementation in webMethods Enterprise, all the above operations are generated as individual Integration Components in webMethods Enterprise
Issues
During our stress test environment, we found the following deadlock and performance issues
-
DeadLock
TDM Adapter receives an addOrder message, then the
adapter call integration components LockOrder to lock
the order then publish the document
AddOrderCreateTransportShipment. Meanwhile, a ReceiveASN message (refer to the same Order) comes in, the TDM Adapter Thread switch to process the ReceiveASN message, try to ‘Wait’ to lock the order and holding the thread accordingly (until timeout). In a stressed environement, this will result in a deadlock since all TDM Thread (Receive ASN) may wait for a order to lock while no thread are available to continue the AddOrderCreateTransportShipment workflow to complete the processing and unlock the order
2. Performance Issues
There is no document priority (???) in webMethods Enterprise Server.
Assume there is 200 addOrder message in the TDM Adapter Queue. The TDM Adapter will process the 1st message, publish the addOrderCreateTransportShipment. This document will then be re-queued at the end of the TDM Adapter queue and have to wait for the other 199 addOrder message get processed before its turn.
This result in really poor perceived performance since the TDM Adapter is not trying to finish a single flow first. Thus all addOrder get processed, but none get finished. This also causes unnecessary timeout on ReceiveASN workflow as well
Would appreciate if anyone can shed some light on the possible solution here ??
We have try using 3 TDM Adapter instead of 1. 1 Adapter for the LockOrder, 1 Adapter for other processing and 1 Adapter for the Unlock Order. This will eliminate the DeadLock Issues. However, this does not
#Integration-Server-and-ESB#webMethods#webMethods-Architecture#webMethods-General