Forum Home » Fuse Distributions » Fuse ESB

Thread: Route priority

 
This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 8 - Last Post: Mar 19, 2011 2:00 PM Last Post By: davsclaus
larasith

Posts: 41
Registered: 09/24/10
Route priority
Posted: Mar 16, 2011 9:33 AM
 
  Click to reply to this thread Reply
Is there any way to prioritize routes executions?
davsclaus

Posts: 1,893
Registered: 10/14/08
Re: Route priority
Posted: Mar 16, 2011 12:10 PM   in response to: larasith in response to: larasith
 
  Click to reply to this thread Reply
Can you post more details about your questions, so we are sure what you ask about?
thygesen

Posts: 31
Registered: 04/04/09
Re: Route priority
Posted: Mar 16, 2011 12:20 PM   in response to: larasith in response to: larasith
 
  Click to reply to this thread Reply
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

larasith

Posts: 41
Registered: 09/24/10
Re: Route priority
Posted: Mar 16, 2011 1:21 PM   in response to: thygesen in response to: thygesen
 
  Click to reply to this thread Reply
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:..."
njiang

Posts: 572
Registered: 09/17/07
Re: Route priority
Posted: Mar 17, 2011 3:48 AM   in response to: larasith in response to: larasith
 
  Click to reply to this thread Reply
Hi

You can use the CBR[1] to checks the message priority to decide which route the message will be sent to.

[1]http://camel.apache.org/content-based-routing-on-camel.html

Willem
larasith

Posts: 41
Registered: 09/24/10
Re: Route priority
Posted: Mar 17, 2011 8:06 AM   in response to: njiang in response to: njiang
 
  Click to reply to this thread Reply
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.
njiang

Posts: 572
Registered: 09/17/07
Re: Route priority
Posted: Mar 17, 2011 2:00 PM   in response to: larasith in response to: larasith
 
  Click to reply to this thread Reply
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
larasith

Posts: 41
Registered: 09/24/10
Re: Route priority
Posted: Mar 17, 2011 3:51 PM   in response to: njiang in response to: njiang
 
  Click to reply to this thread Reply
Ok, thanks. I try to balance with two servers
davsclaus

Posts: 1,893
Registered: 10/14/08
Re: Route priority
Posted: Mar 19, 2011 2:00 PM   in response to: larasith in response to: larasith
 
  Click to reply to this thread Reply
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.