You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2015/03/09 11:39:23 UTC
[01/19] camel git commit: Fixed builder order in root pom to build
tooling before platform which must happen in that order
Repository: camel
Updated Branches:
refs/heads/camel-2.14.x e1d9b5c83 -> 66c49f47b
refs/heads/camel-2.15.x 970ca3b04 -> 03d6ac768
Fixed builder order in root pom to build tooling before platform which must happen in that order
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6c61a242
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6c61a242
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6c61a242
Branch: refs/heads/camel-2.15.x
Commit: 6c61a242b2b08d5d4de1d703af11be4fb876a086
Parents: 970ca3b
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Mar 8 08:22:01 2015 +0100
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 09:22:58 2015 +0800
----------------------------------------------------------------------
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/6c61a242/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 869a3d7..4c0e26e 100755
--- a/pom.xml
+++ b/pom.xml
@@ -121,14 +121,14 @@
<modules>
<module>parent</module>
+ <module>etc</module>
<module>buildingtools</module>
<module>camel-core</module>
<module>components</module>
- <module>platforms</module>
<module>tooling</module>
+ <module>platforms</module>
<module>tests</module>
<module>examples</module>
- <module>etc</module>
</modules>
<scm>
[13/19] camel git commit: CAMEL-8461 Fixed the issue that
camel-netty-http does not respect client's keep-alive setting
Posted by ni...@apache.org.
CAMEL-8461 Fixed the issue that camel-netty-http does not respect client's keep-alive setting
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/48653d33
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/48653d33
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/48653d33
Branch: refs/heads/camel-2.14.x
Commit: 48653d33f3ace8b509624598f02743ebbdc60704
Parents: 92182c3
Author: Willem Jiang <wi...@gmail.com>
Authored: Mon Mar 9 18:07:53 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:38:15 2015 +0800
----------------------------------------------------------------------
.../netty/http/DefaultNettyHttpBinding.java | 5 +++-
.../http/handlers/HttpServerChannelHandler.java | 13 +++++++++--
.../http/NettyHttpProducerKeepAliveTest.java | 24 +++++++++++++++++---
3 files changed, 36 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/48653d33/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
index 102fb91..85395b8 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
@@ -403,6 +403,10 @@ public class DefaultNettyHttpBinding implements NettyHttpBinding, Cloneable {
// configure connection to accordingly to keep alive configuration
// favor using the header from the message
String connection = message.getHeader(HttpHeaders.Names.CONNECTION, String.class);
+ // Read the connection header from the exchange property
+ if (connection == null) {
+ connection = message.getExchange().getProperty(HttpHeaders.Names.CONNECTION, String.class);
+ }
if (connection == null) {
// fallback and use the keep alive from the configuration
if (configuration.isKeepAlive()) {
@@ -531,7 +535,6 @@ public class DefaultNettyHttpBinding implements NettyHttpBinding, Cloneable {
}
request.headers().set(HttpHeaders.Names.CONNECTION, connection);
LOG.trace("Connection: {}", connection);
-
return request;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/48653d33/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
index e30ee27..4888b8c 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
@@ -44,9 +44,9 @@ import org.jboss.netty.handler.codec.http.DefaultHttpResponse;
import org.jboss.netty.handler.codec.http.HttpHeaders;
import org.jboss.netty.handler.codec.http.HttpRequest;
import org.jboss.netty.handler.codec.http.HttpResponse;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import static org.jboss.netty.handler.codec.http.HttpResponseStatus.BAD_REQUEST;
import static org.jboss.netty.handler.codec.http.HttpResponseStatus.METHOD_NOT_ALLOWED;
import static org.jboss.netty.handler.codec.http.HttpResponseStatus.OK;
@@ -209,9 +209,11 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
}
}
}
-
+
// let Camel process this message
+ // It did the way as camel-netty component does
super.messageReceived(ctx, messageEvent);
+
}
protected boolean matchesRoles(String roles, String userRoles) {
@@ -286,6 +288,13 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
exchange.setProperty(Exchange.SKIP_GZIP_ENCODING, Boolean.TRUE);
exchange.setProperty(Exchange.SKIP_WWW_FORM_URLENCODED, Boolean.TRUE);
}
+ HttpRequest request = (HttpRequest) messageEvent.getMessage();
+ // setup the connection property in case of the message header is removed
+ boolean keepAlive = HttpHeaders.isKeepAlive(request);
+ if (!keepAlive) {
+ // Just make sure we close the connection this time.
+ exchange.setProperty(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.CLOSE);
+ }
}
@Override
http://git-wip-us.apache.org/repos/asf/camel/blob/48653d33/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerKeepAliveTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerKeepAliveTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerKeepAliveTest.java
index 9d1dd95..71cbb43 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerKeepAliveTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerKeepAliveTest.java
@@ -16,8 +16,10 @@
*/
package org.apache.camel.component.netty.http;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
-import org.junit.Ignore;
+import org.jboss.netty.handler.codec.http.HttpHeaders;
import org.junit.Test;
public class NettyHttpProducerKeepAliveTest extends BaseNettyTest {
@@ -36,7 +38,6 @@ public class NettyHttpProducerKeepAliveTest extends BaseNettyTest {
}
@Test
- @Ignore("Can fail on some CI servers")
public void testHttpKeepAliveFalse() throws Exception {
getMockEndpoint("mock:input").expectedBodiesReceived("Hello World", "Hello Again");
@@ -48,15 +49,32 @@ public class NettyHttpProducerKeepAliveTest extends BaseNettyTest {
assertMockEndpointsSatisfied();
}
+
+ @Test
+ public void testConnectionClosed() throws Exception {
+ getMockEndpoint("mock:input").expectedBodiesReceived("Hello World");
+ Exchange ex = template.request("netty-http:http://localhost:{{port}}/bar?keepAlive=false", new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ exchange.getIn().setBody("Hello World");
+ }
+
+ });
+ assertMockEndpointsSatisfied();
+ assertEquals(HttpHeaders.Values.CLOSE, ex.getOut().getHeader(HttpHeaders.Names.CONNECTION));
+ }
+
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- from("netty-http:http://0.0.0.0:{{port}}/foo")
+ from("netty-http:http://localhost:{{port}}/foo")
.to("mock:input")
.transform().constant("Bye World");
+
+ from("netty-http:http://localhost:{{port}}/bar").removeHeaders("*").to("mock:input").transform().constant("Bye World");
}
};
}
[02/19] camel git commit: CAMEL-8462 Removed the field of request
from HttpServerChannelHandler
Posted by ni...@apache.org.
CAMEL-8462 Removed the field of request from HttpServerChannelHandler
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/08aa7da3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/08aa7da3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/08aa7da3
Branch: refs/heads/camel-2.15.x
Commit: 08aa7da33a714ae83a41a536edcca0c00fc70d69
Parents: 6c61a24
Author: Willem Jiang <wi...@gmail.com>
Authored: Mon Mar 9 18:06:18 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:36:27 2015 +0800
----------------------------------------------------------------------
.../netty/http/handlers/HttpServerChannelHandler.java | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/08aa7da3/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
index 8f483c5..e30ee27 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
@@ -64,7 +64,6 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
// use NettyHttpConsumer as logger to make it easier to read the logs as this is part of the consumer
private static final Logger LOG = LoggerFactory.getLogger(NettyHttpConsumer.class);
private final NettyHttpConsumer consumer;
- private HttpRequest request;
public HttpServerChannelHandler(NettyHttpConsumer consumer) {
super(consumer);
@@ -77,8 +76,7 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent messageEvent) throws Exception {
- // store request, as this channel handler is created per pipeline
- request = (HttpRequest) messageEvent.getMessage();
+ HttpRequest request = (HttpRequest) messageEvent.getMessage();
LOG.debug("Message received: {}", request);
@@ -292,7 +290,7 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent exceptionEvent) throws Exception {
-
+
// only close if we are still allowed to run
if (consumer.isRunAllowed()) {
@@ -305,7 +303,7 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
}
}
}
-
+
@Override
protected Object getResponseBody(Exchange exchange) throws Exception {
[09/19] camel git commit: CAMEL-8455 update_key option should be
optional in getHistoricalStatusUpdateStatistics
Posted by ni...@apache.org.
CAMEL-8455 update_key option should be optional in getHistoricalStatusUpdateStatistics
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3454c0d4
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3454c0d4
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3454c0d4
Branch: refs/heads/camel-2.15.x
Commit: 3454c0d417181836a96b960a6599f23ef7ba8419
Parents: ae47914
Author: Tomas Rohovsky <tr...@redhat.com>
Authored: Fri Mar 6 20:28:42 2015 +0100
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:37:34 2015 +0800
----------------------------------------------------------------------
components/camel-linkedin/camel-linkedin-component/pom.xml | 9 +++++++++
.../linkedin/CompaniesResourceIntegrationTest.java | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/3454c0d4/components/camel-linkedin/camel-linkedin-component/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-component/pom.xml b/components/camel-linkedin/camel-linkedin-component/pom.xml
index 156d832..9d3b396 100644
--- a/components/camel-linkedin/camel-linkedin-component/pom.xml
+++ b/components/camel-linkedin/camel-linkedin-component/pom.xml
@@ -130,8 +130,17 @@
<nullableOption>seniorities</nullableOption>
<nullableOption>start</nullableOption>
<nullableOption>start_timestamp</nullableOption>
+ <nullableOption>statistics_update_key</nullableOption>
<nullableOption>time_granularity</nullableOption>
</nullableOptions>
+ <substitutions>
+ <substitution>
+ <method>^getHistoricalStatusUpdateStatistics$</method>
+ <argName>update_key</argName>
+ <argType>java.lang.String</argType>
+ <replacement>statistics_update_key</replacement>
+ </substitution>
+ </substitutions>
</api>
<api>
<apiName>groups</apiName>
http://git-wip-us.apache.org/repos/asf/camel/blob/3454c0d4/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
index 4e06f2b..acfcec6 100644
--- a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
+++ b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
@@ -210,7 +210,7 @@ public class CompaniesResourceIntegrationTest extends AbstractLinkedInTestSuppor
// parameter type is org.apache.camel.component.linkedin.api.Timegranularity
headers.put("CamelLinkedIn.time_granularity", null);
// parameter type is String
- headers.put("CamelLinkedIn.update_key", null);
+ headers.put("CamelLinkedIn.statistics_update_key", null);
final org.apache.camel.component.linkedin.api.model.HistoricalStatusUpdateStatistics result = requestBodyAndHeaders("direct://GETHISTORICALSTATUSUPDATESTATISTICS", null, headers);
[15/19] camel git commit: CAMEL-8457 Correct return types of some
endpoints in camel-linkedin
Posted by ni...@apache.org.
CAMEL-8457 Correct return types of some endpoints in camel-linkedin
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5ca0c0cb
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5ca0c0cb
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5ca0c0cb
Branch: refs/heads/camel-2.14.x
Commit: 5ca0c0cbc344af823b681f6af5a101805d2d478c
Parents: 57b084d
Author: Tomas Rohovsky <tr...@redhat.com>
Authored: Fri Mar 6 22:19:46 2015 +0100
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:38:28 2015 +0800
----------------------------------------------------------------------
.../src/main/resources/linkedin-api-wadl.xml | 11 +++++------
.../linkedin/CompaniesResourceIntegrationTest.java | 2 +-
.../linkedin/PeopleResourceIntegrationTest.java | 4 ++--
3 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/5ca0c0cb/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml b/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
index f784a45..e3c7b29 100644
--- a/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
+++ b/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
@@ -101,7 +101,7 @@
<wadl:param href="#secure-urls"/>
</wadl:request>
<wadl:response>
- <wadl:representation mediaType="application/xml" element="tns:comments"/>
+ <wadl:representation href="#update-comments"/>
</wadl:response>
</wadl:method>
</wadl:resource>
@@ -193,11 +193,9 @@
<wadl:request>
<wadl:param href="#group-id"/>
<wadl:param href="#fields-selector"/>
- <wadl:param href="#count"/>
- <wadl:param href="#start"/>
</wadl:request>
<wadl:response>
- <wadl:representation href="#groupmemberships"/>
+ <wadl:representation href="#groupmembership"/>
</wadl:response>
</wadl:method>
</wadl:resource>
@@ -633,7 +631,7 @@
<wadl:param href="#secure-urls"/>
</wadl:request>
<wadl:response>
- <wadl:representation mediaType="application/xml" element="tns:comments"/>
+ <wadl:representation href="#update-comments"/>
</wadl:response>
</wadl:method>
</wadl:resource>
@@ -1037,9 +1035,10 @@
<wadl:representation mediaType="application/xml" element="tns:isfollowing" id="is-following"/>
<wadl:representation mediaType="application/xml" element="tns:updatecomment" id="update-comment"/>
+ <wadl:representation mediaType="application/xml" element="tns:updatecomments" id="update-comments"/>
<wadl:representation mediaType="application/xml" element="tns:jobbookmark" id="job-bookmark"/>
<wadl:representation mediaType="application/xml" element="tns:jobbookmarks" id="job-bookmarks"/>
<wadl:representation mediaType="application/xml" element="tns:jobsearch" id="job-search"/>
-</wadl:application>
\ No newline at end of file
+</wadl:application>
http://git-wip-us.apache.org/repos/asf/camel/blob/5ca0c0cb/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
index 0521f4c..d3f7414 100644
--- a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
+++ b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
@@ -145,7 +145,7 @@ public class CompaniesResourceIntegrationTest extends AbstractLinkedInTestSuppor
// parameter type is Boolean
headers.put("CamelLinkedIn.secure_urls", null);
- final org.apache.camel.component.linkedin.api.model.Comments result = requestBodyAndHeaders("direct://GETCOMPANYUPDATECOMMENTS", null, headers);
+ final org.apache.camel.component.linkedin.api.model.UpdateComments result = requestBodyAndHeaders("direct://GETCOMPANYUPDATECOMMENTS", null, headers);
assertNotNull("getCompanyUpdateComments result", result);
LOG.debug("getCompanyUpdateComments: " + result);
http://git-wip-us.apache.org/repos/asf/camel/blob/5ca0c0cb/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/PeopleResourceIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/PeopleResourceIntegrationTest.java b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/PeopleResourceIntegrationTest.java
index 95c5991..287f445 100644
--- a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/PeopleResourceIntegrationTest.java
+++ b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/PeopleResourceIntegrationTest.java
@@ -170,7 +170,7 @@ public class PeopleResourceIntegrationTest extends AbstractLinkedInTestSupport {
// parameter type is Long
headers.put("CamelLinkedIn.start", null);
- final org.apache.camel.component.linkedin.api.model.GroupMemberships result = requestBodyAndHeaders("direct://GETGROUPMEMBERSHIPSETTINGS", null, headers);
+ final org.apache.camel.component.linkedin.api.model.GroupMembership result = requestBodyAndHeaders("direct://GETGROUPMEMBERSHIPSETTINGS", null, headers);
assertNotNull("getGroupMembershipSettings result", result);
LOG.debug("getGroupMembershipSettings: " + result);
@@ -419,7 +419,7 @@ public class PeopleResourceIntegrationTest extends AbstractLinkedInTestSupport {
// parameter type is Boolean
headers.put("CamelLinkedIn.secure_urls", null);
- final org.apache.camel.component.linkedin.api.model.Comments result = requestBodyAndHeaders("direct://GETUPDATECOMMENTS", null, headers);
+ final org.apache.camel.component.linkedin.api.model.UpdateComments result = requestBodyAndHeaders("direct://GETUPDATECOMMENTS", null, headers);
assertNotNull("getUpdateComments result", result);
LOG.debug("getUpdateComments: " + result);
[11/19] camel git commit: CAMEL-8462 Removed the field of request
from HttpServerChannelHandler
Posted by ni...@apache.org.
CAMEL-8462 Removed the field of request from HttpServerChannelHandler
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f7c2e663
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f7c2e663
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f7c2e663
Branch: refs/heads/camel-2.14.x
Commit: f7c2e663f5ae1685a78d98f1934e1a879156ae73
Parents: e1d9b5c
Author: Willem Jiang <wi...@gmail.com>
Authored: Mon Mar 9 18:06:18 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:38:00 2015 +0800
----------------------------------------------------------------------
.../netty/http/handlers/HttpServerChannelHandler.java | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/f7c2e663/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
index 8f483c5..e30ee27 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
@@ -64,7 +64,6 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
// use NettyHttpConsumer as logger to make it easier to read the logs as this is part of the consumer
private static final Logger LOG = LoggerFactory.getLogger(NettyHttpConsumer.class);
private final NettyHttpConsumer consumer;
- private HttpRequest request;
public HttpServerChannelHandler(NettyHttpConsumer consumer) {
super(consumer);
@@ -77,8 +76,7 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent messageEvent) throws Exception {
- // store request, as this channel handler is created per pipeline
- request = (HttpRequest) messageEvent.getMessage();
+ HttpRequest request = (HttpRequest) messageEvent.getMessage();
LOG.debug("Message received: {}", request);
@@ -292,7 +290,7 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent exceptionEvent) throws Exception {
-
+
// only close if we are still allowed to run
if (consumer.isRunAllowed()) {
@@ -305,7 +303,7 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
}
}
}
-
+
@Override
protected Object getResponseBody(Exchange exchange) throws Exception {
[08/19] camel git commit: CAMEL-8456 - Remove addCompanyUpdateComment
endpoint from camel-linkedin
Posted by ni...@apache.org.
CAMEL-8456 - Remove addCompanyUpdateComment endpoint from camel-linkedin
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ae47914a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ae47914a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ae47914a
Branch: refs/heads/camel-2.15.x
Commit: ae47914a4d7ce221a778a8042fec7cd1c8499c74
Parents: d3a342a
Author: Tomas Rohovsky <tr...@redhat.com>
Authored: Fri Mar 6 21:20:58 2015 +0100
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:37:26 2015 +0800
----------------------------------------------------------------------
.../src/main/resources/linkedin-api-wadl.xml | 10 ----------
.../CompaniesResourceIntegrationTest.java | 18 ------------------
2 files changed, 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/ae47914a/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml b/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
index c2fcb10..1766040 100644
--- a/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
+++ b/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
@@ -636,16 +636,6 @@
</wadl:method>
</wadl:resource>
- <wadl:resource path="update-comments">
- <wadl:method name="POST" id="addCompanyUpdateComment">
- <wadl:request>
- <wadl:param href="#company-id"/>
- <wadl:param href="#update-key"/>
- <wadl:representation href="#update-comment"/>
- </wadl:request>
- </wadl:method>
- </wadl:resource>
-
<wadl:resource path="update-comments-as-company">
<wadl:method name="POST" id="addCompanyUpdateCommentAsCompany">
<wadl:request>
http://git-wip-us.apache.org/repos/asf/camel/blob/ae47914a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
index d3f7414..4e06f2b 100644
--- a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
+++ b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
@@ -42,20 +42,6 @@ public class CompaniesResourceIntegrationTest extends AbstractLinkedInTestSuppor
private static final String PATH_PREFIX = LinkedInApiCollection.getCollection().getApiName(CompaniesResourceApiMethod.class).getName();
private static final Long TEST_COMPANY_ID = 1337L;
- // TODO provide parameter values for addCompanyUpdateComment
- @Ignore
- @Test
- public void testAddCompanyUpdateComment() throws Exception {
- final Map<String, Object> headers = new HashMap<String, Object>();
- headers.put("CamelLinkedIn.company_id", 0L);
- // parameter type is String
- headers.put("CamelLinkedIn.update_key", null);
- // parameter type is org.apache.camel.component.linkedin.api.model.UpdateComment
- headers.put("CamelLinkedIn.updatecomment", null);
-
- requestBodyAndHeaders("direct://ADDCOMPANYUPDATECOMMENT", null, headers);
- }
-
// TODO provide parameter values for addCompanyUpdateCommentAsCompany
@Ignore
@Test
@@ -300,10 +286,6 @@ public class CompaniesResourceIntegrationTest extends AbstractLinkedInTestSuppor
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() {
- // test route for addCompanyUpdateComment
- from("direct://ADDCOMPANYUPDATECOMMENT")
- .to("linkedin://" + PATH_PREFIX + "/addCompanyUpdateComment");
-
// test route for addCompanyUpdateCommentAsCompany
from("direct://ADDCOMPANYUPDATECOMMENTASCOMPANY")
.to("linkedin://" + PATH_PREFIX + "/addCompanyUpdateCommentAsCompany");
[10/19] camel git commit: CAMEL-8454 Correct a comment in files
generated by api-component plugin
Posted by ni...@apache.org.
CAMEL-8454 Correct a comment in files generated by api-component plugin
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/03d6ac76
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/03d6ac76
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/03d6ac76
Branch: refs/heads/camel-2.15.x
Commit: 03d6ac768d48f0f07fa3745aecd73e105a1ffbfc
Parents: 3454c0d
Author: Tomas Rohovsky <tr...@redhat.com>
Authored: Fri Mar 6 18:13:11 2015 +0100
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:37:40 2015 +0800
----------------------------------------------------------------------
.../src/main/resources/api-collection.vm | 2 +-
.../src/main/resources/api-endpoint-config.vm | 2 +-
.../src/main/resources/api-method-enum.vm | 2 +-
.../src/main/resources/api-name-enum.vm | 2 +-
.../src/main/resources/api-route-test.vm | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/03d6ac76/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-collection.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-collection.vm b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-collection.vm
index 6d5b850..3e75702 100644
--- a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-collection.vm
+++ b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-collection.vm
@@ -16,7 +16,7 @@
## ------------------------------------------------------------------------
## api-collection.vm
/*
- * Camel ApiCollection generated by camel-component-util-maven-plugin
+ * Camel ApiCollection generated by camel-api-component-maven-plugin
* Generated on: $generatedDate
*/
package $packageName;
http://git-wip-us.apache.org/repos/asf/camel/blob/03d6ac76/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-endpoint-config.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-endpoint-config.vm b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-endpoint-config.vm
index 082665f..8188c54 100644
--- a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-endpoint-config.vm
+++ b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-endpoint-config.vm
@@ -16,7 +16,7 @@
## ------------------------------------------------------------------------
## api-endpoint-config.vm
/*
- * Camel EndpointConfiguration generated by camel-component-util-maven-plugin
+ * Camel EndpointConfiguration generated by camel-api-component-maven-plugin
* Generated on: $generatedDate
*/
package ${componentPackage};
http://git-wip-us.apache.org/repos/asf/camel/blob/03d6ac76/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm
index 9827d1e..5b9470d 100644
--- a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm
+++ b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm
@@ -16,7 +16,7 @@
## ------------------------------------------------------------------------
## api-method-enum.vm
/*
- * Camel ApiMethod Enumeration generated by camel-component-util-maven-plugin
+ * Camel ApiMethod Enumeration generated by camel-api-component-maven-plugin
* Generated on: $generatedDate
*/
package $packageName;
http://git-wip-us.apache.org/repos/asf/camel/blob/03d6ac76/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-name-enum.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-name-enum.vm b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-name-enum.vm
index e0d558d..b2bfe60 100644
--- a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-name-enum.vm
+++ b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-name-enum.vm
@@ -16,7 +16,7 @@
## ------------------------------------------------------------------------
## api-name-enum.vm
/*
- * Camel ApiName Enumeration generated by camel-component-util-maven-plugin
+ * Camel ApiName Enumeration generated by camel-api-component-maven-plugin
* Generated on: $generatedDate
*/
package $packageName;
http://git-wip-us.apache.org/repos/asf/camel/blob/03d6ac76/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-route-test.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-route-test.vm b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-route-test.vm
index 90e54f4..fbaa21f 100644
--- a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-route-test.vm
+++ b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-route-test.vm
@@ -16,7 +16,7 @@
## ------------------------------------------------------------------------
## api-route-test.vm
/*
- * Camel Api Route test generated by camel-component-util-maven-plugin
+ * Camel Api Route test generated by camel-api-component-maven-plugin
* Generated on: $generatedDate
*/
package $componentPackage;
[19/19] camel git commit: CAMEL-8454 Correct a comment in files
generated by api-component plugin
Posted by ni...@apache.org.
CAMEL-8454 Correct a comment in files generated by api-component plugin
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/66c49f47
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/66c49f47
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/66c49f47
Branch: refs/heads/camel-2.14.x
Commit: 66c49f47bbb655ca8b5c6fef108a9bcb423104bb
Parents: 4850333
Author: Tomas Rohovsky <tr...@redhat.com>
Authored: Fri Mar 6 18:13:11 2015 +0100
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:38:53 2015 +0800
----------------------------------------------------------------------
.../src/main/resources/api-collection.vm | 2 +-
.../src/main/resources/api-endpoint-config.vm | 2 +-
.../src/main/resources/api-method-enum.vm | 2 +-
.../src/main/resources/api-name-enum.vm | 2 +-
.../src/main/resources/api-route-test.vm | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/66c49f47/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-collection.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-collection.vm b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-collection.vm
index 6d5b850..3e75702 100644
--- a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-collection.vm
+++ b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-collection.vm
@@ -16,7 +16,7 @@
## ------------------------------------------------------------------------
## api-collection.vm
/*
- * Camel ApiCollection generated by camel-component-util-maven-plugin
+ * Camel ApiCollection generated by camel-api-component-maven-plugin
* Generated on: $generatedDate
*/
package $packageName;
http://git-wip-us.apache.org/repos/asf/camel/blob/66c49f47/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-endpoint-config.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-endpoint-config.vm b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-endpoint-config.vm
index 082665f..8188c54 100644
--- a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-endpoint-config.vm
+++ b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-endpoint-config.vm
@@ -16,7 +16,7 @@
## ------------------------------------------------------------------------
## api-endpoint-config.vm
/*
- * Camel EndpointConfiguration generated by camel-component-util-maven-plugin
+ * Camel EndpointConfiguration generated by camel-api-component-maven-plugin
* Generated on: $generatedDate
*/
package ${componentPackage};
http://git-wip-us.apache.org/repos/asf/camel/blob/66c49f47/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm
index 9827d1e..5b9470d 100644
--- a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm
+++ b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm
@@ -16,7 +16,7 @@
## ------------------------------------------------------------------------
## api-method-enum.vm
/*
- * Camel ApiMethod Enumeration generated by camel-component-util-maven-plugin
+ * Camel ApiMethod Enumeration generated by camel-api-component-maven-plugin
* Generated on: $generatedDate
*/
package $packageName;
http://git-wip-us.apache.org/repos/asf/camel/blob/66c49f47/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-name-enum.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-name-enum.vm b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-name-enum.vm
index e0d558d..b2bfe60 100644
--- a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-name-enum.vm
+++ b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-name-enum.vm
@@ -16,7 +16,7 @@
## ------------------------------------------------------------------------
## api-name-enum.vm
/*
- * Camel ApiName Enumeration generated by camel-component-util-maven-plugin
+ * Camel ApiName Enumeration generated by camel-api-component-maven-plugin
* Generated on: $generatedDate
*/
package $packageName;
http://git-wip-us.apache.org/repos/asf/camel/blob/66c49f47/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-route-test.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-route-test.vm b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-route-test.vm
index 90e54f4..fbaa21f 100644
--- a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-route-test.vm
+++ b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-route-test.vm
@@ -16,7 +16,7 @@
## ------------------------------------------------------------------------
## api-route-test.vm
/*
- * Camel Api Route test generated by camel-component-util-maven-plugin
+ * Camel Api Route test generated by camel-api-component-maven-plugin
* Generated on: $generatedDate
*/
package $componentPackage;
[14/19] camel git commit: CAMEL-8461 Fixed the issue that
camel-netty-http does not respect client's keep-alive setting
Posted by ni...@apache.org.
CAMEL-8461 Fixed the issue that camel-netty-http does not respect client's keep-alive setting
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/57b084d8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/57b084d8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/57b084d8
Branch: refs/heads/camel-2.14.x
Commit: 57b084d8b530a622d3d4f1756bed286eae3c8977
Parents: 48653d3
Author: Willem Jiang <wi...@gmail.com>
Authored: Mon Mar 9 18:08:13 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:38:23 2015 +0800
----------------------------------------------------------------------
.../netty4/http/DefaultNettyHttpBinding.java | 4 +++
.../http/handlers/HttpServerChannelHandler.java | 10 ++++++--
.../http/NettyHttpProducerKeepAliveTest.java | 26 +++++++++++++++++---
3 files changed, 35 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/57b084d8/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/DefaultNettyHttpBinding.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/DefaultNettyHttpBinding.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/DefaultNettyHttpBinding.java
index ceb64c4..39d6888 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/DefaultNettyHttpBinding.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/DefaultNettyHttpBinding.java
@@ -410,6 +410,10 @@ public class DefaultNettyHttpBinding implements NettyHttpBinding, Cloneable {
// configure connection to accordingly to keep alive configuration
// favor using the header from the message
String connection = message.getHeader(HttpHeaders.Names.CONNECTION, String.class);
+ // Read the connection header from the exchange property
+ if (connection == null) {
+ connection = message.getExchange().getProperty(HttpHeaders.Names.CONNECTION, String.class);
+ }
if (connection == null) {
// fallback and use the keep alive from the configuration
if (configuration.isKeepAlive()) {
http://git-wip-us.apache.org/repos/asf/camel/blob/57b084d8/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
index 18770b1..9645dc0 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
@@ -31,7 +31,6 @@ import io.netty.handler.codec.http.DefaultHttpResponse;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.HttpResponse;
-
import org.apache.camel.Exchange;
import org.apache.camel.LoggingLevel;
import org.apache.camel.component.netty4.NettyConverter;
@@ -43,9 +42,9 @@ import org.apache.camel.component.netty4.http.NettyHttpSecurityConfiguration;
import org.apache.camel.component.netty4.http.SecurityAuthenticator;
import org.apache.camel.util.CamelLogger;
import org.apache.camel.util.ObjectHelper;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import static io.netty.handler.codec.http.HttpResponseStatus.BAD_REQUEST;
import static io.netty.handler.codec.http.HttpResponseStatus.METHOD_NOT_ALLOWED;
import static io.netty.handler.codec.http.HttpResponseStatus.OK;
@@ -275,6 +274,13 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
exchange.setProperty(Exchange.SKIP_GZIP_ENCODING, Boolean.TRUE);
exchange.setProperty(Exchange.SKIP_WWW_FORM_URLENCODED, Boolean.TRUE);
}
+ HttpRequest request = (HttpRequest) message;
+ // setup the connection property in case of the message header is removed
+ boolean keepAlive = HttpHeaders.isKeepAlive(request);
+ if (!keepAlive) {
+ // Just make sure we close the connection this time.
+ exchange.setProperty(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.CLOSE);
+ }
}
@Override
http://git-wip-us.apache.org/repos/asf/camel/blob/57b084d8/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpProducerKeepAliveTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpProducerKeepAliveTest.java b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpProducerKeepAliveTest.java
index 26c0835..e4c22f1 100644
--- a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpProducerKeepAliveTest.java
+++ b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpProducerKeepAliveTest.java
@@ -16,8 +16,10 @@
*/
package org.apache.camel.component.netty4.http;
+import io.netty.handler.codec.http.HttpHeaders;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
-import org.junit.Ignore;
import org.junit.Test;
public class NettyHttpProducerKeepAliveTest extends BaseNettyTest {
@@ -36,7 +38,6 @@ public class NettyHttpProducerKeepAliveTest extends BaseNettyTest {
}
@Test
- @Ignore("Can fail on some CI servers")
public void testHttpKeepAliveFalse() throws Exception {
getMockEndpoint("mock:input").expectedBodiesReceived("Hello World", "Hello Again");
@@ -48,17 +49,36 @@ public class NettyHttpProducerKeepAliveTest extends BaseNettyTest {
assertMockEndpointsSatisfied();
}
+
+ @Test
+ public void testConnectionClosed() throws Exception {
+ getMockEndpoint("mock:input").expectedBodiesReceived("Hello World");
+ Exchange ex = template.request("netty4-http:http://localhost:{{port}}/bar?keepAlive=false", new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ exchange.getIn().setBody("Hello World");
+ }
+ });
+
+ assertMockEndpointsSatisfied();
+ assertEquals(HttpHeaders.Values.CLOSE, ex.getOut().getHeader(HttpHeaders.Names.CONNECTION));
+ }
+
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- from("netty4-http:http://0.0.0.0:{{port}}/foo")
+ from("netty4-http:http://localhost:{{port}}/foo")
.to("mock:input")
.transform().constant("Bye World");
+
+ from("netty4-http:http://localhost:{{port}}/bar").removeHeaders("*").to("mock:input").transform().constant("Bye World");
}
};
}
+
+
}
[06/19] camel git commit: CAMEL-8457 Correct return types of some
endpoints in camel-linkedin
Posted by ni...@apache.org.
CAMEL-8457 Correct return types of some endpoints in camel-linkedin
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/701d4f7a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/701d4f7a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/701d4f7a
Branch: refs/heads/camel-2.15.x
Commit: 701d4f7a661bf447e85834a2e837f0d8be2f3d22
Parents: 48b961b
Author: Tomas Rohovsky <tr...@redhat.com>
Authored: Fri Mar 6 22:19:46 2015 +0100
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:37:12 2015 +0800
----------------------------------------------------------------------
.../src/main/resources/linkedin-api-wadl.xml | 11 +++++------
.../linkedin/CompaniesResourceIntegrationTest.java | 2 +-
.../linkedin/PeopleResourceIntegrationTest.java | 4 ++--
3 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/701d4f7a/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml b/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
index f784a45..e3c7b29 100644
--- a/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
+++ b/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
@@ -101,7 +101,7 @@
<wadl:param href="#secure-urls"/>
</wadl:request>
<wadl:response>
- <wadl:representation mediaType="application/xml" element="tns:comments"/>
+ <wadl:representation href="#update-comments"/>
</wadl:response>
</wadl:method>
</wadl:resource>
@@ -193,11 +193,9 @@
<wadl:request>
<wadl:param href="#group-id"/>
<wadl:param href="#fields-selector"/>
- <wadl:param href="#count"/>
- <wadl:param href="#start"/>
</wadl:request>
<wadl:response>
- <wadl:representation href="#groupmemberships"/>
+ <wadl:representation href="#groupmembership"/>
</wadl:response>
</wadl:method>
</wadl:resource>
@@ -633,7 +631,7 @@
<wadl:param href="#secure-urls"/>
</wadl:request>
<wadl:response>
- <wadl:representation mediaType="application/xml" element="tns:comments"/>
+ <wadl:representation href="#update-comments"/>
</wadl:response>
</wadl:method>
</wadl:resource>
@@ -1037,9 +1035,10 @@
<wadl:representation mediaType="application/xml" element="tns:isfollowing" id="is-following"/>
<wadl:representation mediaType="application/xml" element="tns:updatecomment" id="update-comment"/>
+ <wadl:representation mediaType="application/xml" element="tns:updatecomments" id="update-comments"/>
<wadl:representation mediaType="application/xml" element="tns:jobbookmark" id="job-bookmark"/>
<wadl:representation mediaType="application/xml" element="tns:jobbookmarks" id="job-bookmarks"/>
<wadl:representation mediaType="application/xml" element="tns:jobsearch" id="job-search"/>
-</wadl:application>
\ No newline at end of file
+</wadl:application>
http://git-wip-us.apache.org/repos/asf/camel/blob/701d4f7a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
index 0521f4c..d3f7414 100644
--- a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
+++ b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
@@ -145,7 +145,7 @@ public class CompaniesResourceIntegrationTest extends AbstractLinkedInTestSuppor
// parameter type is Boolean
headers.put("CamelLinkedIn.secure_urls", null);
- final org.apache.camel.component.linkedin.api.model.Comments result = requestBodyAndHeaders("direct://GETCOMPANYUPDATECOMMENTS", null, headers);
+ final org.apache.camel.component.linkedin.api.model.UpdateComments result = requestBodyAndHeaders("direct://GETCOMPANYUPDATECOMMENTS", null, headers);
assertNotNull("getCompanyUpdateComments result", result);
LOG.debug("getCompanyUpdateComments: " + result);
http://git-wip-us.apache.org/repos/asf/camel/blob/701d4f7a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/PeopleResourceIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/PeopleResourceIntegrationTest.java b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/PeopleResourceIntegrationTest.java
index 95c5991..287f445 100644
--- a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/PeopleResourceIntegrationTest.java
+++ b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/PeopleResourceIntegrationTest.java
@@ -170,7 +170,7 @@ public class PeopleResourceIntegrationTest extends AbstractLinkedInTestSupport {
// parameter type is Long
headers.put("CamelLinkedIn.start", null);
- final org.apache.camel.component.linkedin.api.model.GroupMemberships result = requestBodyAndHeaders("direct://GETGROUPMEMBERSHIPSETTINGS", null, headers);
+ final org.apache.camel.component.linkedin.api.model.GroupMembership result = requestBodyAndHeaders("direct://GETGROUPMEMBERSHIPSETTINGS", null, headers);
assertNotNull("getGroupMembershipSettings result", result);
LOG.debug("getGroupMembershipSettings: " + result);
@@ -419,7 +419,7 @@ public class PeopleResourceIntegrationTest extends AbstractLinkedInTestSupport {
// parameter type is Boolean
headers.put("CamelLinkedIn.secure_urls", null);
- final org.apache.camel.component.linkedin.api.model.Comments result = requestBodyAndHeaders("direct://GETUPDATECOMMENTS", null, headers);
+ final org.apache.camel.component.linkedin.api.model.UpdateComments result = requestBodyAndHeaders("direct://GETUPDATECOMMENTS", null, headers);
assertNotNull("getUpdateComments result", result);
LOG.debug("getUpdateComments: " + result);
[16/19] camel git commit: CAMEL-8458 camel-linkedin -
public_profile_url option should be String
Posted by ni...@apache.org.
CAMEL-8458 camel-linkedin - public_profile_url option should be String
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0662bcff
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0662bcff
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0662bcff
Branch: refs/heads/camel-2.14.x
Commit: 0662bcffc861db660fe6c648f648daa3507fb156
Parents: 5ca0c0c
Author: Tomas Rohovsky <tr...@redhat.com>
Authored: Sat Mar 7 00:06:52 2015 +0100
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:38:34 2015 +0800
----------------------------------------------------------------------
.../camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/0662bcff/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml b/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
index e3c7b29..c2fcb10 100644
--- a/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
+++ b/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
@@ -911,7 +911,7 @@
<wadl:param name="secure-urls" style="query" type="xsd:boolean" id="secure-urls"/>
<!-- public profile url param -->
- <wadl:param name="public-profile-url" style="template" type="xsd:anyURI" id="public-profile-url"/>
+ <wadl:param name="public-profile-url" style="template" id="public-profile-url"/>
<!-- group Id param -->
<wadl:param name="group-id" style="template" type="xsd:integer" required="true" id="group-id"/>
[04/19] camel git commit: CAMEL-8461 Fixed the issue that
camel-netty-http does not respect client's keep-alive setting
Posted by ni...@apache.org.
CAMEL-8461 Fixed the issue that camel-netty-http does not respect client's keep-alive setting
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/edfe515a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/edfe515a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/edfe515a
Branch: refs/heads/camel-2.15.x
Commit: edfe515a970b40b3563bb499ea3b067772ff1a99
Parents: 44d92a6
Author: Willem Jiang <wi...@gmail.com>
Authored: Mon Mar 9 18:07:53 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:36:54 2015 +0800
----------------------------------------------------------------------
.../netty/http/DefaultNettyHttpBinding.java | 5 +++-
.../http/handlers/HttpServerChannelHandler.java | 13 +++++++++--
.../http/NettyHttpProducerKeepAliveTest.java | 24 +++++++++++++++++---
3 files changed, 36 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/edfe515a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
index 102fb91..85395b8 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
@@ -403,6 +403,10 @@ public class DefaultNettyHttpBinding implements NettyHttpBinding, Cloneable {
// configure connection to accordingly to keep alive configuration
// favor using the header from the message
String connection = message.getHeader(HttpHeaders.Names.CONNECTION, String.class);
+ // Read the connection header from the exchange property
+ if (connection == null) {
+ connection = message.getExchange().getProperty(HttpHeaders.Names.CONNECTION, String.class);
+ }
if (connection == null) {
// fallback and use the keep alive from the configuration
if (configuration.isKeepAlive()) {
@@ -531,7 +535,6 @@ public class DefaultNettyHttpBinding implements NettyHttpBinding, Cloneable {
}
request.headers().set(HttpHeaders.Names.CONNECTION, connection);
LOG.trace("Connection: {}", connection);
-
return request;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/edfe515a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
index e30ee27..4888b8c 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
@@ -44,9 +44,9 @@ import org.jboss.netty.handler.codec.http.DefaultHttpResponse;
import org.jboss.netty.handler.codec.http.HttpHeaders;
import org.jboss.netty.handler.codec.http.HttpRequest;
import org.jboss.netty.handler.codec.http.HttpResponse;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import static org.jboss.netty.handler.codec.http.HttpResponseStatus.BAD_REQUEST;
import static org.jboss.netty.handler.codec.http.HttpResponseStatus.METHOD_NOT_ALLOWED;
import static org.jboss.netty.handler.codec.http.HttpResponseStatus.OK;
@@ -209,9 +209,11 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
}
}
}
-
+
// let Camel process this message
+ // It did the way as camel-netty component does
super.messageReceived(ctx, messageEvent);
+
}
protected boolean matchesRoles(String roles, String userRoles) {
@@ -286,6 +288,13 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
exchange.setProperty(Exchange.SKIP_GZIP_ENCODING, Boolean.TRUE);
exchange.setProperty(Exchange.SKIP_WWW_FORM_URLENCODED, Boolean.TRUE);
}
+ HttpRequest request = (HttpRequest) messageEvent.getMessage();
+ // setup the connection property in case of the message header is removed
+ boolean keepAlive = HttpHeaders.isKeepAlive(request);
+ if (!keepAlive) {
+ // Just make sure we close the connection this time.
+ exchange.setProperty(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.CLOSE);
+ }
}
@Override
http://git-wip-us.apache.org/repos/asf/camel/blob/edfe515a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerKeepAliveTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerKeepAliveTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerKeepAliveTest.java
index 9d1dd95..71cbb43 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerKeepAliveTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerKeepAliveTest.java
@@ -16,8 +16,10 @@
*/
package org.apache.camel.component.netty.http;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
-import org.junit.Ignore;
+import org.jboss.netty.handler.codec.http.HttpHeaders;
import org.junit.Test;
public class NettyHttpProducerKeepAliveTest extends BaseNettyTest {
@@ -36,7 +38,6 @@ public class NettyHttpProducerKeepAliveTest extends BaseNettyTest {
}
@Test
- @Ignore("Can fail on some CI servers")
public void testHttpKeepAliveFalse() throws Exception {
getMockEndpoint("mock:input").expectedBodiesReceived("Hello World", "Hello Again");
@@ -48,15 +49,32 @@ public class NettyHttpProducerKeepAliveTest extends BaseNettyTest {
assertMockEndpointsSatisfied();
}
+
+ @Test
+ public void testConnectionClosed() throws Exception {
+ getMockEndpoint("mock:input").expectedBodiesReceived("Hello World");
+ Exchange ex = template.request("netty-http:http://localhost:{{port}}/bar?keepAlive=false", new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ exchange.getIn().setBody("Hello World");
+ }
+
+ });
+ assertMockEndpointsSatisfied();
+ assertEquals(HttpHeaders.Values.CLOSE, ex.getOut().getHeader(HttpHeaders.Names.CONNECTION));
+ }
+
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- from("netty-http:http://0.0.0.0:{{port}}/foo")
+ from("netty-http:http://localhost:{{port}}/foo")
.to("mock:input")
.transform().constant("Bye World");
+
+ from("netty-http:http://localhost:{{port}}/bar").removeHeaders("*").to("mock:input").transform().constant("Bye World");
}
};
}
[12/19] camel git commit: CAMEL-8462 Removed the field of request
from HttpServerChannelHandler
Posted by ni...@apache.org.
CAMEL-8462 Removed the field of request from HttpServerChannelHandler
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/92182c3b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/92182c3b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/92182c3b
Branch: refs/heads/camel-2.14.x
Commit: 92182c3bdada7fc3ad3d740cfbb8f2821fbd1527
Parents: f7c2e66
Author: Willem Jiang <wi...@gmail.com>
Authored: Mon Mar 9 18:06:32 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:38:08 2015 +0800
----------------------------------------------------------------------
.../netty4/http/handlers/HttpServerChannelHandler.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/92182c3b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
index b459057..18770b1 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
@@ -61,7 +61,6 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
// use NettyHttpConsumer as logger to make it easier to read the logs as this is part of the consumer
private static final Logger LOG = LoggerFactory.getLogger(NettyHttpConsumer.class);
private final NettyHttpConsumer consumer;
- private HttpRequest request;
public HttpServerChannelHandler(NettyHttpConsumer consumer) {
super(consumer);
@@ -74,8 +73,7 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
- // store request, as this channel handler is created per pipeline
- request = (HttpRequest) msg;
+ HttpRequest request = (HttpRequest) msg;
LOG.debug("Message received: {}", request);
@@ -281,7 +279,7 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
-
+
// only close if we are still allowed to run
if (consumer.isRunAllowed()) {
[17/19] camel git commit: CAMEL-8456 - Remove addCompanyUpdateComment
endpoint from camel-linkedin
Posted by ni...@apache.org.
CAMEL-8456 - Remove addCompanyUpdateComment endpoint from camel-linkedin
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3a6d2007
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3a6d2007
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3a6d2007
Branch: refs/heads/camel-2.14.x
Commit: 3a6d2007b9e1165df1eaff65ed8e212cb000f242
Parents: 0662bcf
Author: Tomas Rohovsky <tr...@redhat.com>
Authored: Fri Mar 6 21:20:58 2015 +0100
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:38:40 2015 +0800
----------------------------------------------------------------------
.../src/main/resources/linkedin-api-wadl.xml | 10 ----------
.../CompaniesResourceIntegrationTest.java | 18 ------------------
2 files changed, 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/3a6d2007/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml b/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
index c2fcb10..1766040 100644
--- a/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
+++ b/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
@@ -636,16 +636,6 @@
</wadl:method>
</wadl:resource>
- <wadl:resource path="update-comments">
- <wadl:method name="POST" id="addCompanyUpdateComment">
- <wadl:request>
- <wadl:param href="#company-id"/>
- <wadl:param href="#update-key"/>
- <wadl:representation href="#update-comment"/>
- </wadl:request>
- </wadl:method>
- </wadl:resource>
-
<wadl:resource path="update-comments-as-company">
<wadl:method name="POST" id="addCompanyUpdateCommentAsCompany">
<wadl:request>
http://git-wip-us.apache.org/repos/asf/camel/blob/3a6d2007/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
index d3f7414..4e06f2b 100644
--- a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
+++ b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
@@ -42,20 +42,6 @@ public class CompaniesResourceIntegrationTest extends AbstractLinkedInTestSuppor
private static final String PATH_PREFIX = LinkedInApiCollection.getCollection().getApiName(CompaniesResourceApiMethod.class).getName();
private static final Long TEST_COMPANY_ID = 1337L;
- // TODO provide parameter values for addCompanyUpdateComment
- @Ignore
- @Test
- public void testAddCompanyUpdateComment() throws Exception {
- final Map<String, Object> headers = new HashMap<String, Object>();
- headers.put("CamelLinkedIn.company_id", 0L);
- // parameter type is String
- headers.put("CamelLinkedIn.update_key", null);
- // parameter type is org.apache.camel.component.linkedin.api.model.UpdateComment
- headers.put("CamelLinkedIn.updatecomment", null);
-
- requestBodyAndHeaders("direct://ADDCOMPANYUPDATECOMMENT", null, headers);
- }
-
// TODO provide parameter values for addCompanyUpdateCommentAsCompany
@Ignore
@Test
@@ -300,10 +286,6 @@ public class CompaniesResourceIntegrationTest extends AbstractLinkedInTestSuppor
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() {
- // test route for addCompanyUpdateComment
- from("direct://ADDCOMPANYUPDATECOMMENT")
- .to("linkedin://" + PATH_PREFIX + "/addCompanyUpdateComment");
-
// test route for addCompanyUpdateCommentAsCompany
from("direct://ADDCOMPANYUPDATECOMMENTASCOMPANY")
.to("linkedin://" + PATH_PREFIX + "/addCompanyUpdateCommentAsCompany");
[07/19] camel git commit: CAMEL-8458 camel-linkedin -
public_profile_url option should be String
Posted by ni...@apache.org.
CAMEL-8458 camel-linkedin - public_profile_url option should be String
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d3a342af
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d3a342af
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d3a342af
Branch: refs/heads/camel-2.15.x
Commit: d3a342af1bd964050c133f9808aa4a2bf07f0db6
Parents: 701d4f7
Author: Tomas Rohovsky <tr...@redhat.com>
Authored: Sat Mar 7 00:06:52 2015 +0100
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:37:19 2015 +0800
----------------------------------------------------------------------
.../camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/d3a342af/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml b/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
index e3c7b29..c2fcb10 100644
--- a/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
+++ b/components/camel-linkedin/camel-linkedin-api/src/main/resources/linkedin-api-wadl.xml
@@ -911,7 +911,7 @@
<wadl:param name="secure-urls" style="query" type="xsd:boolean" id="secure-urls"/>
<!-- public profile url param -->
- <wadl:param name="public-profile-url" style="template" type="xsd:anyURI" id="public-profile-url"/>
+ <wadl:param name="public-profile-url" style="template" id="public-profile-url"/>
<!-- group Id param -->
<wadl:param name="group-id" style="template" type="xsd:integer" required="true" id="group-id"/>
[03/19] camel git commit: CAMEL-8462 Removed the field of request
from HttpServerChannelHandler
Posted by ni...@apache.org.
CAMEL-8462 Removed the field of request from HttpServerChannelHandler
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/44d92a6b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/44d92a6b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/44d92a6b
Branch: refs/heads/camel-2.15.x
Commit: 44d92a6b95fcaaaeb043824d78799d1098471923
Parents: 08aa7da
Author: Willem Jiang <wi...@gmail.com>
Authored: Mon Mar 9 18:06:32 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:36:46 2015 +0800
----------------------------------------------------------------------
.../netty4/http/handlers/HttpServerChannelHandler.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/44d92a6b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
index b459057..18770b1 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
@@ -61,7 +61,6 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
// use NettyHttpConsumer as logger to make it easier to read the logs as this is part of the consumer
private static final Logger LOG = LoggerFactory.getLogger(NettyHttpConsumer.class);
private final NettyHttpConsumer consumer;
- private HttpRequest request;
public HttpServerChannelHandler(NettyHttpConsumer consumer) {
super(consumer);
@@ -74,8 +73,7 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
- // store request, as this channel handler is created per pipeline
- request = (HttpRequest) msg;
+ HttpRequest request = (HttpRequest) msg;
LOG.debug("Message received: {}", request);
@@ -281,7 +279,7 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
-
+
// only close if we are still allowed to run
if (consumer.isRunAllowed()) {
[18/19] camel git commit: CAMEL-8455 update_key option should be
optional in getHistoricalStatusUpdateStatistics
Posted by ni...@apache.org.
CAMEL-8455 update_key option should be optional in getHistoricalStatusUpdateStatistics
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4850333c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4850333c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4850333c
Branch: refs/heads/camel-2.14.x
Commit: 4850333c9c4c2f070a35d1c160b8c6591475bab9
Parents: 3a6d200
Author: Tomas Rohovsky <tr...@redhat.com>
Authored: Fri Mar 6 20:28:42 2015 +0100
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:38:46 2015 +0800
----------------------------------------------------------------------
components/camel-linkedin/camel-linkedin-component/pom.xml | 9 +++++++++
.../linkedin/CompaniesResourceIntegrationTest.java | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/4850333c/components/camel-linkedin/camel-linkedin-component/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-component/pom.xml b/components/camel-linkedin/camel-linkedin-component/pom.xml
index 5a83416..0f3b301 100644
--- a/components/camel-linkedin/camel-linkedin-component/pom.xml
+++ b/components/camel-linkedin/camel-linkedin-component/pom.xml
@@ -130,8 +130,17 @@
<nullableOption>seniorities</nullableOption>
<nullableOption>start</nullableOption>
<nullableOption>start_timestamp</nullableOption>
+ <nullableOption>statistics_update_key</nullableOption>
<nullableOption>time_granularity</nullableOption>
</nullableOptions>
+ <substitutions>
+ <substitution>
+ <method>^getHistoricalStatusUpdateStatistics$</method>
+ <argName>update_key</argName>
+ <argType>java.lang.String</argType>
+ <replacement>statistics_update_key</replacement>
+ </substitution>
+ </substitutions>
</api>
<api>
<apiName>groups</apiName>
http://git-wip-us.apache.org/repos/asf/camel/blob/4850333c/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
index 4e06f2b..acfcec6 100644
--- a/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
+++ b/components/camel-linkedin/camel-linkedin-component/src/test/java/org/apache/camel/component/linkedin/CompaniesResourceIntegrationTest.java
@@ -210,7 +210,7 @@ public class CompaniesResourceIntegrationTest extends AbstractLinkedInTestSuppor
// parameter type is org.apache.camel.component.linkedin.api.Timegranularity
headers.put("CamelLinkedIn.time_granularity", null);
// parameter type is String
- headers.put("CamelLinkedIn.update_key", null);
+ headers.put("CamelLinkedIn.statistics_update_key", null);
final org.apache.camel.component.linkedin.api.model.HistoricalStatusUpdateStatistics result = requestBodyAndHeaders("direct://GETHISTORICALSTATUSUPDATESTATISTICS", null, headers);
[05/19] camel git commit: CAMEL-8461 Fixed the issue that
camel-netty-http does not respect client's keep-alive setting
Posted by ni...@apache.org.
CAMEL-8461 Fixed the issue that camel-netty-http does not respect client's keep-alive setting
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/48b961b6
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/48b961b6
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/48b961b6
Branch: refs/heads/camel-2.15.x
Commit: 48b961b6b8532aad4b1d72f73aa2a51894346b3e
Parents: edfe515
Author: Willem Jiang <wi...@gmail.com>
Authored: Mon Mar 9 18:08:13 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 9 18:37:02 2015 +0800
----------------------------------------------------------------------
.../netty4/http/DefaultNettyHttpBinding.java | 4 +++
.../http/handlers/HttpServerChannelHandler.java | 10 ++++++--
.../http/NettyHttpProducerKeepAliveTest.java | 26 +++++++++++++++++---
3 files changed, 35 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/48b961b6/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/DefaultNettyHttpBinding.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/DefaultNettyHttpBinding.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/DefaultNettyHttpBinding.java
index ceb64c4..39d6888 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/DefaultNettyHttpBinding.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/DefaultNettyHttpBinding.java
@@ -410,6 +410,10 @@ public class DefaultNettyHttpBinding implements NettyHttpBinding, Cloneable {
// configure connection to accordingly to keep alive configuration
// favor using the header from the message
String connection = message.getHeader(HttpHeaders.Names.CONNECTION, String.class);
+ // Read the connection header from the exchange property
+ if (connection == null) {
+ connection = message.getExchange().getProperty(HttpHeaders.Names.CONNECTION, String.class);
+ }
if (connection == null) {
// fallback and use the keep alive from the configuration
if (configuration.isKeepAlive()) {
http://git-wip-us.apache.org/repos/asf/camel/blob/48b961b6/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
index 18770b1..9645dc0 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java
@@ -31,7 +31,6 @@ import io.netty.handler.codec.http.DefaultHttpResponse;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.HttpResponse;
-
import org.apache.camel.Exchange;
import org.apache.camel.LoggingLevel;
import org.apache.camel.component.netty4.NettyConverter;
@@ -43,9 +42,9 @@ import org.apache.camel.component.netty4.http.NettyHttpSecurityConfiguration;
import org.apache.camel.component.netty4.http.SecurityAuthenticator;
import org.apache.camel.util.CamelLogger;
import org.apache.camel.util.ObjectHelper;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import static io.netty.handler.codec.http.HttpResponseStatus.BAD_REQUEST;
import static io.netty.handler.codec.http.HttpResponseStatus.METHOD_NOT_ALLOWED;
import static io.netty.handler.codec.http.HttpResponseStatus.OK;
@@ -275,6 +274,13 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
exchange.setProperty(Exchange.SKIP_GZIP_ENCODING, Boolean.TRUE);
exchange.setProperty(Exchange.SKIP_WWW_FORM_URLENCODED, Boolean.TRUE);
}
+ HttpRequest request = (HttpRequest) message;
+ // setup the connection property in case of the message header is removed
+ boolean keepAlive = HttpHeaders.isKeepAlive(request);
+ if (!keepAlive) {
+ // Just make sure we close the connection this time.
+ exchange.setProperty(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.CLOSE);
+ }
}
@Override
http://git-wip-us.apache.org/repos/asf/camel/blob/48b961b6/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpProducerKeepAliveTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpProducerKeepAliveTest.java b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpProducerKeepAliveTest.java
index 26c0835..e4c22f1 100644
--- a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpProducerKeepAliveTest.java
+++ b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpProducerKeepAliveTest.java
@@ -16,8 +16,10 @@
*/
package org.apache.camel.component.netty4.http;
+import io.netty.handler.codec.http.HttpHeaders;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
-import org.junit.Ignore;
import org.junit.Test;
public class NettyHttpProducerKeepAliveTest extends BaseNettyTest {
@@ -36,7 +38,6 @@ public class NettyHttpProducerKeepAliveTest extends BaseNettyTest {
}
@Test
- @Ignore("Can fail on some CI servers")
public void testHttpKeepAliveFalse() throws Exception {
getMockEndpoint("mock:input").expectedBodiesReceived("Hello World", "Hello Again");
@@ -48,17 +49,36 @@ public class NettyHttpProducerKeepAliveTest extends BaseNettyTest {
assertMockEndpointsSatisfied();
}
+
+ @Test
+ public void testConnectionClosed() throws Exception {
+ getMockEndpoint("mock:input").expectedBodiesReceived("Hello World");
+ Exchange ex = template.request("netty4-http:http://localhost:{{port}}/bar?keepAlive=false", new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ exchange.getIn().setBody("Hello World");
+ }
+ });
+
+ assertMockEndpointsSatisfied();
+ assertEquals(HttpHeaders.Values.CLOSE, ex.getOut().getHeader(HttpHeaders.Names.CONNECTION));
+ }
+
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- from("netty4-http:http://0.0.0.0:{{port}}/foo")
+ from("netty4-http:http://localhost:{{port}}/foo")
.to("mock:input")
.transform().constant("Bye World");
+
+ from("netty4-http:http://localhost:{{port}}/bar").removeHeaders("*").to("mock:input").transform().constant("Bye World");
}
};
}
+
+
}