If you cant wait for the new mina component you will have to write your own
camel component to do this - at least that is what I ended up doing!
Im new to camel so what I did cannot have the best implementation strategy,
so I will probably replace with the mentioned mina2 component. However a
brief explanation of what I did is below that may be of some help to you:

An example config is below:

<camelContext xmlns="http://camel.apache.org/schema/spring"; trace="false">
    <route id="Client2Server">
      <from
uri="myTCPComp://localhost:11111?respEp=respPathOut&amp;bufferSize=8192"/>
      <log message="Msg from Client to
Server................................" />
      <to
uri="myTCPComp://localhost:22222?respEp=vm:respPathIn&amp;bufferSize=8192"/>
    </route>

    <route id="Server2Client">
      <from uri="vm:respPathIn"/>
      <log message="Msg from Server to Client
................................" />
      <to uri="vm:respPathOut"/>
    </route>
  </camelContext>

The 'myTCPComp' consumer creates a TCP Server on localhost:11111. This also
creates another consumer for the responses - here respPathOut. Any messages
received by vm:respPathOut is returned to the TCP client.
The 'myTCPComp' producer creates a TCP client connecting on localhost:22222.
Any responses will be written to vm:respPathIn.

Also if no manipulation is required for the return messages, and I dont set
the respEp parameter on the uri my code uses a default endpoint for the
responses (so the endpoint vm:default is created by the camel consumer and
messages sent to it from the camel producer. Giving just...

<camelContext xmlns="http://camel.apache.org/schema/spring"; trace="false">
    <route id="Client2Server">
      <from uri="myTCPComp://localhost:11111"/>
      <log message="Msg from Client to
Server................................" />
      <to uri="myTCPComp://localhost:22222"/>
    </route>
</camelContext>

Which will do the same as the first example without the response log message
being written.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Single-request-with-multiple-replies-over-TCP-tp5022206p5157169.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to