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 41827108C5 for ; Wed, 14 Aug 2013 10:34:51 +0000 (UTC) Received: (qmail 52314 invoked by uid 500); 14 Aug 2013 10:34:49 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 52257 invoked by uid 500); 14 Aug 2013 10:34: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 52242 invoked by uid 99); 14 Aug 2013 10:34:48 -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:34:48 +0000 Date: Wed, 14 Aug 2013 10:34:48 +0000 (UTC) From: "Claus Ibsen (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (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 [ https://issues.apache.org/jira/browse/CAMEL-6636?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen resolved CAMEL-6636. -------------------------------- Resolution: Duplicate Assignee: Claus Ibsen Duplicate of CAMEL-6078 =20 > HttpClient 4.3 sets a global port to be re-used by endpoints 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 > Assignee: Claus Ibsen > > two routes within the same camel-context are configured as shown below. T= hey post to two different URLs; route1 stating no port (implicitly, this sh= ould 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 - Registeri= ng PLAIN scheme http4 on port 80 > 12:06:52.372 [main] INFO o.a.c.component.http4.HttpComponent - Registeri= ng 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.DefaultCli= entConnectionOperator - Connecting to bar.com:81 > 12:18:46.465 [Camel (d-2) thread #7 - Threads] DEBUG o.a.h.i.c.DefaultCli= entConnectionOperator - 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 conf= igured before route1, everything would work ok > - if we explicitly set port 80 in route1 (example.com:80), everything wor= ks fine > The DefaultClientConnectionOperator.openConnection() finds the port from = the 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= use PoolingHttpClientConnectionManager (don't know if this solves the prob= lem, 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