[jira] Created: (HTTPCLIENT-854) RFE: Provide mechanism to allow request transmission and response reception to be performed independently

View: New views
8 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

[jira] Commented: (HTTPCLIENT-854) RFE: Provide mechanism to allow request transmission and response reception to be performed independently

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/HTTPCLIENT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722875#action_12722875 ]

Oleg Kalnichevski commented on HTTPCLIENT-854:
----------------------------------------------

Sam

The biggest problem with HttpClient 3.x has been the tendency to add features at the expense of design. I personally would not like the same to happen to HttpClient 4.x.

Let's face a very simple fact: we do not have enough people to maintain HttpClient even with its current feature set. Adding more features without adding more people to the project willing to maintain the code hardly helps. The _only_ reason why I have not started working on asynchronous version of HttpClient is because it do not want to end up the only person maintaining it.

Code duplication can be as bad as abuse of inheritance. By all of means feel free to refactor DefaultRequestDirector, but I suspect that adding more functionality to it will not make it any simpler. I see code duplication as a lesser evil in this particular case.

Oleg

> RFE: Provide mechanism to allow request transmission and response reception to be performed independently
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-854
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-854
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.0 Final
>         Environment: All
>            Reporter: Mike Cumings
>            Priority: Minor
>             Fix For: Future
>
>         Attachments: HTTPCLIENT-854_httpclient_2009-06-18_1.patch, HTTPCLIENT-854_httpclient_2009-06-19_1.patch, HTTPCLIENT-854_httpcore_2009-06-18_1.patch, HTTPCLIENT-854_httpcore_2009-06-19_1.patch
>
>
> The HttpClient API currently provides for the execution of a request via the HttpClient.execute(...) methods.  These methods all send the request and then block until the response has been received.  This precludes the user of the API from being able to send the request, perform some additional work, then come back and block on the request.  This style of processing is very desirable for implementation of HTTP-based protocols such as Bidirectional-streams Over Synchronous HTTP (BOSH).   This capability is also closely related to HTTPCLIENT-258, support for HTTP 1.1 pipelining.
> The current code base (4.0) currently utilizes org.apache.http.impl.client.DefaultRequestDirector.execute(...) to transmit requests.  This method contains a retry loop which blocks on and then examines the response from the remote server.  When success is detected, it cleans up and returns the response instance.  Requests are sent using an HttpResponseExecutor instance.  These classes support the ability to separately doSendRequest()  and doReceiveResponse().
> Please expose the ability to leverage this functionality outwith the retry loop but including the existing routing and authorization capabilities, where possible.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Commented: (HTTPCLIENT-854) RFE: Provide mechanism to allow request transmission and response reception to be performed independently

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/HTTPCLIENT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12723009#action_12723009 ]

Oleg Kalnichevski commented on HTTPCLIENT-854:
----------------------------------------------

Mike, Sam

A very simple solution to this issue involving no code duplication at all would be a callback interface

interface AfterRequestBeforeResponse {
  void doSomeImportantStuff(HttpRequest request, HttpContext context);
}

An implementation of that interface could be injected into DefaultHttpClient using a setter and passed to the DefaultRequestDirector as a constructor parameter.

Oleg

> RFE: Provide mechanism to allow request transmission and response reception to be performed independently
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-854
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-854
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.0 Final
>         Environment: All
>            Reporter: Mike Cumings
>            Priority: Minor
>             Fix For: Future
>
>         Attachments: HTTPCLIENT-854_httpclient_2009-06-18_1.patch, HTTPCLIENT-854_httpclient_2009-06-19_1.patch, HTTPCLIENT-854_httpcore_2009-06-18_1.patch, HTTPCLIENT-854_httpcore_2009-06-19_1.patch
>
>
> The HttpClient API currently provides for the execution of a request via the HttpClient.execute(...) methods.  These methods all send the request and then block until the response has been received.  This precludes the user of the API from being able to send the request, perform some additional work, then come back and block on the request.  This style of processing is very desirable for implementation of HTTP-based protocols such as Bidirectional-streams Over Synchronous HTTP (BOSH).   This capability is also closely related to HTTPCLIENT-258, support for HTTP 1.1 pipelining.
> The current code base (4.0) currently utilizes org.apache.http.impl.client.DefaultRequestDirector.execute(...) to transmit requests.  This method contains a retry loop which blocks on and then examines the response from the remote server.  When success is detected, it cleans up and returns the response instance.  Requests are sent using an HttpResponseExecutor instance.  These classes support the ability to separately doSendRequest()  and doReceiveResponse().
> Please expose the ability to leverage this functionality outwith the retry loop but including the existing routing and authorization capabilities, where possible.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Commented: (HTTPCLIENT-854) RFE: Provide mechanism to allow request transmission and response reception to be performed independently

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/HTTPCLIENT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12723146#action_12723146 ]

Mike Cumings commented on HTTPCLIENT-854:
-----------------------------------------

Oleg, that wouldn't work for my use case since it wouldn't allow for the response to be processed by another thread.  Example:

0: sendRequest
0: enqueue deferred response
0: return
1: sendRequest
1: enqueue deferred response
1: return
2: pop deferred response
2: block until response received
2: process response
2: pop deferred response
2: block until response received
2: process response
...

This is critical for the following two interrelated reasons:
o It allows a single thread to be used for response processing
o It allows the sender to guarantee that the message has been sent before execution returns to the caller

Mike

> RFE: Provide mechanism to allow request transmission and response reception to be performed independently
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-854
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-854
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.0 Final
>         Environment: All
>            Reporter: Mike Cumings
>            Priority: Minor
>             Fix For: Future
>
>         Attachments: HTTPCLIENT-854_httpclient_2009-06-18_1.patch, HTTPCLIENT-854_httpclient_2009-06-19_1.patch, HTTPCLIENT-854_httpcore_2009-06-18_1.patch, HTTPCLIENT-854_httpcore_2009-06-19_1.patch
>
>
> The HttpClient API currently provides for the execution of a request via the HttpClient.execute(...) methods.  These methods all send the request and then block until the response has been received.  This precludes the user of the API from being able to send the request, perform some additional work, then come back and block on the request.  This style of processing is very desirable for implementation of HTTP-based protocols such as Bidirectional-streams Over Synchronous HTTP (BOSH).   This capability is also closely related to HTTPCLIENT-258, support for HTTP 1.1 pipelining.
> The current code base (4.0) currently utilizes org.apache.http.impl.client.DefaultRequestDirector.execute(...) to transmit requests.  This method contains a retry loop which blocks on and then examines the response from the remote server.  When success is detected, it cleans up and returns the response instance.  Requests are sent using an HttpResponseExecutor instance.  These classes support the ability to separately doSendRequest()  and doReceiveResponse().
> Please expose the ability to leverage this functionality outwith the retry loop but including the existing routing and authorization capabilities, where possible.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Commented: (HTTPCLIENT-854) RFE: Provide mechanism to allow request transmission and response reception to be performed independently

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/HTTPCLIENT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12723228#action_12723228 ]

Oleg Kalnichevski commented on HTTPCLIENT-854:
----------------------------------------------

Mike,

This scenario actually is another reason why DefaultRequestDirector ought not to be used for deferred execution. HttpResponse and HttpClientConnection are not thread safe. Neither is DefaultRequestDirector. It makes no attempts to ensure only one thread has access to the HttpResponse object and the underlying response stream.

Oleg

> RFE: Provide mechanism to allow request transmission and response reception to be performed independently
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-854
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-854
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.0 Final
>         Environment: All
>            Reporter: Mike Cumings
>            Priority: Minor
>             Fix For: Future
>
>         Attachments: HTTPCLIENT-854_httpclient_2009-06-18_1.patch, HTTPCLIENT-854_httpclient_2009-06-19_1.patch, HTTPCLIENT-854_httpcore_2009-06-18_1.patch, HTTPCLIENT-854_httpcore_2009-06-19_1.patch
>
>
> The HttpClient API currently provides for the execution of a request via the HttpClient.execute(...) methods.  These methods all send the request and then block until the response has been received.  This precludes the user of the API from being able to send the request, perform some additional work, then come back and block on the request.  This style of processing is very desirable for implementation of HTTP-based protocols such as Bidirectional-streams Over Synchronous HTTP (BOSH).   This capability is also closely related to HTTPCLIENT-258, support for HTTP 1.1 pipelining.
> The current code base (4.0) currently utilizes org.apache.http.impl.client.DefaultRequestDirector.execute(...) to transmit requests.  This method contains a retry loop which blocks on and then examines the response from the remote server.  When success is detected, it cleans up and returns the response instance.  Requests are sent using an HttpResponseExecutor instance.  These classes support the ability to separately doSendRequest()  and doReceiveResponse().
> Please expose the ability to leverage this functionality outwith the retry loop but including the existing routing and authorization capabilities, where possible.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Commented: (HTTPCLIENT-854) RFE: Provide mechanism to allow request transmission and response reception to be performed independently

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/HTTPCLIENT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12723295#action_12723295 ]

Mike Cumings commented on HTTPCLIENT-854:
-----------------------------------------

I noticed that.  In my use case it ends up working out just fine though, since it is a thread hand-off, not two threads working concurrently against the same object instances.

Mike

> RFE: Provide mechanism to allow request transmission and response reception to be performed independently
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-854
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-854
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.0 Final
>         Environment: All
>            Reporter: Mike Cumings
>            Priority: Minor
>             Fix For: Future
>
>         Attachments: HTTPCLIENT-854_httpclient_2009-06-18_1.patch, HTTPCLIENT-854_httpclient_2009-06-19_1.patch, HTTPCLIENT-854_httpcore_2009-06-18_1.patch, HTTPCLIENT-854_httpcore_2009-06-19_1.patch
>
>
> The HttpClient API currently provides for the execution of a request via the HttpClient.execute(...) methods.  These methods all send the request and then block until the response has been received.  This precludes the user of the API from being able to send the request, perform some additional work, then come back and block on the request.  This style of processing is very desirable for implementation of HTTP-based protocols such as Bidirectional-streams Over Synchronous HTTP (BOSH).   This capability is also closely related to HTTPCLIENT-258, support for HTTP 1.1 pipelining.
> The current code base (4.0) currently utilizes org.apache.http.impl.client.DefaultRequestDirector.execute(...) to transmit requests.  This method contains a retry loop which blocks on and then examines the response from the remote server.  When success is detected, it cleans up and returns the response instance.  Requests are sent using an HttpResponseExecutor instance.  These classes support the ability to separately doSendRequest()  and doReceiveResponse().
> Please expose the ability to leverage this functionality outwith the retry loop but including the existing routing and authorization capabilities, where possible.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Commented: (HTTPCLIENT-854) RFE: Provide mechanism to allow request transmission and response reception to be performed independently

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/HTTPCLIENT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12723338#action_12723338 ]

Ortwin Glück commented on HTTPCLIENT-854:
-----------------------------------------

Mike, even then there are no visbility guarantees between these threads. The fact that "it works" for you doesn't mean it will always work on every platform.

> RFE: Provide mechanism to allow request transmission and response reception to be performed independently
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-854
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-854
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.0 Final
>         Environment: All
>            Reporter: Mike Cumings
>            Priority: Minor
>             Fix For: Future
>
>         Attachments: HTTPCLIENT-854_httpclient_2009-06-18_1.patch, HTTPCLIENT-854_httpclient_2009-06-19_1.patch, HTTPCLIENT-854_httpcore_2009-06-18_1.patch, HTTPCLIENT-854_httpcore_2009-06-19_1.patch
>
>
> The HttpClient API currently provides for the execution of a request via the HttpClient.execute(...) methods.  These methods all send the request and then block until the response has been received.  This precludes the user of the API from being able to send the request, perform some additional work, then come back and block on the request.  This style of processing is very desirable for implementation of HTTP-based protocols such as Bidirectional-streams Over Synchronous HTTP (BOSH).   This capability is also closely related to HTTPCLIENT-258, support for HTTP 1.1 pipelining.
> The current code base (4.0) currently utilizes org.apache.http.impl.client.DefaultRequestDirector.execute(...) to transmit requests.  This method contains a retry loop which blocks on and then examines the response from the remote server.  When success is detected, it cleans up and returns the response instance.  Requests are sent using an HttpResponseExecutor instance.  These classes support the ability to separately doSendRequest()  and doReceiveResponse().
> Please expose the ability to leverage this functionality outwith the retry loop but including the existing routing and authorization capabilities, where possible.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Commented: (HTTPCLIENT-854) RFE: Provide mechanism to allow request transmission and response reception to be performed independently

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/HTTPCLIENT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12723428#action_12723428 ]

Mike Cumings commented on HTTPCLIENT-854:
-----------------------------------------

You're right, Ortwin.  I wasn't taking the memory model into account.  So this issue should probably get back-burnered until httpclient becomes more generally threadsafe.  I'll just have to live with the extra overhead for the time being.

Mike

> RFE: Provide mechanism to allow request transmission and response reception to be performed independently
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-854
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-854
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.0 Final
>         Environment: All
>            Reporter: Mike Cumings
>            Priority: Minor
>             Fix For: Future
>
>         Attachments: HTTPCLIENT-854_httpclient_2009-06-18_1.patch, HTTPCLIENT-854_httpclient_2009-06-19_1.patch, HTTPCLIENT-854_httpcore_2009-06-18_1.patch, HTTPCLIENT-854_httpcore_2009-06-19_1.patch
>
>
> The HttpClient API currently provides for the execution of a request via the HttpClient.execute(...) methods.  These methods all send the request and then block until the response has been received.  This precludes the user of the API from being able to send the request, perform some additional work, then come back and block on the request.  This style of processing is very desirable for implementation of HTTP-based protocols such as Bidirectional-streams Over Synchronous HTTP (BOSH).   This capability is also closely related to HTTPCLIENT-258, support for HTTP 1.1 pipelining.
> The current code base (4.0) currently utilizes org.apache.http.impl.client.DefaultRequestDirector.execute(...) to transmit requests.  This method contains a retry loop which blocks on and then examines the response from the remote server.  When success is detected, it cleans up and returns the response instance.  Requests are sent using an HttpResponseExecutor instance.  These classes support the ability to separately doSendRequest()  and doReceiveResponse().
> Please expose the ability to leverage this functionality outwith the retry loop but including the existing routing and authorization capabilities, where possible.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Commented: (HTTPCLIENT-854) RFE: Provide mechanism to allow request transmission and response reception to be performed independently

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/HTTPCLIENT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12723556#action_12723556 ]

Oleg Kalnichevski commented on HTTPCLIENT-854:
----------------------------------------------

> So this issue should probably get back-burnered until httpclient becomes more generally threadsafe

Here we back to the square one. HttpClient will not become "more generally threadsafe" unless someone steps up and develops a implementation optimized for deferred / asynchronous HTTP request execution. DefaultHttpClient is perfectly thread safe when used as designed.  

Oleg

> RFE: Provide mechanism to allow request transmission and response reception to be performed independently
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-854
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-854
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.0 Final
>         Environment: All
>            Reporter: Mike Cumings
>            Priority: Minor
>             Fix For: Future
>
>         Attachments: HTTPCLIENT-854_httpclient_2009-06-18_1.patch, HTTPCLIENT-854_httpclient_2009-06-19_1.patch, HTTPCLIENT-854_httpcore_2009-06-18_1.patch, HTTPCLIENT-854_httpcore_2009-06-19_1.patch
>
>
> The HttpClient API currently provides for the execution of a request via the HttpClient.execute(...) methods.  These methods all send the request and then block until the response has been received.  This precludes the user of the API from being able to send the request, perform some additional work, then come back and block on the request.  This style of processing is very desirable for implementation of HTTP-based protocols such as Bidirectional-streams Over Synchronous HTTP (BOSH).   This capability is also closely related to HTTPCLIENT-258, support for HTTP 1.1 pipelining.
> The current code base (4.0) currently utilizes org.apache.http.impl.client.DefaultRequestDirector.execute(...) to transmit requests.  This method contains a retry loop which blocks on and then examines the response from the remote server.  When success is detected, it cleans up and returns the response instance.  Requests are sent using an HttpResponseExecutor instance.  These classes support the ability to separately doSendRequest()  and doReceiveResponse().
> Please expose the ability to leverage this functionality outwith the retry loop but including the existing routing and authorization capabilities, where possible.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...

< Prev | 1 - 2 | Next >