문제

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>
도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top