[
https://issues.apache.org/jira/browse/CAMEL-17723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17506820#comment-17506820
]
Jiri Ondrusek commented on CAMEL-17723:
---------------------------------------
I went through the chat and the proposed test.
Here is a code snippet from the test:
{code:java}
from("direct:ssh")
.pollEnrich("ssh://smx:smx@localhost:" + port +
"?useFixedDelay=true&delay=40000&pollCommand=${in.header.CommandArg}%0A")
.to("mock:result");
{code}
Here is the relevant doc, which describes how it should work:
[https://camel.netlify.app/components/latest/eips/pollEnrich-eip.html#_using_dynamic_uris]
The test misses *.simple(...)*
if test is changed (see below), it works as expected.
{code:java}
from("direct:ssh")
.pollEnrich().simple("ssh://smx:smx@localhost:" + port
+ "?useFixedDelay=true&delay=40000&pollCommand=${header.CommandArg}%0A")
.to("mock:result");
{code}
[~gnieser] Does this explanation solve your problem?
> 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)