You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Terry Walters (JIRA)" <ji...@apache.org> on 2013/11/21 16:15:35 UTC

[jira] [Updated] (CAMEL-6988) 2.12.1 caches groovy call - resulting with previous caller state

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

Terry Walters updated CAMEL-6988:
---------------------------------

    Description: 
2.12.1
Works        <simple>"${body.subOrderName}Endpoint"</simple>
Fails          <groovy>"${request.body.subOrderName}Endpoint"</groovy>

2.11.1
Works        <simple>"${body.subOrderName}Endpoint"</simple>
Works        <groovy>"${request.body.subOrderName}Endpoint"</groovy>

*Fails by returning a previous calls result for subOrderName. 
To reproduce you must make several calls in a timely manner with different bean data (OGNL/subOrderName).

Route:
...
<setHeader headerName="RSSX_ORDER_ROUTING_SLIP">
<groovy>return "${request.body.subOrderName}Endpoint"</groovy>
</setHeader>
<!-- Route the order by the routing slip header -->
<routingSlip>
<header>RSSX_ORDER_ROUTING_SLIP</header>
</routingSlip>
...

Log:
1st execution
Before set header:    UpdatePortIn

After set header:   RSSX_ORDER_ROUTING_SLIP=UpdatePortInEndpoint

2nd execution (in a timely manner – exposing a LRU Cache issue?)
Before set header: ResellerAddSubscriberPortIn
After set header:    RSSX_ORDER_ROUTING_SLIP=UpdatePortInEndpoint

Same logic works in 2.11.1

Additionally this does not appear OGNL related:
I just ran into the case where       
<setHeader headerName="RSSX_ORDER_ROUTING_SLIP">
        <groovy>"${request.body.getSubOrderName()}Endpoint"</groovy>
      </setHeader>
returns the cached subOrderName from the previous transaction

So this appears to be isolated to the <groovy> component changes (LRU Cache?) that were introduced in 2.12.1

  was:
2.12.1
Works        <simple>"${body.subOrderName}Endpoint"</simple>
Fails          <groovy>"${request.body.subOrderName}Endpoint"</groovy>

2.11.1
Works        <simple>"${body.subOrderName}Endpoint"</simple>
Works        <groovy>"${request.body.subOrderName}Endpoint"</groovy>

*Fails by returning a previous calls result for subOrderName. 
To reproduce you must make several calls in a timely manner with different bean data (OGNL/subOrderName).

Route:
...
<setHeader headerName="RSSX_ORDER_ROUTING_SLIP">
<groovy>return "${request.body.subOrderName}Endpoint"</groovy>
</setHeader>
<!-- Route the order by the routing slip header -->
<routingSlip>
<header>RSSX_ORDER_ROUTING_SLIP</header>
</routingSlip>
...

Log:
1st execution
Before set header:    UpdatePortIn

After set header:   RSSX_ORDER_ROUTING_SLIP=UpdatePortInEndpoint

2nd execution (in a timely manner – exposing a LRU Cache issue?)
Before set header: ResellerAddSubscriberPortIn
After set header:    RSSX_ORDER_ROUTING_SLIP=UpdatePortInEndpoint

Same logic works in 2.11.1

        Summary: 2.12.1 caches groovy call - resulting with previous caller state  (was: 2.12.1 caches groovy OGNL call - resulting with previous caller state)

> 2.12.1 caches groovy call - resulting with previous caller state
> ----------------------------------------------------------------
>
>                 Key: CAMEL-6988
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6988
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-groovy
>    Affects Versions: 2.12.1
>         Environment: same results using java 7 on osx, ubuntu, and windoze
>            Reporter: Terry Walters
>             Fix For: 2.11.1
>
>
> 2.12.1
> Works        <simple>"${body.subOrderName}Endpoint"</simple>
> Fails          <groovy>"${request.body.subOrderName}Endpoint"</groovy>
> 2.11.1
> Works        <simple>"${body.subOrderName}Endpoint"</simple>
> Works        <groovy>"${request.body.subOrderName}Endpoint"</groovy>
> *Fails by returning a previous calls result for subOrderName. 
> To reproduce you must make several calls in a timely manner with different bean data (OGNL/subOrderName).
> Route:
> ...
> <setHeader headerName="RSSX_ORDER_ROUTING_SLIP">
> <groovy>return "${request.body.subOrderName}Endpoint"</groovy>
> </setHeader>
> <!-- Route the order by the routing slip header -->
> <routingSlip>
> <header>RSSX_ORDER_ROUTING_SLIP</header>
> </routingSlip>
> ...
> Log:
> 1st execution
> Before set header:    UpdatePortIn
> After set header:   RSSX_ORDER_ROUTING_SLIP=UpdatePortInEndpoint
> 2nd execution (in a timely manner – exposing a LRU Cache issue?)
> Before set header: ResellerAddSubscriberPortIn
> After set header:    RSSX_ORDER_ROUTING_SLIP=UpdatePortInEndpoint
> Same logic works in 2.11.1
> Additionally this does not appear OGNL related:
> I just ran into the case where       
> <setHeader headerName="RSSX_ORDER_ROUTING_SLIP">
>         <groovy>"${request.body.getSubOrderName()}Endpoint"</groovy>
>       </setHeader>
> returns the cached subOrderName from the previous transaction
> So this appears to be isolated to the <groovy> component changes (LRU Cache?) that were introduced in 2.12.1



--
This message was sent by Atlassian JIRA
(v6.1#6144)