You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jacek Szymański (Jira)" <ji...@apache.org> on 2023/05/23 16:09:00 UTC

[jira] [Updated] (CAMEL-19383) camel-jslt: allowTemplateFromHeader ignores header on subsequent exchanges

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

Jacek Szymański updated CAMEL-19383:
------------------------------------
    Description: 
When allowTemplateFromHeader is set, the endpoint will remember the first header expression that is set and use it for any subsequent exchange, even if it brings a different expression in its header.

That is:

{{template.sendBodyAndHeader("direct:start", TEST_BODY,}}
{{JsltConstants.HEADER_JSLT_STRING, ".foo");}}

{{template.sendBodyAndHeader("direct:start", TEST_BODY,}}
{{JsltConstants.HEADER_JSLT_STRING, ".bar");}}

will both use the expression .foo and the expression .bar will be ignored.

 

Also, if resource is set on the URI, it will ignore any expressions from header despite allowTemplateFromHeader, unless it was set on the first exchange, in which case it will be used for all exchanges, even those without the header set.

  was:
When allowTemplateFromHeader is set, the endpoint will remember the first header expression that is set and use it for any subsequent exchange, even if it brings a different expression in its header.

That is:

{{template.sendBodyAndHeader("direct:start", TEST_BODY,}}
{{JsltConstants.HEADER_JSLT_STRING, ".foo");}}

{{template.sendBodyAndHeader("direct:start", TEST_BODY,}}
{{JsltConstants.HEADER_JSLT_STRING, ".bar");}}



will both use the expression .foo and the expression .bar will be ignored.


> camel-jslt: allowTemplateFromHeader ignores header on subsequent exchanges
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-19383
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19383
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 3.20.4, 4.0-M3
>            Reporter: Jacek Szymański
>            Priority: Major
>
> When allowTemplateFromHeader is set, the endpoint will remember the first header expression that is set and use it for any subsequent exchange, even if it brings a different expression in its header.
> That is:
> {{template.sendBodyAndHeader("direct:start", TEST_BODY,}}
> {{JsltConstants.HEADER_JSLT_STRING, ".foo");}}
> {{template.sendBodyAndHeader("direct:start", TEST_BODY,}}
> {{JsltConstants.HEADER_JSLT_STRING, ".bar");}}
> will both use the expression .foo and the expression .bar will be ignored.
>  
> Also, if resource is set on the URI, it will ignore any expressions from header despite allowTemplateFromHeader, unless it was set on the first exchange, in which case it will be used for all exchanges, even those without the header set.



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