Reply documents are not published but are delivered. You cannot subscribe to replies.
Increasing the waitTime in the publishAndWait call is the first approach I would investigate.
You’re right that increasing the waitTime has performance implications as more threads may exist at any one time waiting for replies. Measure this to see if it is a problem.
Unfortunately, there isn’t a way to guarantee 100% connectivity between Brokers. So you’ll want your code to be as resilient as possible in the face of transient errors.
One approach would be to retry X number of times and dynamically increase the waitTime for each successive retry. It has been my experience with HTTP interactions, that implementing a simple retry addresses the majority of transient failure issues. The same should hold true for Broker-based interactions. It is likely that a retry after a timeout will work right away.
A variation on this approach would be to wait for a short period of time between retries.
Request.
Wait for reply.
On timeout:
–Wait X seconds.
–Repeat request.
You could dynamically increase the wait between retries too. Most times, there is no point in retrying 5 times within 1 minute. Spread those 5 times out over a longer period and you’re more likely to see success. For example:
00: Request.
10: Timeout.
10: Wait 10.
20: Request
30: Timeout.
30: Wait 20.
50: Request.
60: Timeout.
60: Wait 40.
100: Request
110: Timeout.
etc.
And one more Observation which i am thinking might be the reaosn for timeouts.
Of course these approaches assume that the integration is allowed to take up to max time that all retries and timeouts may take. If the integration cannot take that long, then you have no real choice but to fail the integration.
Hope this helps.
#Integration-Server-and-ESB#webMethods#Flow-and-Java-services