You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Aalandril <aa...@gmail.com> on 2013/07/16 13:44:50 UTC

Shutting down a route, inflight messages and splitter

Hi,

I have an application that uses a few different routes, but basically it
picks up a file, extracts some records using splitter and sends them off to
a jms queue. When attempting to shut down the route I am informed my
messages are still inflight and so have to wait 5 minutes before it can be
shut down. Can I resolve/work around this? Am I misusing the Splitter EIP,
and does it require an Aggregator to be satisfied?

Route #1 - search for signal file - if found, dynamically create route #2
looking for matching data file name
Route #2 - pick up data file, process and send to direct:foo
Route #3 - pick up from direct:foo, use Splitter to split into records and
send each to seda queue
Route #4 - pick up from seda queue and write to jms (seda used as a
throttling mechanism, otherwise could obviously have sent directly to jms)
Shut down Route #2 (no longer required for this filename)

Route #2 is dynamic, the rest are configured in spring. The filename is used
as the id for Route #2

As I'm new to Camel, If anyone can suggest any efficiency improvements in my
flow please feel free :o)

Thanks



--
View this message in context: http://camel.465427.n5.nabble.com/Shutting-down-a-route-inflight-messages-and-splitter-tp5735716.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Shutting down a route, inflight messages and splitter

Posted by Aalandril <aa...@gmail.com>.
Thank you for your speedy response. In answer to your questions:

I have read that document, but in this case I only want to shut down Route
#2. When Route #1 picks up the next file I want to to dynamically create a
new (uniquely named) Route #2, but routes #1, #3 and #4 can (hopefully)
remain unaffected.

Routes #3 and #4 are one way (InOnly).

I have not specified an aggregation strategy for the splitter, because I
have no desire to aggregate the messages after they are split.

I'm not sure in which route the in-flight messages are remaining, however as
I am only attempting to shut down route #2, is it too naive to assume it
must be that route? Or does the act of shutting down Route #2 also attempt
to shut down other routes?

I suppose the question I am unsure of is, why are there still inflight
messages? I know the messages have been sent to jms, as I can see them on
the queue, should this not remove them from flight?



--
View this message in context: http://camel.465427.n5.nabble.com/Shutting-down-a-route-inflight-messages-and-splitter-tp5735716p5735723.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Shutting down a route, inflight messages and splitter

Posted by gquintana <ge...@gmail.com>.
Read http://camel.apache.org/graceful-shutdown.html, and probably add
startupOrder:
Route #1 startup order 4
Route #2 
Route #3 startup order 2
Route #4 startup order 1

Are your Routes #3 and #4 In-Out or In Only? Is your Splitter using an
aggregation strategy?
In which one of your routes are in-flight messages remaining?



--
View this message in context: http://camel.465427.n5.nabble.com/Shutting-down-a-route-inflight-messages-and-splitter-tp5735716p5735720.html
Sent from the Camel - Users mailing list archive at Nabble.com.