[jira] [Commented] (CAMEL-12642) No support for http4 feature authenticationPreemptive in pollEnrich

2018-07-24 Thread Frank Olschewski (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16553868#comment-16553868
 ] 

Frank Olschewski commented on CAMEL-12642:
--

Thanks a lot for the implementation, I'm looking forward to using the feature.

> 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
> Fix For: 2.23.0
>
>
> authenticationPreemptive=true does not work with pollEnrich.
> {code:java}
> .pollEnrich("https4:localhost?authenticationPreemptive=true" +
>"=user=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)


[jira] [Commented] (CAMEL-12642) No support for http4 feature authenticationPreemptive in pollEnrich

2018-07-23 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16552904#comment-16552904
 ] 

ASF GitHub Bot commented on CAMEL-12642:


oscerd commented on issue #2432: CAMEL-12642:Fix for http4 feature 
authenticationPreemptive in pollEnrich
URL: https://github.com/apache/camel/pull/2432#issuecomment-407067809
 
 
   Thanks, merged on master.


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:
us...@infra.apache.org


> 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
> Fix For: 2.23.0
>
>
> authenticationPreemptive=true does not work with pollEnrich.
> {code:java}
> .pollEnrich("https4:localhost?authenticationPreemptive=true" +
>"=user=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)


[jira] [Commented] (CAMEL-12642) No support for http4 feature authenticationPreemptive in pollEnrich

2018-07-23 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16552902#comment-16552902
 ] 

ASF GitHub Bot commented on CAMEL-12642:


oscerd closed pull request #2432: CAMEL-12642:Fix for http4 feature 
authenticationPreemptive in pollEnrich
URL: https://github.com/apache/camel/pull/2432
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpPollingConsumer.java
 
b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpPollingConsumer.java
index 0020094f03f..2b372c0d4f9 100644
--- 
a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpPollingConsumer.java
+++ 
b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpPollingConsumer.java
@@ -33,6 +33,8 @@
 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;
 
 /**
@@ -43,11 +45,20 @@
 public class HttpPollingConsumer extends PollingConsumerSupport implements 
ServicePoolAware {
 private final HttpEndpoint endpoint;
 private HttpClient httpClient;
-
+private HttpContext httpContext;
+
+
 public HttpPollingConsumer(HttpEndpoint endpoint) {
 super(endpoint);
 this.endpoint = endpoint;
+this.httpContext = endpoint.getHttpContext();
 this.httpClient = endpoint.getHttpClient();
+
+}
+
+@Override
+public HttpEndpoint getEndpoint() {
+return (HttpEndpoint) super.getEndpoint();
 }
 
 public Exchange receive() {
@@ -76,7 +87,7 @@ protected Exchange doReceive(int timeout) {
 HttpEntity responeEntity = null;
 try {
 // execute request
-HttpResponse response = httpClient.execute(method, 
httpClientContext);
+HttpResponse response = executeMethod(method, httpClientContext);
 int responseCode = response.getStatusLine().getStatusCode();
 responeEntity = response.getEntity();
 Object body = 
HttpHelper.readResponseBodyFromInputStream(responeEntity.getContent(), 
exchange);
@@ -117,6 +128,25 @@ protected Exchange doReceive(int timeout) {
 }
 }
 }
+
+/**
+ * Strategy when executing the method (calling the remote server).
+ *
+ * @param httpRequest the http Request to execute
+ * @return the response
+ * @throws IOException can be thrown
+ */
+protected HttpResponse executeMethod(HttpRequestBase httpRequest, 
HttpClientContext httpClientContext) throws IOException {
+   
+if (getEndpoint().isAuthenticationPreemptive()) {
+BasicScheme basicAuth = new BasicScheme();
+httpClientContext.setAttribute("preemptive-auth", basicAuth);
+}
+if (httpContext != null) {
+httpClientContext = new HttpClientContext(httpContext);
+}
+return httpClient.execute(httpRequest, httpClientContext);
+}
 
 // Properties
 //-
diff --git 
a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpPollingConsumerTest.java
 
b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpPollingConsumerTest.java
index 6cda2978119..d257810619c 100644
--- 
a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpPollingConsumerTest.java
+++ 
b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpPollingConsumerTest.java
@@ -33,6 +33,8 @@
 public class HttpPollingConsumerTest extends BaseHttpTest {
 
 private HttpServer localServer;
+private String user = "camel";
+private String password = "password";
 
 @Before
 @Override
@@ -59,6 +61,22 @@ public void tearDown() throws Exception {
 }
 }
 
+@Test
+public void basicAuthenticationShouldSuccess() throws Exception {
+String body = consumer.receiveBody("http4://" + 
localServer.getInetAddress().getHostName() + ":" + localServer.getLocalPort() + 
"/?authUsername=" + user + "=" 
++ password, String.class);
+assertEquals(getExpectedContent(), body); 
+
+}
+
+@Test
+public void basicAuthenticationPreemptiveShouldSuccess() throws Exception {
+
+String body = consumer.receiveBody("http4://" + 
localServer.getInetAddress().getHostName() + ":" + 

[jira] [Commented] (CAMEL-12642) No support for http4 feature authenticationPreemptive in pollEnrich

2018-07-23 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16552903#comment-16552903
 ] 

ASF GitHub Bot commented on CAMEL-12642:


Github user oscerd closed the pull request at:

https://github.com/apache/camel/pull/2432


> 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" +
>"=user=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)


[jira] [Commented] (CAMEL-12642) No support for http4 feature authenticationPreemptive in pollEnrich

2018-07-20 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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:
us...@infra.apache.org


> 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" +
>"=user=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)


[jira] [Commented] (CAMEL-12642) No support for http4 feature authenticationPreemptive in pollEnrich

2018-07-19 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16549476#comment-16549476
 ] 

ASF GitHub Bot commented on CAMEL-12642:


oscerd 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_r203787926
 
 

 ##
 File path: 
components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpPollingConsumer.java
 ##
 @@ -117,6 +129,25 @@ protected Exchange doReceive(int timeout) {
 }
 }
 }
+
+/**
+ * Strategy when executing the method (calling the remote server).
+ *
+ * @param httpRequest the http Request to execute
+ * @return the response
+ * @throws IOException can be thrown
+ */
+protected HttpResponse executeMethod(HttpRequestBase httpRequest, 
HttpClientContext httpClientContext) throws IOException {
+   
+if (getEndpoint().isAuthenticationPreemptive()) {
+BasicScheme basicAuth = new BasicScheme();
+httpClientContext.setAttribute("preemptive-auth", basicAuth);
+}
+if (httpContext != null) {
+httpClientContext = new HttpClientContext(httpContext);
+}
+return httpClient.execute(httpRequest, httpClientContext);
+}
 
 
 Review comment:
   Can you add a test for the consumer?


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:
us...@infra.apache.org


> 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" +
>"=user=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)


[jira] [Commented] (CAMEL-12642) No support for http4 feature authenticationPreemptive in pollEnrich

2018-07-19 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16549413#comment-16549413
 ] 

ASF GitHub Bot commented on CAMEL-12642:


GitHub user ramu11 opened a pull request:

https://github.com/apache/camel/pull/2432

CAMEL-12642:Fix for http4 feature authenticationPreemptive in pollEnrich

CAMEL-12642:Fix for http4 feature authenticationPreemptive in pollEnrich

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/ramu11/camel master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/camel/pull/2432.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2432


commit 7cf0f65dc8aa9bb0712331ca92fe7ca01896d35a
Author: Ramu 
Date:   2018-07-19T15:09:48Z

CAMEL-12642:Fix for http4 feature authenticationPreemptive in pollEnrich




> 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" +
>"=user=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)


[jira] [Commented] (CAMEL-12642) No support for http4 feature authenticationPreemptive in pollEnrich

2018-07-19 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16549412#comment-16549412
 ] 

ASF GitHub Bot commented on CAMEL-12642:


ramu11 opened a new pull request #2432: CAMEL-12642:Fix for http4 feature 
authenticationPreemptive in pollEnrich
URL: https://github.com/apache/camel/pull/2432
 
 
   CAMEL-12642:Fix for http4 feature authenticationPreemptive in pollEnrich


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:
us...@infra.apache.org


> 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" +
>"=user=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)


[jira] [Commented] (CAMEL-12642) No support for http4 feature authenticationPreemptive in pollEnrich

2018-07-19 Thread Claus Ibsen (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16549295#comment-16549295
 ] 

Claus Ibsen commented on CAMEL-12642:
-

Thanks [~ramu11] I have granted your user karma to assign tickets.

> 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" +
>"=user=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)


[jira] [Commented] (CAMEL-12642) No support for http4 feature authenticationPreemptive in pollEnrich

2018-07-19 Thread Ramu (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16549289#comment-16549289
 ] 

Ramu commented on CAMEL-12642:
--

Working

> 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
>Priority: Major
>
> authenticationPreemptive=true does not work with pollEnrich.
> {code:java}
> .pollEnrich("https4:localhost?authenticationPreemptive=true" +
>"=user=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)


[jira] [Commented] (CAMEL-12642) No support for http4 feature authenticationPreemptive in pollEnrich

2018-07-11 Thread Andrea Cosentino (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16540243#comment-16540243
 ] 

Andrea Cosentino commented on CAMEL-12642:
--

There is a message on top of that page and on all the site. We moved the 
official docs in the repository and we are working on a new site. That doc is 
out of date, the official one is in the .adoc page in the component. 

> 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
>Priority: Major
>
> authenticationPreemptive=true does not work with pollEnrich.
> {code:java}
> .pollEnrich("https4:localhost?authenticationPreemptive=true" +
>"=user=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)


[jira] [Commented] (CAMEL-12642) No support for http4 feature authenticationPreemptive in pollEnrich

2018-07-11 Thread Frank Olschewski (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16540158#comment-16540158
 ] 

Frank Olschewski commented on CAMEL-12642:
--

The Information about this limitation is missing at: 
http://camel.apache.org/http4.html

> 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
>Priority: Major
>
> authenticationPreemptive=true does not work with pollEnrich.
> {code:java}
> .pollEnrich("https4:localhost?authenticationPreemptive=true" +
>"=user=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)


[jira] [Commented] (CAMEL-12642) No support for http4 feature authenticationPreemptive in pollEnrich

2018-07-11 Thread Andrea Cosentino (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16540139#comment-16540139
 ] 

Andrea Cosentino commented on CAMEL-12642:
--

AuthenticationPreemptive is an option provided only on the producer side

[https://github.com/apache/camel/blob/master/components/camel-http4/src/main/docs/http4-component.adoc]

So I wouldn't say this is a bug. This is an enhancement.

> 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
>Priority: Major
>
> authenticationPreemptive=true does not work with pollEnrich.
> {code:java}
> .pollEnrich("https4:localhost?authenticationPreemptive=true" +
>"=user=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)