6 Replies Latest reply on Jan 30, 2009 2:58 AM by Claus Ibsen

    Sql component is reseting my Headers

    Jorge Klemm Newbie

      Hi,

       

      When I use the code below:

       

      .process(new EmptySQLParams()) // Set an empty list to body

      .setHeader("header_var", constant("string test!"))

       

      .process(

        new Processor() {

          public void process(Exchange exchange) throws Exception {

            // Here print "string test!"

            System.out.println( "header_var: " + exchange.getIn().getHeader("header_var", String.class) );

          }

        }

      )

       

      .to( "sql: select * from customer")

       

      .process(

        new Processor() {

          public void process(Exchange exchange) throws Exception {

            // Here print "null" .... not "string test!"

            System.out.println( "header_var: " + exchange.getIn().getHeader("header_var", String.class) );

          }

        }

      )

       

      Is this behavior by design or is it a bug ?

       

      So, Is there another way to store my variables besides using headers to do it ?

       

      Thanks,