Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AC9C318A15 for ; Fri, 11 Dec 2015 21:49:50 +0000 (UTC) Received: (qmail 44624 invoked by uid 500); 11 Dec 2015 21:49:50 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 44578 invoked by uid 500); 11 Dec 2015 21:49:50 -0000 Mailing-List: contact dev-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 dev@camel.apache.org Received: (qmail 44566 invoked by uid 99); 11 Dec 2015 21:49:50 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Dec 2015 21:49:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id BDC7DCC352 for ; Fri, 11 Dec 2015 21:49:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.212 X-Spam-Level: * X-Spam-Status: No, score=1.212 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id jMpPhalevd_F for ; Fri, 11 Dec 2015 21:49:41 +0000 (UTC) Received: from mail-qk0-f171.google.com (mail-qk0-f171.google.com [209.85.220.171]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id C134F429D3 for ; Fri, 11 Dec 2015 21:49:40 +0000 (UTC) Received: by qkdp187 with SMTP id p187so59381585qkd.1 for ; Fri, 11 Dec 2015 13:49:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:from:content-type:in-reply-to:message-id:date:to :content-transfer-encoding:mime-version; bh=ARTS79nhMUc1UVkteEG+4aSpVL7v4ivcv4ryV1sFjq4=; b=m+SJkVX0CjT1FPP0M+CYWSp4R7lzSQKEJC2WvR7ucMeJt4rNPq2eYU2aj4UPdMXvpG ewVJEmCYIZLjMZGNcx2JoKj9CW8nVwuFArPNbFOiJl+kBjUMy9x5T/MHg1hwCnM5BKKU pQVFjmVdK4hft4/2ZZUdGdtzBE++VaSf5ACq2LdopmSWVRtD7/C1XLtjIC9tCHfQVeXj ClwaaFgG+yg4S7Pea6boKmtO0l55f04qe+FB5qDwrIfG6WMqRnq1hTeC57vvxBe+RUbc S1Nohf3HqrGnlUlfSQF/bmKRGuXfqec0W8etF2EYXKJH+X9DkxXXmlWjkf7vhh1NZNjA 8KeQ== X-Received: by 10.55.79.65 with SMTP id d62mr645697qkb.9.1449870580313; Fri, 11 Dec 2015 13:49:40 -0800 (PST) Received: from [10.57.108.146] ([166.170.30.145]) by smtp.gmail.com with ESMTPSA id l124sm8946741qhc.24.2015.12.11.13.49.39 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Dec 2015 13:49:39 -0800 (PST) Subject: Re: Enable camel/netty4 to support full duplex (bidirectional) asynchronous sockets References: <1449796009188-5774972.post@n5.nabble.com> From: Carl Nygard Content-Type: text/plain; charset=utf-8 X-Mailer: iPhone Mail (12F70) In-Reply-To: <1449796009188-5774972.post@n5.nabble.com> Message-Id: Date: Fri, 11 Dec 2015 16:49:38 -0500 To: "dev@camel.apache.org" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Can you just write the Java bidirectional component as a standalone front en= d and let it talk to the two end points in camel? --carl > On Dec 10, 2015, at 8:06 PM, chadkelly wrote: >=20 > Please, can any developers guide me on extending Camel/Netty4 to support f= ull > duplex (bidirectional) asynchronous network communication over the exact > same UDP/TCP port? I need to accomplish this task before XMas with your > generosity and guidance. The target component is Netty4 for both UDP and > TCP. If you know of any existing solution that solves this problem, please= > share, as this issue has much discussion with no published solution. The > requirements cannot change because existing systems (non-Camel) are alread= y > designed to perform asynchronous bidirectional sockets I/O over the single= > established socket (and session for TCP). >=20 > Relevant Camel tickets are already documented here: > https://issues.apache.org/jira/browse/CAMEL-1075 > https://issues.apache.org/jira/browse/CAMEL-2624 >=20 >=20 > Consider the following "invalid" example that attempts to enable a full > duplex asynchronous Camel route between endpoint1 and endpoint2. It > important to notice that this design will cause camel to open 1 tcp sessio= n > for =E2=80=9Cfrom route1 endpoint1=E2=80=9D and 1 tcp session for =E2=80=9C= to route2 endpoint1=E2=80=9D > (i.e. socket bind collision). This violates the one asynchronous > bidirectional socket requirement.=20 >=20 > uri=3D"netty4:tcp://localhost:7000?sync=3Dfalse&disconnect=3Dfalse..."= /> > uri=3D"netty4:tcp://localhost:7001?sync=3Dfalse&disconnect=3Dfalse..."= /> > > > =20 > > > > =20 > >=20 > What is the easiest design to enable this requirement? I prefer to use the= > design of an existing Camel developer, because I am new to Camel. Two > initial design options are presented below: >=20 > Option1 is to add optional seda: or direct: component to the NettyConsumer= > class (if such a thing can be done). For example, endpoint1 and endpoint2 > have a seda: component to enable a producer backchannel.=20 > uri=3D"netty4:tcp://localhost:7000?seda=3DmySeda1&sync=3Dfalse&dis= connect=3Dfalse..." > /> > uri=3D"netty4:tcp://localhost:7001?seda=3DmySeda2&sync=3Dfalse&dis= connect=3Dfalse..." > /> > > > =20 > > > > > >=20 > Option2 is to add optional localhost server to the NettyConsumer class (if= > such a thing can be done). For example, endpoint1 and endpoint2 have a > localhostServerPort to enable a producer backchannel. >=20 > uri=3D"netty4:tcp://localhost:7000?localhostServerPort=3D8000&sync=3Df= alse&disconnect=3Dfalse..." > /> > uri=3D"netty4:tcp://localhost:7001?localhostServerPort=3D8001&sync=3Df= alse&disconnect=3Dfalse..." > /> > > > uri=3D"netty4:tcp://localhost:8001?clientMode=3Dtrue&disconnect=3Dfals= e&sync=3Dfalse..." > />=20 > > > > uri=3D"netty4:tcp://localhost:8000?clientMode=3Dtrue&disconnect=3Dfals= e&sync=3Dfalse..." > /> > >=20 > Does this make sense? I may be typing things that may not make > implementation sense, so please guide me in coming up with any practical > solution that will work in Camel.=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 > -- > View this message in context: http://camel.465427.n5.nabble.com/Enable-cam= el-netty4-to-support-full-duplex-bidirectional-asynchronous-sockets-tp577497= 2.html > Sent from the Camel Development mailing list archive at Nabble.com.