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

Claus Ibsen commented on CAMEL-17723:
-------------------------------------

Jiri, great analysis

Yeah the endpoint-dsl is building up an URI string - and encoded as you say.

I wonder if the endpoint DSL builder needs for options that can be expression 
to expose this too

.pollCommand("${header.CommandArg}"))

So you can do

.pollCommand(simple("${header.CommandArg}")))

Then its explicit that this is a simple expression.
But that requires to markup all these options that have this feature.

And it comes back to pollEnrich taking a string as input will evaluate that as 
simple today.
But when the string is build using endpoint-dsl, then its encoded as you 
analysis found out.

What we can maybe do is to have

    public Type pollEnrich(EndpointConsumerBuilder resourceUri) {
        return pollEnrich(new SimpleExpression(resourceUri.getUri()), -1, 
(String) null, false);
    }

Which is where this happens, we could have a getRawUri() (not encoded) on the 
endpoint-dsl builder methods.
Then we can likely fix this for pollEnrich and maybe a few other EIPs that does 
this ^^^^



> camel-ssh - Dynamic Header is not resolved in pollCommand
> ---------------------------------------------------------
>
>                 Key: CAMEL-17723
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17723
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-ssh
>    Affects Versions: 3.15.0
>            Reporter: Guillaume N.
>            Assignee: Jiri Ondrusek
>            Priority: Minor
>         Attachments: SshComponentProducerCommandTest.java
>
>
> Hello
> I have been trying to add a dynamic argument to SSH command through a header. 
> However the pollCommand parameter does not resolve it and issue the command 
> as is.
> Please see this Zulip discussion:
> [https://camel.zulipchat.com/#narrow/stream/257298-camel/topic/Dynamic.20SSH.20command]
> I also tried to create a UnitTest to replicate the issue, please see attached.
> Best regards
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to