my Encoder:
protected Object encode(
ChannelHandlerContext ctx, Channel channel, Object msg) throws
Exception {
if (!(msg instanceof String)) {
return msg;//(1)
}
System.out.println("IN INCODE:" + msg);
buf.writeBytes(data); //6bytes
return buf;//(3)
}
my camelContext:
SimpleRegistry registry = new SimpleRegistry();
registry.put("myEncoder", encoder);
CamelContext context = new DefaultCamelContext(registry);
my routeBuilder:
context.addRoutes(new RouteBuilder() {
public void configure() throws Exception {
from("direct:cpsp")
.process(new MyToProcessor())
.to("netty:tcp://localhost:6789?sync=true")
.process(new MyFromProcessor());
}
});
why my server recved 9bytes??
and how camel know the encoder i put in DefaultCamelContext?
--
View this message in context:
http://camel.465427.n5.nabble.com/in-netty-why-sended-6bytes-but-server-recved-9bytes-tp5131271p5131271.html
Sent from the Camel - Users mailing list archive at Nabble.com.