You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by chadkelly <ch...@gmail.com> on 2015/12/08 20:47:16 UTC
Does Camel support full duplex (bidirectional) asynchronous routes?
I am attempting to configure Apache Camel 6.1.0 support full duplex
(bidirectional) asynchronous routes for both UDP and TCP using Netty4. The
requirement is for numerous (20+) existing systems (non-Camel) get proxy by
Camel. The custom protocols are not supported by Camel, and nor is it a
necessary to have Camel support them. Some articles discuss that older
versions of Camel do not support this requirement. If so, can someone advise
me where to find custom solutions to make Camel support this requirement?
(non-Camel TCP client port 7000) <--> (Camel/Netty) <--> (non-Camel TCP
client port 7001)
For a specific example, I want to communicate bidirectional between two
consoles running netcat (Linux command line utility). My blueprint is show
below. However, in all the cases attempted, I cannot get the blueprint to
function per the stated requirements.
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<bean id="shutdown" class="org.apache.camel.impl.DefaultShutdownStrategy">
<property name="timeout" value="5" />
</bean>
<bean id="byteArrayDecoderTCP1"
class="org.apache.camel.component.netty4.ChannelHandlerFactories"
factory-method="newByteArrayDecoder">
<argument value="tcp" />
</bean>
<bean id="byteArrayEncoderTCP1"
class="org.apache.camel.component.netty4.ChannelHandlerFactories"
factory-method="newByteArrayEncoder">
<argument value="tcp" />
</bean>
<bean id="byteArrayDecoderTCP2"
class="org.apache.camel.component.netty4.ChannelHandlerFactories"
factory-method="newByteArrayDecoder">
<argument value="tcp" />
</bean>
<bean id="byteArrayEncoderTCP2"
class="org.apache.camel.component.netty4.ChannelHandlerFactories"
factory-method="newByteArrayEncoder">
<argument value="tcp" />
</bean>
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<endpoint id="endpoint1"
uri="netty4:tcp://localhost:7000?decoder=#byteArrayDecoderTCP1&encoder=#byteArrayEncoderTCP1&sync=false&disconnect=false"
/>
<endpoint id="endpoint2"
uri="netty4:tcp://localhost:7001?decoder=#byteArrayDecoderTCP2&encoder=#byteArrayEncoderTCP2&sync=false&disconnect=false"
/>
<route id="route1">
<from ref="endpoint1" />
<log message="in11: ${in.body} " loggingLevel="INFO" />
<to ref="endpoint2" />
<log message="in12: ${in.body} " loggingLevel="INFO" />
</route>
<route id="route2">
<from ref="endpoint2" />
<log message="in22: ${in.body} " loggingLevel="INFO" />
<to ref="endpoint1" />
<log message="in21: ${in.body} " loggingLevel="INFO" />
</route>
</camelContext>
</blueprint>
--
View this message in context: http://camel.465427.n5.nabble.com/Does-Camel-support-full-duplex-bidirectional-asynchronous-routes-tp5774839.html
Sent from the Camel - Users mailing list archive at Nabble.com.