How can I trap an exception from Notifier action?
Issue
- My requirement is to read a file in a folder and send it to a FTP server. It also has to correctly notify of status; both success and failure. Below is how I configure my service:
<service category="MyServices" name="NotifyFtpService" description="...">
...
<actions mep="OneWay">
<!-- Exceptions thrown after this point will bubble up and be trapped by this. -->
<action name="handle-exception" class="com.esb.sample.actions.ExceptionHandlingAction" />
...
<action name="notify-ftp" class="org.jboss.soa.esb.actions.Notifier">
<property name="okMethod" value="notifyOK" />
<property name="destinations">
<NotificationList type="ok">
<target class="NotifyFTP">
<ftp URL="ftp://${ftp.user}:${ftp.password}@${ftp.host}/" filename="${filename}" />
</target>
</NotificationList>
</property>
</action>
...
</actions>
</service>
- I expect that any failures in
NotifyFTP
bubble up to the exception handling action (ExceptionHandlingAction) which will then trap the failures, but this is not the case; It continues to process the pipeline and finishes it successfully. - How should I handle this instead?
Environment
- JBoss Enterprise Service Oriented Architecture Platform (SOA-P)
- 4.x
- 5.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.