Hi all,
We are busy upgrading our server product to use MINA 2.0 but that exercise is
part of a broader refactoring exercise that will take a while longer. In the
meantime I just want to check that we are using an acceptable initialization
strategy for our MINA 1.1.7 usage. In the docs, it says that one should never
use the default threading model but that in fact we should set it to manual. We
currently do not do this, and I wonder if anybody could indicate whether this
will be problematic for us:
...
ByteBuffer.setUseDirectBuffers(false);
ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
acceptor = new SocketAcceptor();
SocketAcceptorConfig cfg = new SocketAcceptorConfig();
cfg.getFilterChain().addLast("handshake", new HandshakeFilter());
cfg.getFilterChain().addLast("tunnel", new TunnelFilter());
ProtocolCodecFilter codec = new ProtocolCodecFilter(new
HttpServerProtocolCodecFactory());
cfg.getFilterChain().addLast("httpcodec", codec);
ControlServerHandler handler = new ControlServerHandler();
handler.setApplicationContext(channelController.getApplicationContext());
handler.setChannelController(channelController);
handler.setControlChannelTimeout(ccTimeout);
log.info("Starting control channel server socket on port " + port);
acceptor.bind(new InetSocketAddress(port), handler, cfg);
...
Ignoring the stuff specific to our app, like the custom filters and that
ControlServerHandler.setChannelController() etc, when I look in the VM thread
list, I see the typical AnonymousIoService-1..16 but I read somewhere that this
could mean an unoptimal configuration (can't find where that was now unf.).
When I look at the threads in JVisualVM, I notice that the AnonymousIoService
threads are generally in WAIT state with only one or two showing 'green' blocks
(i.e. RUNNING) every now and again, even though there *should* be activity from
a number of remote socket connections. So I'm concerned that we're not setting
things up correctly. Is the above configuration appropriate for 1.1.7 usage?
Any feedback would be greatly appreciated.
Warm Regards,
Darryl Pentz