camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Camel Remote File Producer / Recipient List Password Issue
Date Tue, 27 Jan 2009 07:35:56 GMT
On Tue, Jan 27, 2009 at 8:27 AM, Ramon Buckland
<ramon.buckland@gmail.com> wrote:
> Hi,
>
> Does the s/ftp components use or support sftp://username:password@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 :-)
Yeah it should as we use a java.net.URI that can extract the info, but
I can see the password might be missing

    public void configure(URI uri) {
        super.configure(uri);
        setProtocol(uri.getScheme());
        setDefaultPort();
        setUsername(uri.getUserInfo());
        setHost(uri.getHost());
        setPort(uri.getPort());
    }

I think its the authority but I cant remember and as usualy the damm
Javadoc from the JDK core is without any good examples.

Ramon do you mind creating a unit test with that kind of URI so we can
have it supported?



>
> r.
>
>
> On Tue, Jan 27, 2009 at 18:18, Claus Ibsen <claus.ibsen@gmail.com> 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 <hari_g@hotmail.com> 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/
>>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Mime
View raw message