Reputation: 2396
I have the following route:
<camel:camelContext id="convert">
<camel:route>
<camel:from uri="restlet:/convert/{id}"/>
<camel:transform>
<camel:groovy>
request.headers.id
</camel:groovy>
</camel:transform>
</camel:route>
</camel:camelContext>
This route should simply return the value passed in the URL as id parameter. When I execute this, the first call works. Anything after the first call returns the value passed in the first call. So, if first call is hostname/convert/999, any other call will return 999 no matter what id is passed in the URL. It looks like groovy is doing some stateful thing that I don't understand.
Any thoughts?
The same thing seems to happen with JavaScript.
<camel:camelContext id="convert">
<camel:route>
<camel:from uri="restlet:/convert/{id}"/>
<camel:transform>
<camel:javaScript>request.headers.get('id')</camel:javaScript>
</camel:transform>
</camel:route>
</camel:camelContext>
Upvotes: 0
Views: 1054
Reputation: 55555
Okay so the groovy issue is a regression bug in Camel. I have logged a ticket to get this fixed in newer release of Camel: https://issues.apache.org/jira/browse/CAMEL-7143
Upvotes: 1