Hi,

Current HttpProducer holds the HttpClient as the HttpProducer can be used in 
multiple thread, it is not safe to change the Credential per exchange 
processing.
For you case, you need to create the HttpClient per exchange. You may need to 
override the process method of HttpProducer.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 28, 2015 at 7:24:33 PM, richardgroote ([email protected]) 
wrote:
> Good day,
>  
> When using the HTTP(3) component of Apache Camel it is possible to define a
> HttpClientConfigurer to add additional authentication / security. The
> HttpClientConfigurer is used when the http client is created.
>  
> In our case we'd like to add a kerberos ticket when the http method is
> called. Therefore we do not know the credentials when the camel
> configuration (spring config) is loaded / created. So just before the http
> call is made the credentials should be set on the http client.
>  
> I've tried the HttpClientConfigurer but this one is created when the
> HttpProducer is created and at that time i do not know the credentials.
>  
> When the HttpProducer#process is called i know the credentials and can add
> them to the client. A possible solution is to override HttpComponent,
> HttpEndpoint and HttpProducer but i hope that is a better solution for it.
>  
> Does anyone have a better solution to add credentials to the httpclient just
> before the http method is executed?
>  
> KInd regards,
>  
> Richard
>  
>  
>  
>  
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Http-3-Component-and-Credential-delegation-tp5762175.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  

Reply via email to