How can I use apache camel-ssh to manage remote servers, such as executing nginx-s reload commands?

from("file:I:/workProject/java/xxxx/luaFiles/").multicast().to("direct:a", "direct:b").end().to("direct:c");
    from("direct:a").to("sftp://root@192.168.56.14/xxxx/controllers/gen/?password=root&stepwise=true&runLoggingLevel=TRACE&throwExceptionOnConnectFailed=true&idempotent=true");
    from("direct:b").to("sftp://root@192.168.56.14/?password=root&stepwise=true&runLoggingLevel=TRACE&throwExceptionOnConnectFailed=true&idempotent=true");
    from("direct:c").to("ssh://root:root@192.168.56.14?pollCommand=nginx -s reload %0A").log("done ${body}");

the above code was not executed successfully

my requirement is to distribute the lua code and then execute the nginx-s reload command for each service,

similar to ansible function, remote management, but it seems more convenient to use java camel. You don"t need too many functions, just Synchronize file + reload

The

code environment is as follows, and I also found a camel-exec module that is not supported in version 2.21.1 and does not seem to support sending remote management commands

apache-camel version: 2.21.1
camel-sftp, camel-ssh
Environment: java 1.8
spring boot 1.15.x centos 7 os
please help

Feb.20,2022
Menu