You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by SteveR <sr...@vonage.com> on 2015/12/16 18:09:26 UTC

Easiest way to send a reply via camel-netty4:udp socket?

- I have a Camel input route whereby camel-netty4 creates/binds a UDP socket
that listens on port 12345: 

*    from("netty4:udp://host:12345? ...)
        .to("SEDA_QUEUE1" ...);*

- The input route receives a UDP datagram, creates the exchange, and sends
it to *SEDA_QUEUE1*.

- Then the exchange from *SEDA_QUEUE1* is sent to some other queue (e.g.
*SEDA_QUEUE2*) which has a processor that formulates a UDP exchange message
that I want to send back as a reply message via the input route's UDP
socket.

This reply exchange has the *CamelNettyLocalAddress* and
*CamelNettyRemoteAddress *headers containing the associated local/remote IP
and port.

How, from a processor within the route consuming from *SEDA_QUEUE2*, do I
send the reply out the UDP socket on the input route?  There was to be an
easy way to do this, but I'm not seeing it.

  Thanks, SteveR


I've been trying with code similar to this within a processor on the
*SEDA_QUEUE2*, but no luck so far:

	ProducerTemplate template = context.createProducerTemplate();
	Endpoint endpoint = context.getEndpoint("netty4:udp ...");
	Exchange replyExchange = endpoint.createExchange();
	replyExchange.getIn().setBody("UDP REPLY MESSAGE");
	replyExchange.getIn().setHeaders(exchange.getIn().getHeaders());
	template.send(endpoint, replyExchange);












--
View this message in context: http://camel.465427.n5.nabble.com/Easiest-way-to-send-a-reply-via-camel-netty4-udp-socket-tp5775186.html
Sent from the Camel - Users mailing list archive at Nabble.com.