306.3. プロデューサーエンドポイントとしての使用
SSH コンポーネントがプロデューサー(.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>