Hi,

Does the s/ftp components use or support sftp://username:passw...@host:port
?
Would it be much to change this ?
(I should know the answer to this as I have been staring at this code for
days now :-)

r.


On Tue, Jan 27, 2009 at 18:18, Claus Ibsen <[email protected]> wrote:

> Hi
>
> I think I have spotted the code that strips the parameters
> RemoteFileComponent has this code
>
>        // get the uri part before the options as they can be non URI valid
> such
>        // as the expression using $ chars
>        if (uri.indexOf("?") != -1) {
>            uri = uri.substring(0, uri.indexOf("?"));
>        }
>
> I will dig a bit into this. I do think it needs to be removed.
>
> On Tue, Jan 27, 2009 at 4:15 AM, harinair <[email protected]> wrote:
> >
> > Claus and others:
> >
> > I think I encountered a bug in using Remote File Component (SFTP) with
> > recipientList
> > My route is similar to this:
> >
> >        <route errorHandlerRef="dataPushErrorHandler">
> >            <from ref="routerDeliveryChannelCQueue" />
> >            <process ref="securityHeaderGenerator" />
> >            <to ref="routerLogDefault" />
> >            <recipientList>
> >                <xpath resultType="java.lang.String">$routerRoute</xpath>
> >            </recipientList>
> >            <to uri="bean:responseVerificationProcessor?method=process" />
> >        </route>
> >
> >
> > So if you look at it I send the exchange to the recipient specified in
> > header routerRoute. Now the recipient list uses a ProducerCache which
> relies
> > on the Endpoint URI as the key - so every time recipientList asks for a
> > producer, ProducerCache gives a producer from the Map based on Endpoint
> URI:
> >
> > [code]
> >    public synchronized Producer<E> getProducer(Endpoint<E> endpoint) {
> >        String key = endpoint.getEndpointUri();
> >        Producer<E> answer = producers.get(key);
> >        if (answer == null) {
> >            try {
> >                answer = endpoint.createProducer();
> >                answer.start();
> >            } catch (Exception e) {
> >                throw new FailedToCreateProducerException(endpoint, e);
> >            }
> >            producers.put(key, answer);
> >        }
> >        return answer;
> >    }
> > [/code]
> >
> > Now the RemoteFileEndpoint substitutes the uri trimmed to the "?". Hence
> for
> > "sftp://myhost:22/mydir?password=secret";, the uri is
> sftp://myhost:22/mydir
> >
> > So essentially, even if I put a new url (with changes after the '?' -
> > example a change in password), still the old producer will be used by the
> > RecipientList unless the whole Camel is restarted (and thus clearing the
> Map
> > in the ProducerCache). I really have to do something to fix this since if
> a
> > customer corrects the password (using a separate web UI) that never gets
> > refreshed because the new password passed through the routerRoute header
> is
> > ignored by the recipientList due to the presence of a stale misconfigured
> > Producer with the "same uri" in the ProducerCache.
> >
> > Claus, How can I resolve this? Could you understand what I am talking
> about?
> > Is there any work around? The latest Camel trunk does not have the
> Producers
> > -- so there is a re-engineering happening to the Producers? According to
> me
> > instead of using the pruned URI probably the full URI is to be used. Any
> > comments?
> >
> > Hari Gangadharan
> >
> > --
> > View this message in context:
> http://www.nabble.com/Camel-Remote-File-Producer---Recipient-List-Password-Issue-tp21678952s22882p21678952.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
> >
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
>

Reply via email to