I'm trying to implement a fire-and-forget flow to log messages on a database by calling an Oracle procedure, everything works fine but I'd like to log any exception I get when, by any chance, I misconfigured the xml or whatever else could go wrong (any exception thrown by the procedure?). I've searched for quite some time but I'm probably missing out something...
Here's the actual setting: I've got a gateway interface
public interface gatewayInterfaceDEF{
void monitoring(Object payload);
}
XML definition of the gateway
<int:gateway service-interface="gatewayInterfaceDEF">
<int:method name="monitoring" request-channel="monitoringGatewayInbound" />
</int:gateway>
Then the JDBC-outbound-gateway xml configuration that calls an oracle procedure:
<int:channel id="monitoringGatewayInbound">
<int:dispatcher task-executor="monitoringTaskExecutor"/>
</int:channel>
<int-jdbc:stored-proc-outbound-gateway
id="monitoringGatewayProcedure" request-channel="monitoringGatewayInbound"
data-source="dataSource" stored-procedure-name="procedureName"
return-value-required="false" ignore-column-meta-data="true">
<int-jdbc:sql-parameter-definition
someparameters />
<int-jdbc:parameter parameter mapping />
</int-jdbc:stored-proc-outbound-gateway>
Thanks in advance
I've found this: http://java.dzone.com/articles/spring-async-and-exception But it's not working: could it be me not being able to implement it, but still.
UPDATE: the wrapped log I get.
|TEST|2014-10-17 17:09:08,999|||059EF53A6C4D2F67E0540003BA7A7C43|[monitoringTaskExecutor-1]|INFO |STDOUT|17:09:08,999 ERROR [LoggingHandler] org.springframework.integration.MessageHandlingException: error occurred in message handler [org.springframework.integration.jdbc.StoredProcOutboundGateway#0]
UPDATE2: the jboss-log4j.xml I'm using
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
<log4j:configuration debug="true" xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="STDFILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
<param name="append" value="true" />
<param name="file" value="/var/share/test/logs/test-ws_out.log" />
<param name="datePattern" value="yyyy-MM-dd" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="TEST|%d|%X{req.remoteHost}|%X{sessionid}|%X{lcontext}|[%t]|%-5p|%c|%m%n|" />
</layout>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="STDFILE" />
</root>
</log4j:configuration>