I am using servicemix for both synchronous as well as asynchronous operations. In case of async I am using jms topic. The flow is like this. Application1--->http consumer--->Bean component--->Camel--->Camel Validator--->JMS Topic --->JMS Consumer--->http Provider (Through camel)--->Application2 Once the message is put in topic success message is sent to client. But there are few scenarios where this leads to inconsistency on both applications Here are some of them.
1. Servicemix crashes during the response 1. Request is sent from app1 2. Message sent to topic 3. smx crashes while sending a response. This sends error message to app1 and hence rolled back 4. After smx restart app2 consumer sends the request to app2 and updates successfully. 5. The test is unsuccessful as this leads to inconsistency on two applications. Ideally either it should not update app2 or should also update on app1 6. Observed: 1. app2 updated and app1 not updated 2. app1 got error message---internal server error 2. Client times out but request processes successfully 1. Request is sent to bus from app1 2. Smx is processing the requests very slowly or for some reason it is hanged. 3. This sends error message to app1 because of time out and hence rolled back at app1 4. After some time smx processes the request. 5. The request is sent to app2 and updates successfully. 6. The request should not be sent to other applications as it would lead to data inconsistency on applications. 7. Observed: 1. app1 got error 2. app2 updated successfully Also in case of synchronous opeartions I have a flow like this Application1--->http consumer--->Bean component--->Camel--->Camel Validator--->http Provider (Through camel)--->Application2 The response message sent from application2 is sent back to application1 But there are few scenarios where this leads to inconsistency on both applications Here are some of them. 1. Servicemix crashes during the response message flow 1. Request is sent from app1 2. Smx sends a request to app2. 3. App2 has updated itself. 4. App2 sends response back 5. smx is in process to send response back 6. Smx crashes 7. App1 would be rolled back 8. App2 should also be rolled back. 9. Restart smx. No message should be processed for the previous flow. 10. Message would be lost without any harm 11. Observed: 1. app1 rolled back, app2 updated 2. Client times out but request processes successfully 1. Request is sent to bus from app1 2. Smx is processing the requests very slowly. 3. This sends error message to aapp1 because of time out and hence rolled back at app1 4. After some time smx processes the request. Sends message to app2 and updates successfully. 5. The test is unsuccessful as this leads to inconsistency on two applications. Ideally either it should not update app2 or should also update on app1 6. Observed: 1. Failed 2. Password changed on app1. Not on app2 And there are few other cases. How can I achieve transactions in this case? My two applications are using different platforms. One uses ofbiz framework and another one uses JOOMLA(Content Management). How can I make sure that source application should be updated only if Please Reply -----Pratibha -- View this message in context: http://www.nabble.com/How-can-I-achieve-transactions-while-communicating-to-different-applications--tp20067480p20067480.html Sent from the ServiceMix - User mailing list archive at Nabble.com.