Hi Adrian,
as far as I know it is not possible to continue a synchronous request
after a client restart. I use synchronous calls only for read requests.
In this case I set a timeout for the message so it gets discarded after
some time.
If you call a write operation it is perhaps best to do it completely
asynchronous by using a one way service for the call to the operation.
The reponse could then be sent to another one way service that listens
on a topic. The client can then "offer" this service to listen for the
response.
Perhaps it is also possible to change cxf in a way to support this
scenario. We had a similar case in the company I work for. We went with
the solution above but it is quite complicated. Perhaps we can support
the same level of security with some changes in CXF. Since some time CXF
supports asynchronous calls to a request / reply service. If it really
does not matter which instance of a client receives the response we
could turn of the correlation id checking. So the scenario would look
like this:
- Client send a request with an asynch frontend and gives a permanent
reply queue
- Client goes down
- Server replies on the reply queue. The reply message should have no
timeout in this case
- Client comes up again
- Client receives the reply on the reply queue. Since correlation
checking is turned off it processes the reply
- The reply handler of the asnyc frontend is called with the reply
What do you think?
Greetings
Christian
Adrian C schrieb:
Hi,
I have question about hows best to deal with a client application restarting
while waiting to receive a response.
Here's the scenario - a client application is invoking a synchronous web
services over JMS. If the client is restarted or crashed after a request has
been send to the broker how should the client pick up the message once the
client restarts?
Would is be possible to store the correlation id of the message once
dispatched & persist this. If the client restarts and there are outstanding
correlation ids then it must poll for these messages - however how would one
get CXF to process this message as the response to the original request?
I am sure this is an issue that others have faced or perhaps I am missing
something.
Thanks,
--
Christian Schneider
---
http://www.liquid-reality.de