Exception handling between actions and ftp-listener
phillip.schulte Sep 29, 2010 8:02 AMHello.
Thats one service in my jboss-esb.xml
<service category="de.eskalon.kn.garuda.invoice.HistoricalExchangeRates" name="HistoricalExchangeRateImporter" description="Imports historical exchange rates from ftp directory files" invmScope="GLOBAL"> <service category="de.eskalon.kn.garuda.invoice.HistoricalExchangeRates" name="HistoricalExchangeRateImporter" description="Imports historical exchange rates from ftp directory files" invmScope="GLOBAL"> <listeners> <ftp-listener busidref="currency-ftp-in" is-gateway="true" maxThreads="2" name="ftp-listener-gateway" scheduleidref="everyminute" /> </listeners> <actions mep="OneWay"> <action name="transform" class="org.jboss.soa.esb.actions.converters.ByteArrayToString"> <property name="encoding" value="UTF-8" /> </action> <action name="properties" class="de.eskalon.kn.garuda.esb.GetPropertiesFromMessage"> </action> <action class="org.jboss.soa.esb.actions.EJBProcessor" name="callPersist"> <property name="ejb3" value="true" /> <property name="jndi-name" value="garuda-invoicing/HistoricalExchangeRatesManagerBean/remote" /> <property name="initial-context-factory" value="org.jnp.interfaces.NamingContextFactory" /> <property name="provider-url" value="localhost:1099" /> <property name="method" value="persistRate" /> <property name="ejb-params"> <arg0 type="java.lang.String">FILE_NAME</arg0> <arg1 type="java.lang.String">org.jboss.soa.esb.message.defaultEntry</arg1> </property> </action> </actions> </service> <listeners>
And here my ftp-provider
<ftp-provider hostname="${currency.ftp.host}" name="currency-provider">
<ftp-bus busid="currency-ftp-in">
<ftp-message-filter directory="${currency.ftp.directory}" error-delete="false" error-suffix=".HAS_ERROR"
input-suffix=".csv"
passive="true" password="${currency.ftp.password}" post-delete="false" post-rename="true"
post-suffix=".COMPLETE" username="${currency.ftp.username}" work-suffix=".garudaWorking" />
</ftp-bus>
</ftp-provider>
So its possible tthat something goes wrong in my persistRate method. But in any case the ftp-listener will rename the file to <filename>.COMPLETE independently of throwing an exception in my method. So my question is how do I handle this correctly. What I want to have is, if anything goes wrong rename the file to <filename>.HAS_ERROR
Best regards
Phillip