Re: SftpEndpoint + privateKey bytes[] + poolEnrich

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: SftpEndpoint + privateKey bytes[] + poolEnrich

Willem.Jiang
Administrator
How about using .pollEnrichRef(EndpointID, xxx) API.
Using the getEndpointUri() is not handy, I prefer to the endpoint
instance id from the application context.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Fri, Aug 30, 2019 at 4:43 AM Shultz, Dmitry
<[hidden email]> wrote:

>
> Hi All,
>
> I have an SftpEndpoint, which is configured to use the private key bytes (using SftpConfiguration.setPrivateKey(byte[]),  and the poolEnrich() that is using this endpoint to fetch some file.
>
> The problem I'm facing is that poolEnrich() doesn't accept Endpoint as a parameter (accepts only String), so I have to use  SftpEndpoint.getEndpointUri() to pass the url string of configured endpoint. It creates 'safe' URI  with  filename that looks like this:   fileName=%24%7Bheader.CamelFileName%7D
> And it seems like poolEnrich().simple(sftpEndpoint.getEndpointUri()) ignores the  filename expression (the wrong file is picked up from sftp), probably because there is  '%24%7' instead of '${'  and '%7D' instead of '}', but I'm not sure.
>
> What would be the good way to make sure the Uri String generated by SftpEndpoint.getEndpointUri() is properly parsed? Or may be there is some way to pass configured Endpoint to poolEnrich?
>
> Cheers,
> Dmitry
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: SftpEndpoint + privateKey bytes[] + poolEnrich

Claus Ibsen-2
Hi

You can maybe also store the bytes in the registry and refer to them
via #myBeanId in the endpoint uri.

On Thu, Aug 29, 2019 at 10:43 PM Shultz, Dmitry
<[hidden email]> wrote:

>
> Hi All,
>
> I have an SftpEndpoint, which is configured to use the private key bytes (using SftpConfiguration.setPrivateKey(byte[]),  and the poolEnrich() that is using this endpoint to fetch some file.
>
> The problem I'm facing is that poolEnrich() doesn't accept Endpoint as a parameter (accepts only String), so I have to use  SftpEndpoint.getEndpointUri() to pass the url string of configured endpoint. It creates 'safe' URI  with  filename that looks like this:   fileName=%24%7Bheader.CamelFileName%7D
> And it seems like poolEnrich().simple(sftpEndpoint.getEndpointUri()) ignores the  filename expression (the wrong file is picked up from sftp), probably because there is  '%24%7' instead of '${'  and '%7D' instead of '}', but I'm not sure.
>
> What would be the good way to make sure the Uri String generated by SftpEndpoint.getEndpointUri() is properly parsed? Or may be there is some way to pass configured Endpoint to poolEnrich?
>
> Cheers,
> Dmitry
>
>
>
>


--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2