You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by huntc <hu...@mac.com> on 2009/06/17 12:12:46 UTC

Continuations and direct components

Hi there,

Given the following code:


from("jetty:http://0.0.0.0:9000/myurl")
    .inOut("direct:getSomething");


Will a jetty continuation become suspended and thus release its thread while
"direct:getSomething" does its work, and then become active once
"direct:getSomething" replies?

I'm hoping that the above will permit thousands of connections while
consuming a minimal number of threads.

Thanks for any confirmations.

Kind regards,
Christopher
-- 
View this message in context: http://www.nabble.com/Continuations-and-direct-components-tp24070560p24070560.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.

Re: Continuations and direct components

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

Snce the connection is an HTTP connection, the connectionObject will be
preserved even though the thread is released. So long as the
connectionObject is available, it will be reused to send a message in the
reverse direction. The HTTP connectionTimeout will dictate whether the
connection can be reused or not.

The Thread does not have to be locked up waiting for the next part of the
route to release it upon receiving a response. That would be way too
expensive.

Cheers,

Ashwin...


huntc wrote:
> 
> Hi there,
> 
> <p>Given the following code:
> 
> <pre>
> from("jetty:http://0.0.0.0:9000/myurl")
>     .inOut("direct:getSomething");
> </pre>
> 
> Will a jetty continuation become suspended and thus release its thread
> while "direct:getSomething" does its work, and then become active once
> "direct:getSomething" replies?
> 
> <p>I'm hoping that the above will permit thousands of connections while
> consuming a minimal number of threads.
> 
> <p>Thanks for any confirmations.
> 
> <p>Kind regards,
> <br />Christopher
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/Continuations-and-direct-components-tp24070560p24074379.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: Continuations and direct components

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

Snce the connection is an HTTP connection, the connectionObject will be
preserved even though the thread is released. So long as the
connectionObject is available, it will be reused to send a message in the
reverse direction. The HTTP connectionTimeout will dictate whether the
connection can be reused or not.

The Thread does not have to be locked up waiting for the next part of the
route to release it upon receiving a response. That would be way too
expensive.

Cheers,

Ashwin...


huntc wrote:
> 
> Hi there,
> 
> <p>Given the following code:
> 
> <pre>
> from("jetty:http://0.0.0.0:9000/myurl")
>     .inOut("direct:getSomething");
> </pre>
> 
> Will a jetty continuation become suspended and thus release its thread
> while "direct:getSomething" does its work, and then become active once
> "direct:getSomething" replies?
> 
> <p>I'm hoping that the above will permit thousands of connections while
> consuming a minimal number of threads.
> 
> <p>Thanks for any confirmations.
> 
> <p>Kind regards,
> <br />Christopher
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/Continuations-and-direct-components-tp24070560p24074390.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.