camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From harinair <>
Subject Camel Remote File Producer / Recipient List Password Issue
Date Tue, 27 Jan 2009 03:15:50 GMT

Claus and others:

I think I encountered a bug in using Remote File Component (SFTP) with
My route is similar to this:

        <route errorHandlerRef="dataPushErrorHandler">
            <from ref="routerDeliveryChannelCQueue" />
            <process ref="securityHeaderGenerator" />
            <to ref="routerLogDefault" />
                <xpath resultType="java.lang.String">$routerRoute</xpath>
            <to uri="bean:responseVerificationProcessor?method=process" />

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:

    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();
            } catch (Exception e) {
                throw new FailedToCreateProducerException(endpoint, e);
            producers.put(key, answer);
        return answer;

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

Hari Gangadharan

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message