-
1. Re: FaultTo EPR
kconner Mar 10, 2008 3:10 PM (in response to itarc)The caller has to specify the FaultTo EPR before sending the message. The best way is to define a fault service and use the LogicalEPR in the FaultTo, for example
message.getHeader().getCall().setFaultTo(new LogicalEPR("service-category", "service-name"));
-
2. Re: FaultTo EPR
itarc Mar 12, 2008 12:06 PM (in response to itarc)Hello,
I have succeeded in putting a faultToEPR with the code above.
It works, but when a fault comes :
-I stilll have an error message in the (it may be normal)
-The message does not go to the EPR.
Here's a part of the server log.16:43:53,811 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline: header: [ To: JMSEpr [ PortReference < <wsa:Address jms://localhost/queue/gesco_esb/>, <wsa:ReferenceProperties jbossesb:destination-type :queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : 1/> > ] FaultTo: EPR: PortReference < <wsa:Addresslogical:BAMServices#ErrorService/> > MessageID: ID:JBM-103936 RelatesTo: jms:correlationID#d4dcbbce-7cbb-4edf-96ec-17e0d39607aa ] org.jboss.soa.esb.actions.ActionProcessingException: Unexpected invocation target exception from processor at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.process Methods(ActionProcessorMethodInfo.java:127)
I guess I forgot something.
I don't do anything special in the description of my actions in the jboss-esb.xml.
Maybe I have to but I don't see what.
Maybe the "ActionProcessingException" is not handled by the FaultTo. If It is the case what can I do ? -
3. Re: FaultTo EPR
kconner Mar 12, 2008 12:54 PM (in response to itarc)I would need to see what you are doing to help further. Is this something that you can send to me? If not, could you create a small example of what you are trying to do?
-
4. Re: FaultTo EPR
itarc Mar 13, 2008 6:47 AM (in response to itarc)Ok kevin I sent you an example of what I want to do.
Hope it will be clear to you. -
5. Re: FaultTo EPR
kconner Mar 13, 2008 10:45 AM (in response to itarc)Got it, thanks. I'll have a look at it as soon as I can.
-
6. Re: FaultTo EPR
itarc Mar 25, 2008 11:31 AM (in response to itarc)Hello,
I did a little search by myself.
I first found the "exceptions_faults" sample which put me on the right way.
My mistake was that I did the faulToEpr affectation inside the action chain, it works better when I do it outside.
I have a question here, if my service has no caller (ex : a database polling service ) how can I do ?
The issue now is that the message that is sent to the FaultToEPR
does not contain the original message body any more,
it contains system error message :body: [ objects: {org.jboss.soa.esb.message.fault.throwable=org.jboss.soa.esb.ac tions.ActionProcessingException: Unexpected invocation target exception from pro cessor, org.jboss.soa.esb.message.fault.reason=org.jboss.soa.esb.actions.ActionP rocessingException: Unexpected invocation target exception from processor, org.j boss.soa.esb.message.fault.code=urn:action/error/unexpectederror} ] fault: [ urn:action/error/unexpectederror, org.jboss.soa.esb.actions.ActionProce ssingException: Unexpected invocation target exception from processor, org.jboss .soa.esb.actions.ActionProcessingException: Unexpected invocation target excepti on from processor ]
Actually I would like to notify by e-mail the system errors + the body of the faulty message.
How can I get on to have both sent to the FaultToEPR?
Best regards -
7. Re: FaultTo EPR
marklittle Mar 26, 2008 5:56 PM (in response to itarc)You can control what is sent in the body of the fault message. Check the Programmers Guide for more details.
-
8. Re: FaultTo EPR
matt.wojtowicz Sep 1, 2010 12:09 PM (in response to itarc)The faulTo will take the Exception and place it into the Fault of a new message. By doing this all data in the message is lost.
To perserve the Data, when an exception is thrown
- Catch the exception
- Wrap the message that caused the exception in a Throwable
- Throw that exception
- On the Error Handling Service(EPR), message .getCause().getcause() will retieve the message.
-
9. Re: FaultTo EPR
mikefinn Sep 1, 2010 2:18 PM (in response to matt.wojtowicz)Mark - can you provide any more specifics ? I can't find anything in there about controlling the transfer of payload to the 'fault' message. Nor in the source.
The only way I could figure out how to solve this, without relying on custom handling of exception in actions (which doesn't help when using out-of-box actions), was to patch the org.jboss.soa.esb.listeners.message.errors.Factory class to copy the payload from the input message to the outgoing error message.
Can you think of a reason why this is bad idea?
Thanks,
Mike