So, I converted this over to Java and it is exhibiting the same behavior. 
What did I do wrong:

public class JavaSplitPerfProcessor {
        static class LineSplitter implements Processor {
                static final String format = "INSERT INTO EVT_PERF ( 
EVT_PERF_ID,
CRLTN_ID, USER_ID, APPN_SYS_CD, HOST_NM, WEBLOGIC_INSTNC_NM,
WEB_ANLYTCS_CRLTN_ID, LOGGER_CLASS_NM, EXEC_TIME ) values (
EVT_PERF_ID_SEQ.NEXTVAL, ''{0}'', ''{1}'', ''{2}'', ''{3}'', ''{4}'',
''{5}'', ''{6}'', {7} )";

                @Override
                public void process(Exchange exchange) throws Exception {
                        // Get the incoming line from the message exchange
                        String line = exchange.getIn().getBody(String.class);
                        // Remove the first part of the log message
                        String[] lineSplit = line.split("\\[\\]\\: ");
                        // Break it down into the individual components
                        String[] split = lineSplit[1].split(" ");
                        // Build the insert statement
                        String x = MessageFormat
                                        .format(format, split[0], split[1], 
split[2], split[3],
                                                        split[4], split[5], 
split[7], split[10]);
                        // Replace the incoming message with the insert 
statement
                        exchange.getIn().setBody(x);
                }
        }

        public static void main(String[] args) throws Exception {
                // Build the connection pool
                BasicDataSource ds = new BasicDataSource();
                ds.setDriverClassName("oracle.jdbc.OracleDriver");
                ds.setUrl("jdbc:oracle:thin:@localhost:1521:xe");
                ds.setUsername("****");
                ds.setPassword("****");
                // Register it with Camel
                SimpleRegistry reg = new SimpleRegistry();
                reg.put("dataSource", ds);

                final LineSplitter lineSplitter = new LineSplitter();

                CamelContext context = new DefaultCamelContext(reg);
                context.addRoutes(new RouteBuilder() {
                        public void configure() {
                                
from("file:perf?delete=true").split(body().tokenize("\n"))
                                                
.streaming().process(lineSplitter)
                                                
.to("jdbc:dataSource?resetAutoCommit=false").end();
                        }
                });

                context.start();
                Thread.sleep(60000);
                context.stop();
        }
}

--
View this message in context: 
http://camel.465427.n5.nabble.com/File-Processor-Not-deleting-the-files-tp5670301p5675961.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to