FAQ
Is it possible to dynamically create a URI in camel FTP?

--
View this message in context: http://camel.465427.n5.nabble.com/Dynamic-URI-creation-in-apache-camel-tp5055155p5055155.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

  • Spalat at Dec 7, 2011 at 11:27 am
    I'm using camel-context.xml to construct FTP endpoints . Currently i'm
    hardcoding the username and password in the FTP uri . Is it possible to
    change them in the FTP uri dynamically on each request. ?

    --
    View this message in context: http://camel.465427.n5.nabble.com/Dynamic-URI-creation-in-apache-camel-tp5055155p5055182.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Claus Ibsen at Dec 7, 2011 at 11:34 am
    See this FAQ
    http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

    And you may want to use the disconnect=true option on the FTP uri, to
    logout after usage.


    On Wed, Dec 7, 2011 at 11:51 AM, Spalat wrote:
    I'm using camel-context.xml to construct FTP endpoints . Currently i'm
    hardcoding the username and password in the FTP uri . Is it possible to
    change them in the FTP uri dynamically on each request. ?

    --
    View this message in context: http://camel.465427.n5.nabble.com/Dynamic-URI-creation-in-apache-camel-tp5055155p5055182.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: cibsen@fusesource.com
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/
  • Spalat at Dec 8, 2011 at 6:02 am
    Hi,

    Thanks for the reply.
    So we can use
    ...ftp://${in.header.username}@${in.header.ip}:21/Newfolder/?password=${in.header.pwd}&recursive=true&amp...
    For password is there a security subject for the
    message/exchange? To void the pwd being traced in some logs.

    With Best Regards,
    spalat

    --
    View this message in context: http://camel.465427.n5.nabble.com/Dynamic-URI-creation-in-apache-camel-tp5055155p5057775.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Claus Ibsen at Dec 8, 2011 at 7:50 am

    On Thu, Dec 8, 2011 at 7:01 AM, Spalat wrote:
    Hi,

    Thanks for the reply.
    So we can use
    ...ftp://${in.header.username}@${in.header.ip}:21/Newfolder/?password=${in.header.pwd}&recursive=true&amp...
    For password is there a security subject for the
    message/exchange? To void the pwd being traced in some logs.
    No there is no special security subject.

    Camel will by default mask passwords when it logs endpoints/messages etc.
    You can remove the header after the ftp endpoint, so it wont be
    propagated further in the processing.

    There is a camel-jasypt component to support encrypted values/passwords etc
    http://camel.apache.org/jasypt
    With Best Regards,
    spalat

    --
    View this message in context: http://camel.465427.n5.nabble.com/Dynamic-URI-creation-in-apache-camel-tp5055155p5057775.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: cibsen@fusesource.com
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/
  • Diwakar at Dec 8, 2011 at 9:37 am
    Hi,
    Camel will by default mask passwords when it logs
    endpoints/messages etc.
    Is there any naming convention for the pwd headers. Otherwise
    how will Camel know that a particular header contains password.
    Please let me know your comment.

    With Best Regards,
    Diwakar


    --
    View this message in context: http://camel.465427.n5.nabble.com/Dynamic-URI-creation-in-apache-camel-tp5055155p5058217.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Claus Ibsen at Dec 8, 2011 at 11:04 am

    On Thu, Dec 8, 2011 at 10:37 AM, diwakar wrote:
    Hi,
    Camel will by default mask passwords when it logs
    endpoints/messages etc.
    Is there any naming convention for the pwd headers. Otherwise
    how will Camel know that a particular header contains password.
    Please let me know your comment.
    Its only for endpoint and components where it knows by naming pattern.
    So if an option is named password, its masked etc.

    For headers, you will have to avoid outputting those in logs yourself.
    Or encrypt the password.

    Or store as property on Exchange as they are not logged by default.

    With Best Regards,
    Diwakar


    --
    View this message in context: http://camel.465427.n5.nabble.com/Dynamic-URI-creation-in-apache-camel-tp5055155p5058217.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: cibsen@fusesource.com
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/
  • Diwakar at Dec 8, 2011 at 4:50 pm
    Hi,
    For headers, you will have to avoid outputting those in
    logs yourself.
    Or store as property on Exchange as they are not logged
    by default
    If Camel code does not log the headers (even with DEBGUG
    level) it is fine.
    Thanks.

    With Best Regards,
    Diwakar


    --
    View this message in context: http://camel.465427.n5.nabble.com/Dynamic-URI-creation-in-apache-camel-tp5055155p5059398.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Diwakar at Dec 9, 2011 at 7:36 pm
    Hi,

    FTP component seems to be mostly a polling consumer.
    ftp://${in.header.username}@${in.header.ip}:21/Newfolder/?password=${in.header.pwd}&
    How can the expansion of the headers ever work for consumers?
    An example would help. Thanks.

    With Best Regards,
    Diwakar


    --
    View this message in context: http://camel.465427.n5.nabble.com/Dynamic-URI-creation-in-apache-camel-tp5055155p5062816.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Diwakar at Dec 12, 2011 at 11:19 am
    Hi,

    Please see the route below:
    from("ftp://test@localhost/?password=test&binary=true&delay=10000")
    .to("file://target/test-reports");
    Can someone comment on how password hardcoding can be avoided in
    the DSL.
    I could avoid it with bean code as below:
    public void getFTPFile(Exchange exchange) {
    ConsumerTemplate consumer =
    exchange.getContext().createConsumerTemplate();
    ProducerTemplate prod = exchange.getContext().createProducerTemplate();
    Exchange exchange1;
    while (true)
    {
    exchange1 =
    consumer.receive("ftp://test@localhost/?password="+exchange.getIn().getHeaders().get("pwd")+"&fileName=test.xml&binary=true",
    3000);
    System.out.println("getFtp Exchange:"+exchange1);
    if (exchange1 == null)
    {
    System.out.println("getFtp Exchange:"+"break");
    break;
    }
    prod.send("file://target/test-reports",exchange1);
    }

    }

    With Best Regards,
    Diwakar


    --
    View this message in context: http://camel.465427.n5.nabble.com/Dynamic-URI-creation-in-apache-camel-tp5055155p5067964.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Justin Rosenberg at Dec 7, 2011 at 3:23 pm
    You can programmatically stop the route, update the DSL, and start the
    route again. I'm not sure how to change the parameters after the route
    has started.

    ~Justin


    -----Original Message-----
    From: Spalat
    Sent: Wednesday, December 07, 2011 4:51 AM
    To: users@camel.apache.org
    Subject: Re: Dynamic URI creation in apache camel

    I'm using camel-context.xml to construct FTP endpoints . Currently i'm
    hardcoding the username and password in the FTP uri . Is it possible to
    change them in the FTP uri dynamically on each request. ?

    --
    View this message in context:
    http://camel.465427.n5.nabble.com/Dynamic-URI-creation-in-apache-camel-t
    p5055155p5055182.html
    Sent from the Camel - Users mailing list archive at Nabble.com.

    CONFIDENTIALITY NOTICE:
    The information in this message, and any attachment, is intended for the
    sole use of the individual and entity to whom it is addressed. This
    information may be privileged, confidential, and protected from
    disclosure. If you are not the intended recipient you are hereby notified
    that you have received this communication in error and that any review,
    disclosure, dissemination, distribution or copying of it, or its contents,
    is strictly prohibited. If you think that you have received this message
    in error please notify the sender and destroy all copies of this
    communication and any attachments. Thank you.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedDec 7, '11 at 11:27a
activeDec 12, '11 at 11:19a
posts11
users4
websitecamel.apache.org

People

Translate

site design / logo © 2022 Grokbase