Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C6BD4108AB for ; Wed, 14 Aug 2013 10:28:50 +0000 (UTC) Received: (qmail 48376 invoked by uid 500); 14 Aug 2013 10:28:50 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 48204 invoked by uid 500); 14 Aug 2013 10:28:49 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 48069 invoked by uid 99); 14 Aug 2013 10:28:49 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Aug 2013 10:28:49 +0000 Date: Wed, 14 Aug 2013 10:28:49 +0000 (UTC) From: =?utf-8?Q?Per_J=C3=B8rgen_Walstr=C3=B8m_=28JIRA=29?= To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CAMEL-6636) HttpClient 4.3 sets a global port to be re-used by endpoints that do not have port defined MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Per J=C3=B8rgen Walstr=C3=B8m created CAMEL-6636: ------------------------------------------ Summary: HttpClient 4.3 sets a global port to be re-used by en= dpoints that do not have port defined Key: CAMEL-6636 URL: https://issues.apache.org/jira/browse/CAMEL-6636 Project: Camel Issue Type: Bug Components: camel-http Affects Versions: 2.11.0 Reporter: Per J=C3=B8rgen Walstr=C3=B8m two routes within the same camel-context are configured as shown below. The= y post to two different URLs; route1 stating no port (implicitly, this shou= ld mean port 80) and route2 stating port 81. During start-up, the following is logged {{ 12:06:52.316 [main] INFO o.a.c.component.http4.HttpComponent - Registering= PLAIN scheme http4 on port 80 12:06:52.372 [main] INFO o.a.c.component.http4.HttpComponent - Registering= PLAIN scheme http4 on port 81 }} when the post is actually done, the following is logged {{ 12:18:46.437 [Camel (d-2) thread #8 - Threads] DEBUG o.a.h.i.c.DefaultClien= tConnectionOperator - Connecting to bar.com:81 12:18:46.465 [Camel (d-2) thread #7 - Threads] DEBUG o.a.h.i.c.DefaultClien= tConnectionOperator - Connecting to example.com:81 }} Port 81 is re-used also for route1. There are some workarounds for this: - the order of the route configuration is significant. If route2 was config= ured before route1, everything would work ok - if we explicitly set port 80 in route1 (example.com:80), everything works= fine The DefaultClientConnectionOperator.openConnection() finds the port from th= e registry.getScheme(target.getSchemeName()) which returns port 81. This is= used as default port if no port is set. The DefaultClientConnectionOperator is deprecated in 4.3, you may want to u= se PoolingHttpClientConnectionManager (don't know if this solves the proble= m, though). Or maybe this is not a Camel problem but a HttpClient bug? {quote} from("activemq:topic:foo") .routeId("route1") .threads() =20 .setHeader(HTTP_METHOD, constant("POST")) .to("http4://example.com"); from("activemq:topic:foo") .routeId("route2") .threads() =20 .setHeader(HTTP_METHOD, constant("POST")) .to("http4://bar.com:81"); {quote} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira