The second parameter for deliverSync is a timeout value in milliseconds. What value are you passing?
See the javadoc for more info: http://www.jboss.org/jbossesb/docs/4.5.GA/javadoc/esb/org/jboss/soa/esb/client/ServiceInvoker.html
I am passing 5000L.
To my understanding, the second parameter is used for tiggering MessageDeliverException if no reply is received.
Yeah, thank you. I got my problem solved.
The problem is caused by timeout setting.
The esb service is designed as:
Service 1 ->(5s timeout) Service 2 ->(2s timeout) Service 3
When timeout occurs in Service 2, Service 1 will get a exception from Service 2. Then, Service 1 will retry the request automatically.
So, duplicate requests will send from Service 1 to Service 2.
After I change it to
Service 1 ->(5s timeout) Service 2 ->(5s timeout) Service 3,
no more duplicate request in ESB.
However, a new problem will be raised in this design.
Let's say Service 3 commits while Service 2 is failed eventually.
How can I rollback the whole operation?