[jboss-dev-forums] [Design of JBoss ESB] - How to use FaultTo
jaroslaw.kijanowski
do-not-reply at jboss.com
Fri Aug 24 10:59:24 EDT 2007
Hi,
I've modified the exceptions_faults QS to verify the FaultTo element of a message works. I've added following lines of code to the causesException method in [1] , just before the ActionProcessingException is thrown.
[1] product/samples/quickstarts/exceptions_faults/src/org/jboss/soa/esb/samples/quickstart/exceptions/MyBasicAction.java
| PortReference pr = new PortReference();
| pr.setAddress("jms://localhost/queue/quickstart_FAULT_TO_Alert/");
| pr.addExtension("jbossesb:java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
| pr.addExtension("jbossesb:java.naming.provider.url", "localhost");
| pr.addExtension("jbossesb:specification-version", "1.1");
| pr.addExtension("jbossesb:connection-factory", "ConnectionFactory");
| pr.addExtension("jbossesb:message-selector", "serviceName='ExceptionCaughtService'");
| EPR epr = new EPR();
| epr.setAddr(pr);
| message.getHeader().getCall().setFaultTo(epr);
|
| throw new ActionProcessingException("BAD STUFF HAPPENED");
| }
|
I expected that an autgenerated (by the ESB) message was sent to the quickstart_FAULT_TO_Alert queue.
What I get is following warning in the ESB console:
16:39:36,343 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
16:39:36,343 INFO [STDOUT] JustAnotherAction exceptionHandler:
Via Gateway |BASIC_ACTION| |JUST_ANOTHER_ACTION| |EXCEPTION_HANDLING|
16:39:36,343 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
16:39:36,344 WARN [ActionProcessingPipeline] No fault address defined for fault message!
How do I define the fault address for the fault message if not via message.getHeader().getCall().setFaultTo(myEPR) ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077831#4077831
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077831
More information about the jboss-dev-forums
mailing list