You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ankelee <an...@gmail.com> on 2010/06/01 12:29:46 UTC

Route not shutting down on shutdownRoute (1 inflight).

Hi

Im trying to create a route that connects to an FTP, downloads the files and
then shuts down the route afterwards to be triggered again later.

I thought I had solved it but I keep getting a "Waiting as there are still 1
inflight and pending exchanges to complete before we can shutdown" message
until timeout. Which exchange could that be, and can I somehow see it?

All the operations works as intended, except the "FtpPollingRoute" never
gets shut down until timeout.

<route id="StartFtpTriggerRoute" autoStartup="true">
	<from uri="quartz://scheduledpoll?cron=5/30+*+*+*+*+?" />
	<bean ref="ControlFtpPollingRoute" method="start" />
	<stop/>
</route>

<route id="FtpPollingRoute" autoStartup="false">
	<from
uri="ftp://{{ftp.server}}{{ftp.inbox}}?username={{ftp.user}}&amp;password={{ftp.password}}&amp;move=done"
/>
	<onCompletion>
		<log message="onComplete =  ${property.CamelBatchComplete}"/>
		<filter>				
			<simple>${property.CamelBatchComplete} == true</simple>
			<log message="Stopping"/>
			<bean ref="ControlFtpPollingRoute" method="stop" />
			<log message="Stopped"/>
		</filter>		
	</onCompletion>
	<log message="Fetching ${file:name}"/>	
	<to uri="file:{{directory.incoming}}" />
	<log message="${file:name} copied"/>			
</route>


[ssword=camel123&username=camel] FtpConsumer                    INFO 
Connected and logged in to: ftp://camel@localhost:21
[ssword=camel123&username=camel] FtpPollingRoute                INFO 
Fetching  CamelinAction (1).pdf
[ssword=camel123&username=camel] FtpPollingRoute                INFO 
CamelinAction (1).pdf copied
[ Camel Thread 1 - OnCompletion] FtpPollingRoute                INFO 
onComplete =  false
[ssword=camel123&username=camel] FtpPollingRoute                INFO 
Fetching  CamelinAction (2).pdf
[ssword=camel123&username=camel] FtpPollingRoute                INFO 
CamelinAction (2).pdf copied
[ Camel Thread 2 - OnCompletion] FtpPollingRoute                INFO 
onComplete =  false
[ssword=camel123&username=camel] FtpPollingRoute                INFO 
Fetching  CamelinAction (3).pdf
[ssword=camel123&username=camel] FtpPollingRoute                INFO 
CamelinAction (3).pdf copied
[ Camel Thread 3 - OnCompletion] FtpPollingRoute                INFO 
onComplete =  true
[ Camel Thread 3 - OnCompletion] FtpPollingRoute                INFO 
Stopping
[ Camel Thread 3 - OnCompletion] DefaultShutdownStrategy        INFO 
Starting to graceful shutdown 1 routes (timeout 300 seconds)
[ Camel Thread 4 - ShutdownTask] DefaultShutdownStrategy        INFO  Route:
FtpPollingRoute suspended and shutdown deferred, was consuming from:
Endpoint[ftp://localhost/inbox?move=done&password=camel123&username=camel]
[ Camel Thread 4 - ShutdownTask] DefaultShutdownStrategy        INFO 
Waiting as there are still 2 inflight and pending exchanges to complete
before we can shutdown
[ Camel Thread 4 - ShutdownTask] DefaultShutdownStrategy        INFO 
Waiting as there are still 1 inflight and pending exchanges to complete
before we can shutdown
[ Camel Thread 4 - ShutdownTask] DefaultShutdownStrategy        INFO 
Waiting as there are still 1 inflight and pending exchanges to complete
before we can shutdown
[ Camel Thread 4 - ShutdownTask] DefaultShutdownStrategy        INFO 
Waiting as there are still 1 inflight and pending exchanges to complete
before we can shutdown
[ Camel Thread 4 - ShutdownTask] DefaultShutdownStrategy        INFO 
Waiting as there are still 1 inflight and pending exchanges to complete
before we can shutdown

-- 
View this message in context: http://old.nabble.com/Route-not-shutting-down-on-shutdownRoute-%281-inflight%29.-tp28740002p28740002.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Route not shutting down on shutdownRoute (1 inflight).

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jun 1, 2010 at 12:29 PM, ankelee <an...@gmail.com> wrote:
>
> Hi
>
> Im trying to create a route that connects to an FTP, downloads the files and
> then shuts down the route afterwards to be triggered again later.
>
> I thought I had solved it but I keep getting a "Waiting as there are still 1
> inflight and pending exchanges to complete before we can shutdown" message
> until timeout. Which exchange could that be, and can I somehow see it?
>

I have had the though of adding detailed insight to this in the
future. Eg from JMX and also in the logs, where you can configure how
verbose it should be.
For example Camel could detect when an Exchange seems to be stuck and
start logging about it and where it appears to be stuck.

Feel free to create a ticket in JIRA so we wont forget about this.

Also in the future we should have a better DSL for scheduling routes.
For example to tell it to run once or repeat etc. And define period
using CRON or fixed delays etc.
There is already a ticket for this in JIRA.




> All the operations works as intended, except the "FtpPollingRoute" never
> gets shut down until timeout.
>
> <route id="StartFtpTriggerRoute" autoStartup="true">
>        <from uri="quartz://scheduledpoll?cron=5/30+*+*+*+*+?" />
>        <bean ref="ControlFtpPollingRoute" method="start" />
>        <stop/>
> </route>
>
> <route id="FtpPollingRoute" autoStartup="false">
>        <from
> uri="ftp://{{ftp.server}}{{ftp.inbox}}?username={{ftp.user}}&amp;password={{ftp.password}}&amp;move=done"
> />
>        <onCompletion>
>                <log message="onComplete =  ${property.CamelBatchComplete}"/>
>                <filter>
>                        <simple>${property.CamelBatchComplete} == true</simple>
>                        <log message="Stopping"/>
>                        <bean ref="ControlFtpPollingRoute" method="stop" />
>                        <log message="Stopped"/>
>                </filter>
>        </onCompletion>
>        <log message="Fetching ${file:name}"/>
>        <to uri="file:{{directory.incoming}}" />
>        <log message="${file:name} copied"/>
> </route>
>
>
> [ssword=camel123&username=camel] FtpConsumer                    INFO
> Connected and logged in to: ftp://camel@localhost:21
> [ssword=camel123&username=camel] FtpPollingRoute                INFO
> Fetching  CamelinAction (1).pdf
> [ssword=camel123&username=camel] FtpPollingRoute                INFO
> CamelinAction (1).pdf copied
> [ Camel Thread 1 - OnCompletion] FtpPollingRoute                INFO
> onComplete =  false
> [ssword=camel123&username=camel] FtpPollingRoute                INFO
> Fetching  CamelinAction (2).pdf
> [ssword=camel123&username=camel] FtpPollingRoute                INFO
> CamelinAction (2).pdf copied
> [ Camel Thread 2 - OnCompletion] FtpPollingRoute                INFO
> onComplete =  false
> [ssword=camel123&username=camel] FtpPollingRoute                INFO
> Fetching  CamelinAction (3).pdf
> [ssword=camel123&username=camel] FtpPollingRoute                INFO
> CamelinAction (3).pdf copied
> [ Camel Thread 3 - OnCompletion] FtpPollingRoute                INFO
> onComplete =  true
> [ Camel Thread 3 - OnCompletion] FtpPollingRoute                INFO
> Stopping
> [ Camel Thread 3 - OnCompletion] DefaultShutdownStrategy        INFO
> Starting to graceful shutdown 1 routes (timeout 300 seconds)
> [ Camel Thread 4 - ShutdownTask] DefaultShutdownStrategy        INFO  Route:
> FtpPollingRoute suspended and shutdown deferred, was consuming from:
> Endpoint[ftp://localhost/inbox?move=done&password=camel123&username=camel]
> [ Camel Thread 4 - ShutdownTask] DefaultShutdownStrategy        INFO
> Waiting as there are still 2 inflight and pending exchanges to complete
> before we can shutdown
> [ Camel Thread 4 - ShutdownTask] DefaultShutdownStrategy        INFO
> Waiting as there are still 1 inflight and pending exchanges to complete
> before we can shutdown
> [ Camel Thread 4 - ShutdownTask] DefaultShutdownStrategy        INFO
> Waiting as there are still 1 inflight and pending exchanges to complete
> before we can shutdown
> [ Camel Thread 4 - ShutdownTask] DefaultShutdownStrategy        INFO
> Waiting as there are still 1 inflight and pending exchanges to complete
> before we can shutdown
> [ Camel Thread 4 - ShutdownTask] DefaultShutdownStrategy        INFO
> Waiting as there are still 1 inflight and pending exchanges to complete
> before we can shutdown
>
> --
> View this message in context: http://old.nabble.com/Route-not-shutting-down-on-shutdownRoute-%281-inflight%29.-tp28740002p28740002.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus