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 <[email protected]> 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 > > > >
