Apache Camel - How to set a private key in a dinamic sftp endpoint

前端 未结 1 1216
小鲜肉
小鲜肉 2021-01-27 07:49

Using Java DSL, I have a route in which I poll a file in an SFTP server using the file name set in the message headers

from(\"direct:download\")
        .pollEnr         


        
相关标签:
1条回答
  • 2021-01-27 07:53

    You can reference privateKey as bean from registry.

    .pollEnrich()
        .simple("sftp://my.host:22/folder/?username=foo&privateKey=#myKeyInRegistry&fileName=${header.CamelFileName}")
    

    Binding bean to registry depends on platform and Camel version you are using.

    0 讨论(0)
提交回复
热议问题