328.4. 使用作为 Producer 端点
当 SSH 组件用作 Producer (.to ("ssh://…")时,它将发送消息正文作为命令,以便在远程 SSH 服务器上执行。
以下是 XML DSL 中的示例:请注意,命令有一个 XML 编码的新行( )。
<route id="camel-example-ssh-producer">
<from uri="direct:exampleSshProducer"/>
<setBody>
<constant>features:list </constant>
</setBody>
<to uri="ssh://karaf:karaf@localhost:8101"/>
<log message="${body}"/>
</route>