-
1. Re: ServiceInvoker deliverSync() losing faultTo EPR
dbuttery Dec 21, 2011 9:05 AM (in response to dbuttery)A little more info ...
In the service that handles the request I am creating a response message. On that response I am copying the faultTo from the request message. I am also using the message context and properties. I see all of this information is intact right before the response message is returned to the caller.
In the caller, when the response is received, all of the additional information (context/properties/faultTo) is missing and I only have the message body that I had placed on the response.
I would have expected that the response message would have been delivered in its entirety as I had composed it.
Is there any known workaround to prevent that from happening?
Regards,
-Dennis
-
2. Re: ServiceInvoker deliverSync() losing faultTo EPR
tcunning Dec 21, 2011 10:42 AM (in response to dbuttery)If you want to set your own custom FaultTo/replyTo, you are going to have to use deliverAsync. deliverSync is designed to deliver the message back (you've deliberately asked for a synchronous reply), fault or not. This is an issue which has received quite a bit of discussion and there's a JIRA filed on changing the default behavior (https://issues.jboss.org/browse/JBESB-3676), but currently this is expected behavior.
There's quite a few ways you can work around this - change your code to use deliverAsync, or you can use deliverSync in ServiceA and then catch the exception and then deliver the fault where you want in the catch, or you can configure an exceptionMethod in ServiceB which sends a fault Message to ServiceZ, or you can use a middleman service which takes care of the fault logic.
-
3. Re: ServiceInvoker deliverSync() losing faultTo EPR
dbuttery Dec 22, 2011 10:46 AM (in response to tcunning)Thanks Tom.
I am going with the idea of catching the exception and delivering the fault to a specified service.
Seems to work pretty efficiently that way ...