-
1. Re: Route priority
davsclaus Mar 16, 2011 8:10 AM (in response to larasith)Can you post more details about your questions, so we are sure what you ask about?
-
2. Re: Route priority
thygesen Mar 16, 2011 8:24 AM (in response to larasith)Do you mean startup order for camel routes?
http://camel.apache.org/configuring-route-startup-ordering-and-autostartup.html
or bundle-level startup
http://karaf.apache.org/manual/2.1.99-SNAPSHOT/commands/osgi-bundle-level.html
/Peter
Edited by: thygesen on Mar 16, 2011 1:21 PM
-
3. Re: Route priority
larasith Mar 16, 2011 9:21 AM (in response to thygesen)I want to give preference to an execution of a route than others, for example, if an user requests something, the route that he executes should have more priority than the automatic routes that start with "<from uri='file:..."
-
4. Re: Route priority
njiang Mar 16, 2011 11:48 PM (in response to larasith)Hi
You can use the CBR[1] to checks the message priority to decide which route the message will be sent to.
http://camel.apache.org/content-based-routing-on-camel.html
Willem
-
5. Re: Route priority
larasith Mar 17, 2011 4:06 AM (in response to njiang)Sorry, but i don't mean that. I want to if an automatic route, so file consumer, is working and, in the same moment, a human execute a other route, so a webservice implemented with cxfEndpoint, this route has more priority than the first one.
My intention is that the human waits as short as possible.
-
6. Re: Route priority
njiang Mar 17, 2011 10:00 AM (in response to larasith)Current Camel doesn't provides any priority control on the route. As each route handle the message separately. For your case, Camel start two different thread or thread pool to poll the directory and handle the soap request.
If you want to camel handle the message in these route differently, I think you can do some thing to change the file polling endpoint wait time or do some configuration on the thread pool.
Willem
-
7. Re: Route priority
larasith Mar 17, 2011 11:51 AM (in response to njiang)Ok, thanks. I try to balance with two servers
-
8. Re: Route priority
davsclaus Mar 19, 2011 10:00 AM (in response to larasith)Thread priorities in Java is flawed and doesn't work. So you can't really within a JVM turn up/down priorities in threads/thread pools.
You can build an architecture with some sort of priority queues, so important messages is picked up sooner/faster than low priority queues.
For example Apache ActiveMQ supports priorities on its queues.