Netty Consumer is not able to pick up messagefrom any port sent through simple java socket clinet

Trustin Lee trustin at gmail.com
Tue May 24 10:18:17 EDT 2011


I guess you'd better ask this question to the Camel user forum or contact the actual author.  Netty project does not deliver Camel endpooint implementation.

--
Trustin Lee - http://gleamynode.net/
Sent from a mobile device - please excuse the brevity.

May 24, 2011 11:12 PM "sachin2713 at gmail.com" <sachin2713 at gmail.com> 작성:

> Hi, 
> I am very new to camel and netty, please forgive my stupid mistakes.
> 
> I am using Camel 2.6 along with netty 3.2.3 for tcp communication.
> I am starting an endpoint at server startup which should execute any other
> business processing after receiving message.
> 
> 1) As i dont want to bound clients with netty producer, i have to test
> sending message without netty producer , hence i am using simple java socket
> client to send message to any port.But my processor is not able to pick up
> the message. SHouldnt it be independent of client?
> 
> 2) Though when i try with netty producer , it works fine, but for only once
> in one connection. second time it's not able to pick up message from netty
> producer also, i have to restart my server i.e camel again.
> 
> Below is my code:
> 
> 
> EndPoint in camel-context:
> <endpoint id="ByteStreamTransport"
>            uri="netty:tcp://localhost:6123connectTimeout=5000&amp;sync=false" />
> 
> 
> 
> 
> Java Client:( not complete)
> 
> socket = new Socket();
> socket.connect(new InetSocketAddress("localhost", 9990));
> OutputStream os = socket.getOutputStream();
> ObjectOutputStream oos = new ObjectOutputStream(os);
>                  // oos.writeObject(emp);
>                
> socket.getOutputStream().write(bytes);
> socket.getOutputStream().flush();
> socket.shutdownOutput(
> )
> 
> 
> 
> 
> Netty Consumer:(I can see in logs that netty consumer is bound to this port)
> 
> try {
> NettyConsumer consumer = (NettyConsumer)
> tcpProfile.getEndPoint().createConsumer(new TCPProcessor(this ,tcpProfile));
> consumer.start();                        
> 
> 
> 
> Netty Producer:
> try {
>        
>          context = new DefaultCamelContext(); 
> 
>            context.start(); 
> 
>        Endpoint endpoint =
> context.getEndpoint("netty:tcp://localhost:6123?sync=false");
>        Exchange exchange = endpoint.createExchange(ExchangePattern.InOnly);
>        exchange.getIn().setBody("sachin1");
>        producer = (NettyProducer)endpoint.createProducer();
>        producer.start();            
>        producer.process(exchange);
>        
>                
>    }
>    catch (Exception e) {
>        // TODO Auto-generated catch block
>        e.printStackTrace();
>    }                    }
> 
> 
> --
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Netty-Consumer-is-not-able-to-pick-up-messagefrom-any-port-sent-through-simple-java-socket-clinet-tp6398719p6398719.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users



More information about the netty-users mailing list