[jira] Created: (SMX4-417) calling <setHeader> with <groovy> expression can delete message and headers

View: New views
6 Messages — Rating Filter:   Alert me  

[jira] Created: (SMX4-417) calling <setHeader> with <groovy> expression can delete message and headers

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

calling <setHeader> with <groovy> expression can delete message and headers
---------------------------------------------------------------------------

                 Key: SMX4-417
                 URL: https://issues.apache.org/activemq/browse/SMX4-417
             Project: ServiceMix 4
          Issue Type: Bug
    Affects Versions: 4.0.0
         Environment: OSX 10.6.1, Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
            Reporter: Paul Mietz Egli


I've got a route that takes an HTTP form post, does some transformations, and sends an email.  One of the transforms I'd like to do is to set a header value based on the result of a Groovy expression.  I found that setting a header with <groovy>...</groovy> clears out the entire exchange.  Setting a header using <constant>...</constant> works fine.

Here's a route that I'm using to diagnose this problem:

  <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
    <route>
      <from uri="jetty:http://0.0.0.0:8103/" />
      <to uri="log:from jetty?showAll=true" />
      <to uri="seda:transform" />
    </route>
    <route>
      <from uri="timer:mytimer?period=30000"/>
      <setHeader headerName="application">
        <constant>TEST</constant>
      </setHeader>
      <to uri="log:from timer?showAll=true" />
      <to uri="seda:transform"/>
    </route>
    <route>
      <from uri="seda:transform" />
      <setHeader headerName="fromGroovy">
        <groovy>"my header is ${in.headers.application}"</groovy>
      </setHeader>
      <to uri="log:after set header?showAll=true" />
    </route>
  </camelContext>

Messages that originate from the timer look fine:

12:31:49,332 | INFO  | mer?period=30000 | from timer                       | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-16, Properties:{org.apache.camel.timer.name=mytimer, org.apache.camel.timer.firedTime=Mon Nov 02 12:31:49 PST 2009, org.apache.camel.timer.period=30000}, Headers:{application=TEST, firedTime=Mon Nov 02 12:31:49 PST 2009}, BodyType:null, Body:null, Out: null]
12:31:49,335 | INFO  | ansform thread:3 | after set header                 | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-17, Properties:{org.apache.camel.timer.name=mytimer, org.apache.camel.timer.firedTime=Mon Nov 02 12:31:49 PST 2009, org.apache.camel.timer.period=30000}, Headers:{application=TEST, fromGroovy=my header is TEST, firedTime=Mon Nov 02 12:31:49 PST 2009}, BodyType:null, Body:null, Out: null]

Messages that originate in response to a request to http://localhost:8103/?application=TEST appear to be lost after the header is set with the <groovy> tag:

12:32:03,607 | INFO  | 34102763@qtp13-1 | from jetty                       | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-18, Properties:{}, Headers:{application=TEST, Host=localhost:8103, org.apache.camel.component.http.query=application=TEST, User-Agent=curl/7.19.0 (i386-apple-darwin9.7.0) libcurl/7.19.0 zlib/1.2.3, http.requestMethod=GET, Accept=*/*}, BodyType:org.apache.camel.converter.stream.StreamCacheConverter.InputStreamCache, Body:, Out: null]
12:32:03,611 | INFO  | ansform thread:3 | after set header                 | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-19, Properties:{}, Headers:{}, BodyType:null, Body:null, Out: null]

The message after the <setHeader><groovy> is completely blank.  I've tried building the route with the Java DSL but it does the same thing.  Anything added after the <setHeader><groovy>... element is added to the message, but all previous contents were lost.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SMX4-417) calling <setHeader> with <groovy> expression can delete message and headers

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/activemq/browse/SMX4-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Mietz Egli updated SMX4-417:
---------------------------------

    Attachment: SMX4-417.tar.gz

OSGi module that reproduces this issue.

> calling <setHeader> with <groovy> expression can delete message and headers
> ---------------------------------------------------------------------------
>
>                 Key: SMX4-417
>                 URL: https://issues.apache.org/activemq/browse/SMX4-417
>             Project: ServiceMix 4
>          Issue Type: Bug
>    Affects Versions: 4.0.0
>         Environment: OSX 10.6.1, Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
>            Reporter: Paul Mietz Egli
>         Attachments: SMX4-417.tar.gz
>
>
> I've got a route that takes an HTTP form post, does some transformations, and sends an email.  One of the transforms I'd like to do is to set a header value based on the result of a Groovy expression.  I found that setting a header with <groovy>...</groovy> clears out the entire exchange.  Setting a header using <constant>...</constant> works fine.
> Here's a route that I'm using to diagnose this problem:
>   <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>     <route>
>       <from uri="jetty:http://0.0.0.0:8103/" />
>       <to uri="log:from jetty?showAll=true" />
>       <to uri="seda:transform" />
>     </route>
>     <route>
>       <from uri="timer:mytimer?period=30000"/>
>       <setHeader headerName="application">
>         <constant>TEST</constant>
>       </setHeader>
>       <to uri="log:from timer?showAll=true" />
>       <to uri="seda:transform"/>
>     </route>
>     <route>
>       <from uri="seda:transform" />
>       <setHeader headerName="fromGroovy">
>         <groovy>"my header is ${in.headers.application}"</groovy>
>       </setHeader>
>       <to uri="log:after set header?showAll=true" />
>     </route>
>   </camelContext>
> Messages that originate from the timer look fine:
> 12:31:49,332 | INFO  | mer?period=30000 | from timer                       | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-16, Properties:{org.apache.camel.timer.name=mytimer, org.apache.camel.timer.firedTime=Mon Nov 02 12:31:49 PST 2009, org.apache.camel.timer.period=30000}, Headers:{application=TEST, firedTime=Mon Nov 02 12:31:49 PST 2009}, BodyType:null, Body:null, Out: null]
> 12:31:49,335 | INFO  | ansform thread:3 | after set header                 | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-17, Properties:{org.apache.camel.timer.name=mytimer, org.apache.camel.timer.firedTime=Mon Nov 02 12:31:49 PST 2009, org.apache.camel.timer.period=30000}, Headers:{application=TEST, fromGroovy=my header is TEST, firedTime=Mon Nov 02 12:31:49 PST 2009}, BodyType:null, Body:null, Out: null]
> Messages that originate in response to a request to http://localhost:8103/?application=TEST appear to be lost after the header is set with the <groovy> tag:
> 12:32:03,607 | INFO  | 34102763@qtp13-1 | from jetty                       | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-18, Properties:{}, Headers:{application=TEST, Host=localhost:8103, org.apache.camel.component.http.query=application=TEST, User-Agent=curl/7.19.0 (i386-apple-darwin9.7.0) libcurl/7.19.0 zlib/1.2.3, http.requestMethod=GET, Accept=*/*}, BodyType:org.apache.camel.converter.stream.StreamCacheConverter.InputStreamCache, Body:, Out: null]
> 12:32:03,611 | INFO  | ansform thread:3 | after set header                 | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-19, Properties:{}, Headers:{}, BodyType:null, Body:null, Out: null]
> The message after the <setHeader><groovy> is completely blank.  I've tried building the route with the Java DSL but it does the same thing.  Anything added after the <setHeader><groovy>... element is added to the message, but all previous contents were lost.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SMX4-417) calling <setHeader> with <groovy> expression can delete message and headers

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/activemq/browse/SMX4-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=55127#action_55127 ]

Paul Mietz Egli commented on SMX4-417:
--------------------------------------

Steps to reproduce:

1. Unpack apache-servicemix-4.0.0.tar.gz.
2. Start ServiceMix and run "features/install camel-jetty" and "features/install camel-groovy".
3. Build the attached project and copy the JAR file to $SERVICEMIX_HOME/deploy
4. Tail the servicemix.log file to see the timer-initiated messages going by.
5. Trigger a message from jetty using "curl http://localhost:8103/?application=TEST".

Observation: message headers are lost for jetty but retained for timer.

> calling <setHeader> with <groovy> expression can delete message and headers
> ---------------------------------------------------------------------------
>
>                 Key: SMX4-417
>                 URL: https://issues.apache.org/activemq/browse/SMX4-417
>             Project: ServiceMix 4
>          Issue Type: Bug
>    Affects Versions: 4.0.0
>         Environment: OSX 10.6.1, Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
>            Reporter: Paul Mietz Egli
>         Attachments: SMX4-417.tar.gz
>
>
> I've got a route that takes an HTTP form post, does some transformations, and sends an email.  One of the transforms I'd like to do is to set a header value based on the result of a Groovy expression.  I found that setting a header with <groovy>...</groovy> clears out the entire exchange.  Setting a header using <constant>...</constant> works fine.
> Here's a route that I'm using to diagnose this problem:
>   <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>     <route>
>       <from uri="jetty:http://0.0.0.0:8103/" />
>       <to uri="log:from jetty?showAll=true" />
>       <to uri="seda:transform" />
>     </route>
>     <route>
>       <from uri="timer:mytimer?period=30000"/>
>       <setHeader headerName="application">
>         <constant>TEST</constant>
>       </setHeader>
>       <to uri="log:from timer?showAll=true" />
>       <to uri="seda:transform"/>
>     </route>
>     <route>
>       <from uri="seda:transform" />
>       <setHeader headerName="fromGroovy">
>         <groovy>"my header is ${in.headers.application}"</groovy>
>       </setHeader>
>       <to uri="log:after set header?showAll=true" />
>     </route>
>   </camelContext>
> Messages that originate from the timer look fine:
> 12:31:49,332 | INFO  | mer?period=30000 | from timer                       | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-16, Properties:{org.apache.camel.timer.name=mytimer, org.apache.camel.timer.firedTime=Mon Nov 02 12:31:49 PST 2009, org.apache.camel.timer.period=30000}, Headers:{application=TEST, firedTime=Mon Nov 02 12:31:49 PST 2009}, BodyType:null, Body:null, Out: null]
> 12:31:49,335 | INFO  | ansform thread:3 | after set header                 | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-17, Properties:{org.apache.camel.timer.name=mytimer, org.apache.camel.timer.firedTime=Mon Nov 02 12:31:49 PST 2009, org.apache.camel.timer.period=30000}, Headers:{application=TEST, fromGroovy=my header is TEST, firedTime=Mon Nov 02 12:31:49 PST 2009}, BodyType:null, Body:null, Out: null]
> Messages that originate in response to a request to http://localhost:8103/?application=TEST appear to be lost after the header is set with the <groovy> tag:
> 12:32:03,607 | INFO  | 34102763@qtp13-1 | from jetty                       | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-18, Properties:{}, Headers:{application=TEST, Host=localhost:8103, org.apache.camel.component.http.query=application=TEST, User-Agent=curl/7.19.0 (i386-apple-darwin9.7.0) libcurl/7.19.0 zlib/1.2.3, http.requestMethod=GET, Accept=*/*}, BodyType:org.apache.camel.converter.stream.StreamCacheConverter.InputStreamCache, Body:, Out: null]
> 12:32:03,611 | INFO  | ansform thread:3 | after set header                 | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-19, Properties:{}, Headers:{}, BodyType:null, Body:null, Out: null]
> The message after the <setHeader><groovy> is completely blank.  I've tried building the route with the Java DSL but it does the same thing.  Anything added after the <setHeader><groovy>... element is added to the message, but all previous contents were lost.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SMX4-417) calling <setHeader> with <groovy> expression can delete message and headers

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/activemq/browse/SMX4-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=55129#action_55129 ]

Paul Mietz Egli commented on SMX4-417:
--------------------------------------

workaround is to create a processor bean using Groovy instead:

    <route>
      <from uri="seda:transform" />
      <process ref="setToHeaderProcessor"/>
      <to uri="log:after set header?showAll=true" />
    </route>

  <lang:groovy id="setToHeaderProcessor">
    <lang:inline-script>
      <![CDATA[
      import org.apache.camel.*
      class SetToHeaderProcessor implements Processor {
        void process(Exchange exchange) {
          exchange.in.setHeader('application', "my header is ${exchange.in.headers.application}")
        }
      }
      ]]>
    </lang:inline-script>
  </lang:groovy>

(requires org.apache.camel.camel-core in the Required-Bundles section of the manifest)

> calling <setHeader> with <groovy> expression can delete message and headers
> ---------------------------------------------------------------------------
>
>                 Key: SMX4-417
>                 URL: https://issues.apache.org/activemq/browse/SMX4-417
>             Project: ServiceMix 4
>          Issue Type: Bug
>    Affects Versions: 4.0.0
>         Environment: OSX 10.6.1, Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
>            Reporter: Paul Mietz Egli
>         Attachments: SMX4-417.tar.gz
>
>
> I've got a route that takes an HTTP form post, does some transformations, and sends an email.  One of the transforms I'd like to do is to set a header value based on the result of a Groovy expression.  I found that setting a header with <groovy>...</groovy> clears out the entire exchange.  Setting a header using <constant>...</constant> works fine.
> Here's a route that I'm using to diagnose this problem:
>   <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>     <route>
>       <from uri="jetty:http://0.0.0.0:8103/" />
>       <to uri="log:from jetty?showAll=true" />
>       <to uri="seda:transform" />
>     </route>
>     <route>
>       <from uri="timer:mytimer?period=30000"/>
>       <setHeader headerName="application">
>         <constant>TEST</constant>
>       </setHeader>
>       <to uri="log:from timer?showAll=true" />
>       <to uri="seda:transform"/>
>     </route>
>     <route>
>       <from uri="seda:transform" />
>       <setHeader headerName="fromGroovy">
>         <groovy>"my header is ${in.headers.application}"</groovy>
>       </setHeader>
>       <to uri="log:after set header?showAll=true" />
>     </route>
>   </camelContext>
> Messages that originate from the timer look fine:
> 12:31:49,332 | INFO  | mer?period=30000 | from timer                       | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-16, Properties:{org.apache.camel.timer.name=mytimer, org.apache.camel.timer.firedTime=Mon Nov 02 12:31:49 PST 2009, org.apache.camel.timer.period=30000}, Headers:{application=TEST, firedTime=Mon Nov 02 12:31:49 PST 2009}, BodyType:null, Body:null, Out: null]
> 12:31:49,335 | INFO  | ansform thread:3 | after set header                 | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-17, Properties:{org.apache.camel.timer.name=mytimer, org.apache.camel.timer.firedTime=Mon Nov 02 12:31:49 PST 2009, org.apache.camel.timer.period=30000}, Headers:{application=TEST, fromGroovy=my header is TEST, firedTime=Mon Nov 02 12:31:49 PST 2009}, BodyType:null, Body:null, Out: null]
> Messages that originate in response to a request to http://localhost:8103/?application=TEST appear to be lost after the header is set with the <groovy> tag:
> 12:32:03,607 | INFO  | 34102763@qtp13-1 | from jetty                       | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-18, Properties:{}, Headers:{application=TEST, Host=localhost:8103, org.apache.camel.component.http.query=application=TEST, User-Agent=curl/7.19.0 (i386-apple-darwin9.7.0) libcurl/7.19.0 zlib/1.2.3, http.requestMethod=GET, Accept=*/*}, BodyType:org.apache.camel.converter.stream.StreamCacheConverter.InputStreamCache, Body:, Out: null]
> 12:32:03,611 | INFO  | ansform thread:3 | after set header                 | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-19, Properties:{}, Headers:{}, BodyType:null, Body:null, Out: null]
> The message after the <setHeader><groovy> is completely blank.  I've tried building the route with the Java DSL but it does the same thing.  Anything added after the <setHeader><groovy>... element is added to the message, but all previous contents were lost.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SMX4-417) calling <setHeader> with <groovy> expression can delete message and headers

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/activemq/browse/SMX4-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56094#action_56094 ]

Peter Lundberg commented on SMX4-417:
-------------------------------------

I found a similar issue using just camel 2.0.0. The below snippet shows relevant parts of the route and the after logging is completely empty of body and header

.to("log:before?showAll=true")
.setHeader("test.foo").groovy("'$request.one.two $request.three'")
.to("log:after?showAll=true")

> calling <setHeader> with <groovy> expression can delete message and headers
> ---------------------------------------------------------------------------
>
>                 Key: SMX4-417
>                 URL: https://issues.apache.org/activemq/browse/SMX4-417
>             Project: ServiceMix 4
>          Issue Type: Bug
>    Affects Versions: 4.0.0
>         Environment: OSX 10.6.1, Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
>            Reporter: Paul Mietz Egli
>         Attachments: SMX4-417.tar.gz
>
>
> I've got a route that takes an HTTP form post, does some transformations, and sends an email.  One of the transforms I'd like to do is to set a header value based on the result of a Groovy expression.  I found that setting a header with <groovy>...</groovy> clears out the entire exchange.  Setting a header using <constant>...</constant> works fine.
> Here's a route that I'm using to diagnose this problem:
>   <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>     <route>
>       <from uri="jetty:http://0.0.0.0:8103/" />
>       <to uri="log:from jetty?showAll=true" />
>       <to uri="seda:transform" />
>     </route>
>     <route>
>       <from uri="timer:mytimer?period=30000"/>
>       <setHeader headerName="application">
>         <constant>TEST</constant>
>       </setHeader>
>       <to uri="log:from timer?showAll=true" />
>       <to uri="seda:transform"/>
>     </route>
>     <route>
>       <from uri="seda:transform" />
>       <setHeader headerName="fromGroovy">
>         <groovy>"my header is ${in.headers.application}"</groovy>
>       </setHeader>
>       <to uri="log:after set header?showAll=true" />
>     </route>
>   </camelContext>
> Messages that originate from the timer look fine:
> 12:31:49,332 | INFO  | mer?period=30000 | from timer                       | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-16, Properties:{org.apache.camel.timer.name=mytimer, org.apache.camel.timer.firedTime=Mon Nov 02 12:31:49 PST 2009, org.apache.camel.timer.period=30000}, Headers:{application=TEST, firedTime=Mon Nov 02 12:31:49 PST 2009}, BodyType:null, Body:null, Out: null]
> 12:31:49,335 | INFO  | ansform thread:3 | after set header                 | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-17, Properties:{org.apache.camel.timer.name=mytimer, org.apache.camel.timer.firedTime=Mon Nov 02 12:31:49 PST 2009, org.apache.camel.timer.period=30000}, Headers:{application=TEST, fromGroovy=my header is TEST, firedTime=Mon Nov 02 12:31:49 PST 2009}, BodyType:null, Body:null, Out: null]
> Messages that originate in response to a request to http://localhost:8103/?application=TEST appear to be lost after the header is set with the <groovy> tag:
> 12:32:03,607 | INFO  | 34102763@qtp13-1 | from jetty                       | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-18, Properties:{}, Headers:{application=TEST, Host=localhost:8103, org.apache.camel.component.http.query=application=TEST, User-Agent=curl/7.19.0 (i386-apple-darwin9.7.0) libcurl/7.19.0 zlib/1.2.3, http.requestMethod=GET, Accept=*/*}, BodyType:org.apache.camel.converter.stream.StreamCacheConverter.InputStreamCache, Body:, Out: null]
> 12:32:03,611 | INFO  | ansform thread:3 | after set header                 | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-19, Properties:{}, Headers:{}, BodyType:null, Body:null, Out: null]
> The message after the <setHeader><groovy> is completely blank.  I've tried building the route with the Java DSL but it does the same thing.  Anything added after the <setHeader><groovy>... element is added to the message, but all previous contents were lost.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SMX4-417) calling <setHeader> with <groovy> expression can delete message and headers

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/activemq/browse/SMX4-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56133#action_56133 ]

Claus Ibsen commented on SMX4-417:
----------------------------------

Just added an unit test to camel where I cannot reproduce the issue.

Its based on 2.1 though
http://svn.apache.org/viewvc?rev=884641&view=rev

> calling <setHeader> with <groovy> expression can delete message and headers
> ---------------------------------------------------------------------------
>
>                 Key: SMX4-417
>                 URL: https://issues.apache.org/activemq/browse/SMX4-417
>             Project: ServiceMix 4
>          Issue Type: Bug
>    Affects Versions: 4.0.0
>         Environment: OSX 10.6.1, Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
>            Reporter: Paul Mietz Egli
>         Attachments: SMX4-417.tar.gz
>
>
> I've got a route that takes an HTTP form post, does some transformations, and sends an email.  One of the transforms I'd like to do is to set a header value based on the result of a Groovy expression.  I found that setting a header with <groovy>...</groovy> clears out the entire exchange.  Setting a header using <constant>...</constant> works fine.
> Here's a route that I'm using to diagnose this problem:
>   <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>     <route>
>       <from uri="jetty:http://0.0.0.0:8103/" />
>       <to uri="log:from jetty?showAll=true" />
>       <to uri="seda:transform" />
>     </route>
>     <route>
>       <from uri="timer:mytimer?period=30000"/>
>       <setHeader headerName="application">
>         <constant>TEST</constant>
>       </setHeader>
>       <to uri="log:from timer?showAll=true" />
>       <to uri="seda:transform"/>
>     </route>
>     <route>
>       <from uri="seda:transform" />
>       <setHeader headerName="fromGroovy">
>         <groovy>"my header is ${in.headers.application}"</groovy>
>       </setHeader>
>       <to uri="log:after set header?showAll=true" />
>     </route>
>   </camelContext>
> Messages that originate from the timer look fine:
> 12:31:49,332 | INFO  | mer?period=30000 | from timer                       | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-16, Properties:{org.apache.camel.timer.name=mytimer, org.apache.camel.timer.firedTime=Mon Nov 02 12:31:49 PST 2009, org.apache.camel.timer.period=30000}, Headers:{application=TEST, firedTime=Mon Nov 02 12:31:49 PST 2009}, BodyType:null, Body:null, Out: null]
> 12:31:49,335 | INFO  | ansform thread:3 | after set header                 | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-17, Properties:{org.apache.camel.timer.name=mytimer, org.apache.camel.timer.firedTime=Mon Nov 02 12:31:49 PST 2009, org.apache.camel.timer.period=30000}, Headers:{application=TEST, fromGroovy=my header is TEST, firedTime=Mon Nov 02 12:31:49 PST 2009}, BodyType:null, Body:null, Out: null]
> Messages that originate in response to a request to http://localhost:8103/?application=TEST appear to be lost after the header is set with the <groovy> tag:
> 12:32:03,607 | INFO  | 34102763@qtp13-1 | from jetty                       | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-18, Properties:{}, Headers:{application=TEST, Host=localhost:8103, org.apache.camel.component.http.query=application=TEST, User-Agent=curl/7.19.0 (i386-apple-darwin9.7.0) libcurl/7.19.0 zlib/1.2.3, http.requestMethod=GET, Accept=*/*}, BodyType:org.apache.camel.converter.stream.StreamCacheConverter.InputStreamCache, Body:, Out: null]
> 12:32:03,611 | INFO  | ansform thread:3 | after set header                 | rg.apache.camel.processor.Logger   88 | Exchange[Id:ID-iago.local/53297-1257192385112/0-19, Properties:{}, Headers:{}, BodyType:null, Body:null, Out: null]
> The message after the <setHeader><groovy> is completely blank.  I've tried building the route with the Java DSL but it does the same thing.  Anything added after the <setHeader><groovy>... element is added to the message, but all previous contents were lost.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.