Hi I need more coffee in the morning. But you can set the password in the URI.
Such as: "sftp://sec...@myhost:22/mydir" Lets see if that dont work, as a workaround. Which version of Camel are you using? If you are on 2.0 then yes there are some major refactorings in the file and ftp component at the moment. Could you create a sample project that has this issue? Or small unit test or something? Would be nice to use for the bug hunting and fix. On Tue, Jan 27, 2009 at 4:15 AM, harinair <har...@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/