[
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16551026#comment-16551026
]
ASF GitHub Bot commented on CAMEL-12642:
----------------------------------------
onderson commented on a change in pull request #2432: CAMEL-12642:Fix for http4
feature authenticationPreemptive in pollEnrich
URL: https://github.com/apache/camel/pull/2432#discussion_r204117717
##########
File path:
components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpPollingConsumer.java
##########
@@ -33,21 +33,33 @@
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.client.protocol.HttpClientContext;
+import org.apache.http.impl.auth.BasicScheme;
+import org.apache.http.protocol.HttpContext;
import org.apache.http.util.EntityUtils;
/**
* A polling HTTP consumer which by default performs a GET
*
* @version
*/
+@SuppressWarnings("deprecation")
Review comment:
I would not prefer supressing deprecation. Especially while we have java's 6
month release cycle..
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> No support for http4 feature authenticationPreemptive in pollEnrich
> -------------------------------------------------------------------
>
> Key: CAMEL-12642
> URL: https://issues.apache.org/jira/browse/CAMEL-12642
> Project: Camel
> Issue Type: New Feature
> Components: camel-http4
> Affects Versions: 2.23.0
> Reporter: Frank Olschewski
> Assignee: Ramu
> Priority: Major
>
> authenticationPreemptive=true does not work with pollEnrich.
> {code:java}
> .pollEnrich("https4:localhost?authenticationPreemptive=true" +
> "&authUsername=user&authPassword=passwd"){code}
> In Class /org/apache/camel/component/http4/HttpPollingConsumer.java:79 you
> see the following code:
> {code:java}
> HttpResponse response = httpClient.execute(method, httpClientContext);{code}
> The setup for authenticationPreemptive is missing.
> You can see what to do in
> org.apache.camel.component.http4.HttpProducer#executeMethod:
> {code:java}
> pprotected HttpResponse executeMethod(HttpUriRequest httpRequest) throws
> IOException {
> HttpContext localContext = new BasicHttpContext();
> if (getEndpoint().isAuthenticationPreemptive()) {
> BasicScheme basicAuth = new BasicScheme();
> localContext.setAttribute("preemptive-auth", basicAuth);
> }
> if (httpContext != null) {
> localContext = new BasicHttpContext(httpContext);
> }
> return httpClient.execute(httpRequest, localContext);
> }{code}
> In org.apache.camel.component.http4.HttpPollingConsumer#doReceive
> getEndpoint().isAuthenticationPreemptive() returns the correct value, so
> there is nothing against implementing this feature here as well.
> The problem behind the scene ist that the context attribute "preemptive-auth"
> is missing.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)