You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by xiangqiuzhao <xi...@gmail.com> on 2012/04/16 08:22:57 UTC

why decoder called when netty component stopping?

14:03:26.944 [main] DEBUG o.a.c.i.DefaultExecutorServiceStrategy -
ShutdownNow ExecutorService:
java.util.concurrent.Executors$FinalizableDelegatedExecutorService@140984b
14:03:26.944 [main] INFO  o.a.c.impl.DefaultInflightRepository - Shutting
down with no inflight exchanges.
14:03:26.944 [main] DEBUG o.a.c.impl.SharedProducerServicePool - Stopping
service pool: org.apache.camel.impl.SharedProducerServicePool@15db314
14:03:26.944 [main] DEBUG o.a.c.component.netty.NettyProducer - Stopping
producer at address: localhost:6789
14:03:26.961 [main] INFO  com.sunyard.camel.LengthDecoder - in Length
decoder:0
readable not enough

CamelContext context = new DefaultCamelContext(registry);
from("direct://local").to("netty:tcp://localhost:6789?encoders=#myEncoders&decoders=myDecoders&sync=true")
//...
context.stop();

MyDecoder's decode method:

LOG.info("in Length decoder:" + buffer.readableBytes());

when the context stop, the log output "LengthDecoder - in Length decoder:0"
.why the decoder be called?


--
View this message in context: http://camel.465427.n5.nabble.com/why-decoder-called-when-netty-component-stopping-tp5643027p5643027.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: why decoder called when netty component stopping?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

It could be Netty doing this, when its being stopped. Check the stop
logic in Camel and Netty.
I suggest to use a debugger and set a breakpoint in your decode, and
then see what is going on when its stopping.


On Mon, Apr 16, 2012 at 8:22 AM, xiangqiuzhao <xi...@gmail.com> wrote:
> 14:03:26.944 [main] DEBUG o.a.c.i.DefaultExecutorServiceStrategy -
> ShutdownNow ExecutorService:
> java.util.concurrent.Executors$FinalizableDelegatedExecutorService@140984b
> 14:03:26.944 [main] INFO  o.a.c.impl.DefaultInflightRepository - Shutting
> down with no inflight exchanges.
> 14:03:26.944 [main] DEBUG o.a.c.impl.SharedProducerServicePool - Stopping
> service pool: org.apache.camel.impl.SharedProducerServicePool@15db314
> 14:03:26.944 [main] DEBUG o.a.c.component.netty.NettyProducer - Stopping
> producer at address: localhost:6789
> 14:03:26.961 [main] INFO  com.sunyard.camel.LengthDecoder - in Length
> decoder:0
> readable not enough
>
> CamelContext context = new DefaultCamelContext(registry);
> from("direct://local").to("netty:tcp://localhost:6789?encoders=#myEncoders&decoders=myDecoders&sync=true")
> //...
> context.stop();
>
> MyDecoder's decode method:
>
> LOG.info("in Length decoder:" + buffer.readableBytes());
>
> when the context stop, the log output "LengthDecoder - in Length decoder:0"
> .why the decoder be called?
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/why-decoder-called-when-netty-component-stopping-tp5643027p5643027.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/