SFTP: disconnect on route-suspend

2013-06-25 Thread mdo
Hello,

I have some routes with SFTP endpoints on consumer and producer side. I
trigger these routes via quartz and suspend them after work is done. The
endpoints keep the SFTP connections open in this case.

I want the SFTP connections to be shut down (close the network connections)
when I suspend the routes. JSCH shall re-login when I restart the routes, I
don't want to keep connections open.

How can I achieve this?

Thanks, mdo.





--
View this message in context: 
http://camel.465427.n5.nabble.com/SFTP-disconnect-on-route-suspend-tp5734742.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: SFTP: disconnect on route-suspend

2013-06-25 Thread Claus Ibsen
Use stop instead of suspend.

On Tue, Jun 25, 2013 at 4:18 PM, mdo manfred.doh...@gmail.com wrote:
 Hello,

 I have some routes with SFTP endpoints on consumer and producer side. I
 trigger these routes via quartz and suspend them after work is done. The
 endpoints keep the SFTP connections open in this case.

 I want the SFTP connections to be shut down (close the network connections)
 when I suspend the routes. JSCH shall re-login when I restart the routes, I
 don't want to keep connections open.

 How can I achieve this?

 Thanks, mdo.





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/SFTP-disconnect-on-route-suspend-tp5734742.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: SFTP: disconnect on route-suspend

2013-06-25 Thread mdo
Claus Ibsen-2 wrote
 Use stop instead of suspend.

I know that stopping the route does shut down the endpoints. But we changed
to suspend/resume a month ago because we noticed that stop/restart leaks
threads in GlassFish. If I did stop the route I would have to remove and
recreate it each time Quartz fires. This would also knock down my whole
approach of initially setting up routes on application startup.

At the moment I'm looking into endpoint options, something like:
serverAliveInterval 900
serverAliveCountMax 0

This idea was inspired by http://serverfault.com/a/450916

But this doesn't seem to work neither. JSCH goes nuts and disconnects right
before logging in and SSH_MSG_KEXDH_INIT sent should get logged.

Regards, mdo.





--
View this message in context: 
http://camel.465427.n5.nabble.com/SFTP-disconnect-on-route-suspend-tp5734742p5734744.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: SFTP: disconnect on route-suspend

2013-06-25 Thread Chris Wolf
Our project has similar requirements - in addition to parameterizing
the SFTP connection at runtime, not
just at route declaration-time.  I was led to believe that, generally,
consumers can't be parameterized at
runtime, so I made a few attempts at creating my own custom  component
to do SFTP with parameters
passed in at runtime, triggered by Quartz cron trigger.  This worked,
but didn't get automatically
wrapped in JMX wrappers, plus other clunky issues.

I ended up having the quartz/cron trigger send the parameters to a
custom processor which
creates a route at runtime, starting with an SFTP consumer - plus a
background thread that
defines the poll time duration, after which, the thread stops the
route, then removes it.

This all works for us now, including multiple, concurrent connections
(well, only two simultaneous
tested so far)

You might want to try an approach like that.

On Tue, Jun 25, 2013 at 11:21 AM, mdo manfred.doh...@gmail.com wrote:
 Claus Ibsen-2 wrote
 Use stop instead of suspend.

 I know that stopping the route does shut down the endpoints. But we changed
 to suspend/resume a month ago because we noticed that stop/restart leaks
 threads in GlassFish. If I did stop the route I would have to remove and
 recreate it each time Quartz fires. This would also knock down my whole
 approach of initially setting up routes on application startup.

 At the moment I'm looking into endpoint options, something like:
 serverAliveInterval 900
 serverAliveCountMax 0

 This idea was inspired by http://serverfault.com/a/450916

 But this doesn't seem to work neither. JSCH goes nuts and disconnects right
 before logging in and SSH_MSG_KEXDH_INIT sent should get logged.

 Regards, mdo.





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/SFTP-disconnect-on-route-suspend-tp5734742p5734744.html
 Sent from the Camel - Users mailing list archive at Nabble.com.