avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From YOSHIHARA Tadafumi <ta...@outlook.com>
Subject RE: NettyTransceiver Constructor
Date Tue, 29 Oct 2013 08:11:04 GMT

I solved the problem by using another NettyTransceiver constructor:

NettyTransceiver(InetSocketAddress addr, org.jboss.netty.channel.ChannelFactory channelFactory)

Creation of ChannelFactory is like this.

ChannelFactory cf = new NioClientSocketChannelFactory(
          new ThreadPoolExecutor(0, Integer.MAX_VALUE,
                                 1L, TimeUnit.SECONDS,
                                 new SynchronousQueue<Runnable>()),
          new ThreadPoolExecutor(0, Integer.MAX_VALUE,
                                 1L, TimeUnit.SECONDS,
                                 new SynchronousQueue<Runnable>()));

Finally, I call cf.shutdown() before the main thread exits.
And the application process terminates immediately after the main method finishes.

I am not sure how long the keepAlive of ThreadPoolExecutor(default is 60 seconds) should be.
But I need to control the value myself anyway.

View raw message