title: Holding Sftp connection open inside camel component and route
body: <p>I've written a Camel (2.10) component to do Sftp as I needed a bit more control over the connection than the out of the box component offers.</p>
  
  <p>I have route that looks something like this:</p>
  
  <pre><code>from("direct:start")
      .to(startProcessor())       //1. Start processor sets the connection parameters for myCustomSftpComp producer
      .to("myCustomSftpComp")     //2. Uses Jsch, connects to server, gets the file, add to exchange, closes connection
      .to(somePostProcessor())    //3. Does something with the file
      .to("file://....");         //4. Write the file
  </code></pre>
  
  <p>This all works perfectly well.</p>
  
  <p>My problem is at step 2, at the moment my files are quite small and I buffer them into memory, add the byte array to the Exchange body and its passed along and processed until it gets written by the file endpoint.</p>
  
  <p>Of course this wont be sustainable with a large file, I need to add the InputStream reference to the exchange instead. My problem is I close and clean up the connection to the server inside myCustomSftpComp so when the exchange gets to post processor and file endpoint, it can no longer be accessed. </p>
  
  <p>So basically I need some way to keep the connection open until after the file is written and closing the server connection inside the component from the route definition, sounds untidy so I'm open to atlernative ways of doing this. </p>