You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Claus Ibsen <ci...@silverbullet.dk> on 2008/04/05 18:14:49 UTC
Consumer URI properites - what is the reason for the special prefix
Hi
I am working on some issues with the FTP component and it had me spoofed for a few hours.
I could not configure the FTP consumer to use my parameters from the URI such as delay between the pooling etc.
Digging into the code I discovered I had to prefix the URI parameters with "consumer.".
See the code in ScheduledPollEndpoint
Reading the wiki documentation and seeing the unit test samples etc you really don't get any hint that you should prefix the URI parameters with "consumer." to get the consumer to work.
If I have this Camel context
port = "20014";
String ftpUrl = "ftp://admin@localhost:" + port + "/tmp4/camel?password=admin&binary=true&delay=10000&recursive=false";
from(ftpUrl).setHeader(FileComponent.HEADER_FILE_NAME, constant("deleteme.jpg")).to(fileUrl, "mock:result");
Then it does not work with a 10 sec delay. I have to use this URI
String ftpUrl = "ftp://admin@localhost:" + port + "/tmp4/camel?password=admin&binary=true&consumer.delay=10000&consumer.recursive=false";
As you can notice I have prefixed the some of the parameters with "consumer." and the parameters to the FTP login is not.
This is not really what most users would expect/figure out out-of-the-box.
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
RE: Consumer URI properites - what is the reason for the special prefix
Posted by Claus Ibsen <ci...@silverbullet.dk>.
Thanks Aaron for the response.
We need to remember to update the wiki documentation that some properties can be set using a special prefix.
I think I have seen special prefixes in one of the http components to configure HTTPClient.
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Aaron Crickenberger [mailto:aaron.crickenberger@intalgent.com]
Sent: 9. april 2008 15:18
To: camel-dev@activemq.apache.org
Subject: Re: Consumer URI properites - what is the reason for the special prefix
On Apr 5, 2008, at 12:14 PM, Claus Ibsen wrote:
> As you can notice I have prefixed the some of the parameters with
> "consumer." and the parameters to the FTP login is not.
>
> This is not really what most users would expect/figure out out-of-
> the-box.
So again, I think this is symptomatic of polling logic being
configured somewhere it doesn't belong. The same URI is being used to
configure two different concepts: polling, and the endpoint.
I think you need the consumer prefix to avoid confusion in the
(admittedly contrived) corner case where your endpoint and
PollingConsumer have properties of the same name.
- aaron
Re: Consumer URI properites - what is the reason for the special prefix
Posted by Aaron Crickenberger <aa...@intalgent.com>.
On Apr 5, 2008, at 12:14 PM, Claus Ibsen wrote:
> As you can notice I have prefixed the some of the parameters with
> "consumer." and the parameters to the FTP login is not.
>
> This is not really what most users would expect/figure out out-of-
> the-box.
So again, I think this is symptomatic of polling logic being
configured somewhere it doesn't belong. The same URI is being used to
configure two different concepts: polling, and the endpoint.
I think you need the consumer prefix to avoid confusion in the
(admittedly contrived) corner case where your endpoint and
PollingConsumer have properties of the same name.
- aaron