You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Paul Mietz Egli (JIRA)" <ji...@apache.org> on 2009/11/02 21:51:52 UTC

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

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] Issue Comment Edited: (SMX4-417) calling with expression can delete message and headers

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SMX4-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60218#action_60218 ] 

Claus Ibsen edited comment on SMX4-417 at 6/23/10 4:13 AM:
-----------------------------------------------------------

You should use {{setOutHeader}} as a work around.

setHeader only sets the IN header, but the groovy script will populate a response as well, and hence the Exchange has both IN and OUT, but the out will be empty. Will look into it to make this work out of the box.

      was (Author: davsclaus):
    You should use {{setOutHeader}}. 
  
> 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 with expression can delete message and headers

Posted by "Paul Mietz Egli (JIRA)" <ji...@apache.org>.
    [ 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 with expression can delete message and headers

Posted by "Peter Lundberg (JIRA)" <ji...@apache.org>.
    [ 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] Updated: (SMX4-417) calling with expression can delete message and headers

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SMX4-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated SMX4-417:
-----------------------------

    Fix Version/s: 4.4.0

> 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
>            Assignee: Claus Ibsen
>             Fix For: 4.4.0
>
>         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 with expression can delete message and headers

Posted by "andrej koelewijn (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SMX4-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60099#action_60099 ] 

andrej koelewijn commented on SMX4-417:
---------------------------------------

This is still an issue in 2.3.0-fuse-01-00:

The following route: 

 from("jetty:http://localhost:8008/svc1?matchOnUriPrefix=true")
                        .to("log:svc1.0?showAll=true")
                        .setHeader("bsn",groovy("'abc123'"))
                        .to("log:svc1.1?showAll=true")

The second log has no headers or message. If you replace groovy by constant message and headers have values.

> 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] Resolved: (SMX4-417) calling with expression can delete message and headers

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SMX4-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved SMX4-417.
------------------------------

    Resolution: Fixed

Apache Camel 2.4.0 will be part of SMX 4.4.0

> 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
>            Assignee: Claus Ibsen
>             Fix For: 4.4.0
>
>         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 with expression can delete message and headers

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Assigned: (SMX4-417) calling with expression can delete message and headers

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SMX4-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned SMX4-417:
--------------------------------

    Assignee: Claus Ibsen

> 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
>            Assignee: Claus Ibsen
>         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 with expression can delete message and headers

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SMX4-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60225#action_60225 ] 

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

Okay its fixed now in Camel. And will be part of Apache Camel 2.4.0 release.

Btw the {{setOutHeader}} workaround doesn't work either. 

> 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
>            Assignee: Claus Ibsen
>             Fix For: 4.4.0
>
>         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] Updated: (SMX4-417) calling with expression can delete message and headers

Posted by "Paul Mietz Egli (JIRA)" <ji...@apache.org>.
     [ 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 with expression can delete message and headers

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SMX4-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60218#action_60218 ] 

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

You should use {{setOutHeader}}. 

> 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 with expression can delete message and headers

Posted by "Paul Mietz Egli (JIRA)" <ji...@apache.org>.
    [ 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.