Continuations and direct components

View: New views
3 Messages — Rating Filter:   Alert me  

Continuations and direct components

by huntc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


Re: Continuations and direct components

by Ashwin Karpe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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/


Re: Continuations and direct components

by Ashwin Karpe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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/