use of io.netty.handler.codec.stomp.StompSubframeEncoder in project netty by netty.
the class StompClient method main.
public static void main(String[] args) throws Exception {
EventLoopGroup group = new NioEventLoopGroup();
try {
Bootstrap b = new Bootstrap();
b.group(group).channel(NioSocketChannel.class);
b.handler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) throws Exception {
ChannelPipeline pipeline = ch.pipeline();
pipeline.addLast("decoder", new StompSubframeDecoder());
pipeline.addLast("encoder", new StompSubframeEncoder());
pipeline.addLast("aggregator", new StompSubframeAggregator(1048576));
pipeline.addLast("handler", new StompClientHandler());
}
});
b.connect(HOST, PORT).sync().channel().closeFuture().sync();
} finally {
group.shutdownGracefully();
}
}
Aggregations