Below is what I found that seems to work, with one issue that I can't yet
figure out:

After sending some test data into my application, and when I subsequently
use *VisualVM* to examine this Camel JMX MBean route, it always shows all
exchanges as *InflightExchanges* (i.e. the exchanges never show as
CompletedExchanges).

Any thoughts on how to debug this issue?

  Thanks, SteveR


        // I extract the remote address in my processor, get the remote host
and remote port,
        // and set them as input headers on the exchange.

        Message inMsg = exchange.getIn();
        String remoteAddress =
inMsg.getHeader(NettyConstants.NETTY_REMOTE_ADDRESS).toString();
        String[] remoteAddressParts = remoteAddress.split(":");
        String remoteHost = remoteAddressParts[0].replace("/", "");
        String remotePort = remoteAddressParts[1];
        inMsg.setHeader("REMOTE_HOST_IP", remoteHost);
        inMsg.setHeader("REMOTE_PORT_NUMBER", remotePort);


        // This in my route, I use recipientList EIP and the simple language
to dynamically add them to the netty URI.

        from(ackQueueURI)
                .setExchangePattern(ExchangePattern.InOnly)
                .routeId(ackQueueRouteId)
                .startupOrder(ackQueueRouteStartupOrder)
                .setProperty(Exchange.CHARSET_NAME,
ExpressionBuilder.constantExpression(charsetName))
                .threads(threadPoolSize /*poolSize*/, threadPoolSize * 2 
/*maxPoolSize*/)
                        .threadName("threads_" + sourceRouteId + "_ACK_QUEUE")
                .process(cqmsAckBackProcessor)
                        .id(cqmsAckBackProcessorId)
                .recipientList( // See
http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
                        simple(
                                "netty:udp://${header.REMOTE_HOST_IP}:" +
                                "${header.REMOTE_PORT_NUMBER}?" +
                        
"clientPipelineFactory=#CLIENT_PIPELINE_FACTORY_ROUTE_ID_RAW_CQMS_EVENTS&" +
                                
"sendBufferSize=26214400&allowDefaultCodec=false"
                        )
                )
        .end();



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-netty-How-to-send-UDP-reply-based-on-NETTY-REMOTE-ADDRESS-tp5773044p5773077.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to