You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by mluckam <Ma...@solers.com> on 2016/03/29 15:42:54 UTC

Allow httpClient.XXX configuration to be applied to custom HttpClient

For the Jetty component, if a httpClient is specified via the uri, then the
httpClient.XXX uri configuration can not be applied to that httpClient.  Is
there a reason this is not allowed?  If not my suggestion is to allow this
behavior for greater flexibility.  I have attached a patch with the
suggested change.

custom_client_uri_params.patch
<http://camel.465427.n5.nabble.com/file/n5779966/custom_client_uri_params.patch>  



--
View this message in context: http://camel.465427.n5.nabble.com/Allow-httpClient-XXX-configuration-to-be-applied-to-custom-HttpClient-tp5779966.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Allow httpClient.XXX configuration to be applied to custom HttpClient

Posted by mluckam <Ma...@solers.com>.
Is there a reason for such strict either or approach?  Possibly because it
provides two ways to achieve the same goal?

The reason I ask is because my situation is one in which the HttpClient is
customized to remove the Accept-Encoding: gzip header added to all requests
because the decoderFactories member set contains the GZIPContentDecoder
Factory.  This customization cannot be achieved by using the uri parameters. 
A new instance of this custom HttpClient is instantiated in multiple routes,
and each instance may want to have its own configurations. Also
HttpClient.XXX configurations can be passed in by users at runtime, where
the custom HttpClient is a bean that is not modifiable by the user. 
Possibly other users have a similar situation in which it would be
preferable to have a baselined custom instance of the HttpClient that
accepts HttpClient.XXX configurations.

Alternatively if the decoderFactories member was configurable via the Jetty
HttpClient or the CamelHttpClient or the CamelHttpClient9 this would not be
necessary.  Unfortunately the Jetty HttpClient is part of the Jetty project
not Camel, and the CamelHttpClient and therefore the CamelHttpClient9 extend
the Jetty 8 HttpClient where this is not applicable.

Any thoughts on this issue would be appreciated.




--
View this message in context: http://camel.465427.n5.nabble.com/Allow-httpClient-XXX-configuration-to-be-applied-to-custom-HttpClient-tp5779966p5780109.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Allow httpClient.XXX configuration to be applied to custom HttpClient

Posted by Claus Ibsen <cl...@gmail.com>.
Yes its either or.

You provide a pre configured http client that you have already
configured as you want it.
Or you do not, and use the httpClient.xxx to configure it in the uri.



On Tue, Mar 29, 2016 at 3:42 PM, mluckam <Ma...@solers.com> wrote:
> For the Jetty component, if a httpClient is specified via the uri, then the
> httpClient.XXX uri configuration can not be applied to that httpClient.  Is
> there a reason this is not allowed?  If not my suggestion is to allow this
> behavior for greater flexibility.  I have attached a patch with the
> suggested change.
>
> custom_client_uri_params.patch
> <http://camel.465427.n5.nabble.com/file/n5779966/custom_client_uri_params.patch>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Allow-httpClient-XXX-configuration-to-be-applied-to-custom-HttpClient-tp5779966.html
> Sent from the Camel Development mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2