You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by agustino <si...@yahoo.com> on 2012/05/03 06:52:57 UTC

Dynamic source endpoint

Hi All,

I have a case like this:
- retrieve source from database (it will return multiple values)
- read the file from the sources
- route the message to queue.

Thanks

--
View this message in context: http://camel.465427.n5.nabble.com/Dynamic-source-endpoint-tp5682267.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Dynamic source endpoint

Posted by agustino <si...@yahoo.com>.
Hi Claus,

Thanks for the reply. It really helpful.



--
View this message in context: http://camel.465427.n5.nabble.com/Dynamic-source-endpoint-tp5682267p5685285.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Dynamic source endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
You can add routes at runtime to a running Camel.

If you using Java then you can have a RouteBuilder class as a
template, and then maybe some getter/setter for the uris.
And then reference those uris in the configure() method where you use
the Java DSL.



On Thu, May 3, 2012 at 9:53 AM, agustino <si...@yahoo.com> wrote:
> Hi Claus,
>
> Sorry for my bad question. Basically I am confused how to create multiple
> dynamic endpoint to consume the file and do processing of the file.
> i.e:
> from("sql:select systemfolder from paths").from(<this value is return from
> the previous query>).to("activemq://queue:output")
>
> Thanks
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Dynamic-source-endpoint-tp5682267p5682549.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
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/

Re: Dynamic source endpoint

Posted by ychawla <pr...@yahoo.com>.
Hi,
I would look into using a routing slip here as well.  Depending on how
dynamic your endpoints are you can poll the database using a timer, retrieve
your endpoints, havw a bean processor that creates a routing slip header,
and then send the exchange to the routing slip.

This could work if you know what your endpoints are ahead of time but only
need to send to a subset of them based on your database query.

Thanks,
Yogesh


--
View this message in context: http://camel.465427.n5.nabble.com/Dynamic-source-endpoint-tp5682267p5686553.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Dynamic source endpoint

Posted by Marco Westermann <Ma...@gmx.de>.
Hi,

use can use pollEnrich to consume a file within a route.

from(sql...)
     pollEnrich("file://....")
     .to("activemq:myqueue");

look here: http://camel.apache.org/content-enricher.html

Another way could be to call a bean which reads the file and return the 
content of the file


from(sql)
     .bean(new TestBean())
     .to("activemq")

in the TestBean class you have the message which comes from the 
sql-request. So you can decide in your bean what file to open.

regards, Marco



Am 03.05.2012 09:53, schrieb agustino:
> Hi Claus,
>
> Sorry for my bad question. Basically I am confused how to create multiple
> dynamic endpoint to consume the file and do processing of the file.
> i.e:
> from("sql:select systemfolder from paths").from(<this value is return from
> the previous query>).to("activemq://queue:output")
>
> Thanks
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Dynamic-source-endpoint-tp5682267p5682549.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Dynamic source endpoint

Posted by agustino <si...@yahoo.com>.
Hi Claus,

Sorry for my bad question. Basically I am confused how to create multiple
dynamic endpoint to consume the file and do processing of the file.
i.e:
from("sql:select systemfolder from paths").from(<this value is return from
the previous query>).to("activemq://queue:output")

Thanks

--
View this message in context: http://camel.465427.n5.nabble.com/Dynamic-source-endpoint-tp5682267p5682549.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Dynamic source endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, May 3, 2012 at 6:52 AM, agustino <si...@yahoo.com> wrote:
> Hi All,
>
> I have a case like this:
> - retrieve source from database (it will return multiple values)
> - read the file from the sources
> - route the message to queue.
>

And is there a question in there?

If you want people to participate in you thread. Then make a better
effort and take more time to explain what you want.


> Thanks
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Dynamic-source-endpoint-tp5682267.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
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/