You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Sami Dalouche (JIRA)" <ji...@apache.org> on 2009/05/17 17:01:45 UTC

[jira] Created: (HTTPCLIENT-851) Helper classes for HttpClient : spring-like templates, Gzip interceptor, spring FactoryBean, ...

Helper classes for HttpClient : spring-like templates, Gzip interceptor, spring FactoryBean, ...
------------------------------------------------------------------------------------------------

                 Key: HTTPCLIENT-851
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-851
             Project: HttpComponents HttpClient
          Issue Type: New Feature
    Affects Versions: 4.0 Beta 2
            Reporter: Sami Dalouche


HttpClient API is pretty much low-level, and needs some obscure setup (Registry, ..) to target the common use case (sometimes, you don't care about the low level details, you just
want to fire an http client, and hit a given web resource).

I have extracted some supporting code out of my application in the hope to make it widely available for others. It is available at :
http://www.sirika.com/maven2/releases/com/sirika/httpclienthelpers/com.sirika.httpclienthelpers-assembly/0.1/com.sirika.httpclienthelpers-assembly-0.1-all.zip

It contains :
- HttpClientTemplate that automatically open/close connections in case of exceptions.It also provides a kind of generic http error handling mechanism.
- a spring HttpClientFactoryBean (as well as a helper factory class for httpclient) that allows setting up http client for the common use case 
- an InputStreamSourceBody that can be used to create POST entities that are repeatable, wrapping a spring InputStreamSource
- the code for the GZIP interceptors that are documented as examples on httpclient website. 

The code is still not tested (just extracted that logic from my application), needs some polishing, and a few things like the error handling mechanism still need more thought. But I feel it can be helpful to others.
So, my question is : can we create a kind of -contrib project for httpclient, that allows people to share their helpers with the community ?

the code is currently available under under apache v2 license, but I'm willing to adopt whatever licensing/copyright issues that would help to make this available.

Oh, also, if you want to see the code in action, here's an example of  a REST client that uses it :
http://www.sirika.com/maven2/releases/com/sirika/pymager/pymager-java-client-assembly/0.11/pymager-java-client-assembly-0.11-all.zip
(which is another project born out of extracted code from my application, that I'm trying to push as open source ; I just lack time to handle the community / website / etc issues).

Sami Dalouche

-- 
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@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-851) Helper classes for HttpClient : spring-like templates, Gzip interceptor, spring FactoryBean, ...

Posted by "Sami Dalouche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710369#action_12710369 ] 

Sami Dalouche commented on HTTPCLIENT-851:
------------------------------------------

The BasicResponseHandler interface is not exactly what I'm looking for. I need something :
- on which I can plug my own exception handling/mapping (some errorrs might be globally handled, while some might be request-specific, and this only allows)
- that allows streaming the result. This collects everything as one-big-stream.

However, I might be able to reuse the ResponseHandler interface, so I can integrate my code more idiomatically.

Good news for the GZIP interceptors. Looking forward to having 4.1.0 :)

The extracted code is already re-licensed under Apache v2, (unless I screwed up some header somewhere), what do I need to do in order to submit it to the contrib package ?

Regards,
sami 

> Helper classes for HttpClient : spring-like templates, Gzip interceptor, spring FactoryBean, ...
> ------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-851
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-851
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>    Affects Versions: 4.0 Beta 2
>            Reporter: Sami Dalouche
>
> HttpClient API is pretty much low-level, and needs some obscure setup (Registry, ..) to target the common use case (sometimes, you don't care about the low level details, you just
> want to fire an http client, and hit a given web resource).
> I have extracted some supporting code out of my application in the hope to make it widely available for others. It is available at :
> http://www.sirika.com/maven2/releases/com/sirika/httpclienthelpers/com.sirika.httpclienthelpers-assembly/0.1/com.sirika.httpclienthelpers-assembly-0.1-all.zip
> It contains :
> - HttpClientTemplate that automatically open/close connections in case of exceptions.It also provides a kind of generic http error handling mechanism.
> - a spring HttpClientFactoryBean (as well as a helper factory class for httpclient) that allows setting up http client for the common use case 
> - an InputStreamSourceBody that can be used to create POST entities that are repeatable, wrapping a spring InputStreamSource
> - the code for the GZIP interceptors that are documented as examples on httpclient website. 
> The code is still not tested (just extracted that logic from my application), needs some polishing, and a few things like the error handling mechanism still need more thought. But I feel it can be helpful to others.
> So, my question is : can we create a kind of -contrib project for httpclient, that allows people to share their helpers with the community ?
> the code is currently available under under apache v2 license, but I'm willing to adopt whatever licensing/copyright issues that would help to make this available.
> Oh, also, if you want to see the code in action, here's an example of  a REST client that uses it :
> http://www.sirika.com/maven2/releases/com/sirika/pymager/pymager-java-client-assembly/0.11/pymager-java-client-assembly-0.11-all.zip
> (which is another project born out of extracted code from my application, that I'm trying to push as open source ; I just lack time to handle the community / website / etc issues).
> Sami Dalouche

-- 
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@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Updated: (HTTPCLIENT-851) Helper classes for HttpClient : spring-like templates, Gzip interceptor, spring FactoryBean, ...

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski updated HTTPCLIENT-851:
-----------------------------------------

    Fix Version/s: Future

> Helper classes for HttpClient : spring-like templates, Gzip interceptor, spring FactoryBean, ...
> ------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-851
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-851
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>    Affects Versions: 4.0 Beta 2
>            Reporter: Sami Dalouche
>             Fix For: Future
>
>
> HttpClient API is pretty much low-level, and needs some obscure setup (Registry, ..) to target the common use case (sometimes, you don't care about the low level details, you just
> want to fire an http client, and hit a given web resource).
> I have extracted some supporting code out of my application in the hope to make it widely available for others. It is available at :
> http://www.sirika.com/maven2/releases/com/sirika/httpclienthelpers/com.sirika.httpclienthelpers-assembly/0.1/com.sirika.httpclienthelpers-assembly-0.1-all.zip
> It contains :
> - HttpClientTemplate that automatically open/close connections in case of exceptions.It also provides a kind of generic http error handling mechanism.
> - a spring HttpClientFactoryBean (as well as a helper factory class for httpclient) that allows setting up http client for the common use case 
> - an InputStreamSourceBody that can be used to create POST entities that are repeatable, wrapping a spring InputStreamSource
> - the code for the GZIP interceptors that are documented as examples on httpclient website. 
> The code is still not tested (just extracted that logic from my application), needs some polishing, and a few things like the error handling mechanism still need more thought. But I feel it can be helpful to others.
> So, my question is : can we create a kind of -contrib project for httpclient, that allows people to share their helpers with the community ?
> the code is currently available under under apache v2 license, but I'm willing to adopt whatever licensing/copyright issues that would help to make this available.
> Oh, also, if you want to see the code in action, here's an example of  a REST client that uses it :
> http://www.sirika.com/maven2/releases/com/sirika/pymager/pymager-java-client-assembly/0.11/pymager-java-client-assembly-0.11-all.zip
> (which is another project born out of extracted code from my application, that I'm trying to push as open source ; I just lack time to handle the community / website / etc issues).
> Sami Dalouche

-- 
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@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-851) Helper classes for HttpClient : spring-like templates, Gzip interceptor, spring FactoryBean, ...

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710210#action_12710210 ] 

Oleg Kalnichevski commented on HTTPCLIENT-851:
----------------------------------------------

> HttpClient API is pretty much low-level, and needs some obscure setup (Registry, ..) to target the common use case
>  (sometimes, you don't care about the low level details, you just want to fire an http client, and hit a given web resource). 

Hi Sami

Have you looked at the ResponseHandler interface? In essence it is very much like Spring callback interface while HttpClient acts as a template for that callback.
http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientWithResponseHandler.java

> the code for the GZIP interceptors that are documented as examples on httpclient website

There has been some work done on including transparent content compression into the stock version of HttpClient. Feel free to review the code and contribute whatever bits you find lacking.

https://issues.apache.org/jira/browse/HTTPCLIENT-834

> can we create a kind of -contrib project for httpclient, that allows people to share their helpers with the community ? 

There is already such a contrib package, but all the code in that package is distributed as source only. If that is okay with you, feel free to submit your components for inclusion into that package but you will have to re-license it under Apache License v2.

Oleg



> Helper classes for HttpClient : spring-like templates, Gzip interceptor, spring FactoryBean, ...
> ------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-851
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-851
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>    Affects Versions: 4.0 Beta 2
>            Reporter: Sami Dalouche
>
> HttpClient API is pretty much low-level, and needs some obscure setup (Registry, ..) to target the common use case (sometimes, you don't care about the low level details, you just
> want to fire an http client, and hit a given web resource).
> I have extracted some supporting code out of my application in the hope to make it widely available for others. It is available at :
> http://www.sirika.com/maven2/releases/com/sirika/httpclienthelpers/com.sirika.httpclienthelpers-assembly/0.1/com.sirika.httpclienthelpers-assembly-0.1-all.zip
> It contains :
> - HttpClientTemplate that automatically open/close connections in case of exceptions.It also provides a kind of generic http error handling mechanism.
> - a spring HttpClientFactoryBean (as well as a helper factory class for httpclient) that allows setting up http client for the common use case 
> - an InputStreamSourceBody that can be used to create POST entities that are repeatable, wrapping a spring InputStreamSource
> - the code for the GZIP interceptors that are documented as examples on httpclient website. 
> The code is still not tested (just extracted that logic from my application), needs some polishing, and a few things like the error handling mechanism still need more thought. But I feel it can be helpful to others.
> So, my question is : can we create a kind of -contrib project for httpclient, that allows people to share their helpers with the community ?
> the code is currently available under under apache v2 license, but I'm willing to adopt whatever licensing/copyright issues that would help to make this available.
> Oh, also, if you want to see the code in action, here's an example of  a REST client that uses it :
> http://www.sirika.com/maven2/releases/com/sirika/pymager/pymager-java-client-assembly/0.11/pymager-java-client-assembly-0.11-all.zip
> (which is another project born out of extracted code from my application, that I'm trying to push as open source ; I just lack time to handle the community / website / etc issues).
> Sami Dalouche

-- 
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@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-851) Helper classes for HttpClient : spring-like templates, Gzip interceptor, spring FactoryBean, ...

Posted by "Sami Dalouche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12713471#action_12713471 ] 

Sami Dalouche commented on HTTPCLIENT-851:
------------------------------------------

OK, I will create a patch against contrib's svn trunk.


> Helper classes for HttpClient : spring-like templates, Gzip interceptor, spring FactoryBean, ...
> ------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-851
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-851
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>    Affects Versions: 4.0 Beta 2
>            Reporter: Sami Dalouche
>
> HttpClient API is pretty much low-level, and needs some obscure setup (Registry, ..) to target the common use case (sometimes, you don't care about the low level details, you just
> want to fire an http client, and hit a given web resource).
> I have extracted some supporting code out of my application in the hope to make it widely available for others. It is available at :
> http://www.sirika.com/maven2/releases/com/sirika/httpclienthelpers/com.sirika.httpclienthelpers-assembly/0.1/com.sirika.httpclienthelpers-assembly-0.1-all.zip
> It contains :
> - HttpClientTemplate that automatically open/close connections in case of exceptions.It also provides a kind of generic http error handling mechanism.
> - a spring HttpClientFactoryBean (as well as a helper factory class for httpclient) that allows setting up http client for the common use case 
> - an InputStreamSourceBody that can be used to create POST entities that are repeatable, wrapping a spring InputStreamSource
> - the code for the GZIP interceptors that are documented as examples on httpclient website. 
> The code is still not tested (just extracted that logic from my application), needs some polishing, and a few things like the error handling mechanism still need more thought. But I feel it can be helpful to others.
> So, my question is : can we create a kind of -contrib project for httpclient, that allows people to share their helpers with the community ?
> the code is currently available under under apache v2 license, but I'm willing to adopt whatever licensing/copyright issues that would help to make this available.
> Oh, also, if you want to see the code in action, here's an example of  a REST client that uses it :
> http://www.sirika.com/maven2/releases/com/sirika/pymager/pymager-java-client-assembly/0.11/pymager-java-client-assembly-0.11-all.zip
> (which is another project born out of extracted code from my application, that I'm trying to push as open source ; I just lack time to handle the community / website / etc issues).
> Sami Dalouche

-- 
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@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-851) Helper classes for HttpClient : spring-like templates, Gzip interceptor, spring FactoryBean, ...

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710442#action_12710442 ] 

Oleg Kalnichevski commented on HTTPCLIENT-851:
----------------------------------------------

> what do I need to do in order to submit it to the contrib package ? 

Hi Sami 
The best way to contribute your code is by submitting it as a patch against SVN trunk. If you are familiar with SVN, svn diff command will produce a file in the unified diff format which you could attach to this issue.

Oleg

> Helper classes for HttpClient : spring-like templates, Gzip interceptor, spring FactoryBean, ...
> ------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-851
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-851
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>    Affects Versions: 4.0 Beta 2
>            Reporter: Sami Dalouche
>
> HttpClient API is pretty much low-level, and needs some obscure setup (Registry, ..) to target the common use case (sometimes, you don't care about the low level details, you just
> want to fire an http client, and hit a given web resource).
> I have extracted some supporting code out of my application in the hope to make it widely available for others. It is available at :
> http://www.sirika.com/maven2/releases/com/sirika/httpclienthelpers/com.sirika.httpclienthelpers-assembly/0.1/com.sirika.httpclienthelpers-assembly-0.1-all.zip
> It contains :
> - HttpClientTemplate that automatically open/close connections in case of exceptions.It also provides a kind of generic http error handling mechanism.
> - a spring HttpClientFactoryBean (as well as a helper factory class for httpclient) that allows setting up http client for the common use case 
> - an InputStreamSourceBody that can be used to create POST entities that are repeatable, wrapping a spring InputStreamSource
> - the code for the GZIP interceptors that are documented as examples on httpclient website. 
> The code is still not tested (just extracted that logic from my application), needs some polishing, and a few things like the error handling mechanism still need more thought. But I feel it can be helpful to others.
> So, my question is : can we create a kind of -contrib project for httpclient, that allows people to share their helpers with the community ?
> the code is currently available under under apache v2 license, but I'm willing to adopt whatever licensing/copyright issues that would help to make this available.
> Oh, also, if you want to see the code in action, here's an example of  a REST client that uses it :
> http://www.sirika.com/maven2/releases/com/sirika/pymager/pymager-java-client-assembly/0.11/pymager-java-client-assembly-0.11-all.zip
> (which is another project born out of extracted code from my application, that I'm trying to push as open source ; I just lack time to handle the community / website / etc issues).
> Sami Dalouche

-- 
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@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org