Now if you check my reply I have added all routes dynamically by specifying
camel context and route id for each route, if you do so and keep track of ids
you have created for routes,
You can have another bean to do this
Get camelcontext (camelcontextid)
Get routes to stop by I'd,
Stop route
Th
I haven't checked gudiseashok's solution but I ended up with the solution of
multiple threads created after a from("sql:...").to("bean:...) where inside
the bean's calling function is a for loop to create threads where the run()
method of the Runnable is something like:
run() {
camelConte
See if this helps you ...
//Calling to create a router - or loop this
AppsRouteBuilder.getInstance().addRouter(camelContext, "{add router id}",
true,
"{add your "*from*" string here}", new
String[] {"***One or ***","more
"To" strings here"});
Note#// You ca
So why not use the for loop to create as many routes as you want? I use
that method frequently.
*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39*
On Wed, Oct 2, 2
I can't see how this can help me. I don't want to listen for one exchange
only and move on. I want to listen forever.
When I say "create routes dynamically" I mean I would like to open as many
smpp receivers as accounts are in my database.
After the from(sql:) I want the routes to be a to(bean:) t
The confusion is whether you really mean that you want to CREATE new routes
dynamically (which would be very unusual) or whether you really mean that you
have some processing steps and you want to RUN those steps once for each record
returned (which is much more common).
In the later case, a sp
Just put the for outside. I do this all the time.
for (final String path : paths) {
from("file://" + path +"?readlock=changed").to(...) ...
}
This will create four identical routes other than the file paths. if there
are four elements in paths.
*Robert Simmons Jr. MSc. - Lead Java Architect @
Not clear what you are trying to achieve exactly, but I think what you want is
the splitter which in this case you would use to execute the route for each
record. Something like the following will call the method for each record
returned from the SQL.
from("sql:" + fromUri + "?dataSource=dataSo