[ 
https://issues.apache.org/jira/browse/CAMEL-20815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17850458#comment-17850458
 ] 

Claus Ibsen edited comment on CAMEL-20815 at 5/29/24 6:35 PM:
--------------------------------------------------------------

That is not a bug, the getVariable on exchange is only for exchange scoped 
variables.

See the javadoc of the APIs


was (Author: davsclaus):
That is not a bug, the getVariable on exchange is only for exchange scoped 
variables.

 

> exchange.getVariable does not get Global variables in custom processor
> ----------------------------------------------------------------------
>
>                 Key: CAMEL-20815
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20815
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 4.6.0
>            Reporter: Marat Gubaidullin
>            Priority: Minor
>
> This one does not work in custom processor:
> {code:java}
> Object val1 = exchange.getVariable("global:testVar"); {code}
> This one works fine:
> {code:java}
> Object val2 = exchange.getContext().getVariable("testVar"); {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to