pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] david-streamlio commented on a change in pull request #3336: Added HTTP Support
Date Wed, 09 Jan 2019 15:52:46 GMT
david-streamlio commented on a change in pull request #3336: Added HTTP Support
URL: https://github.com/apache/pulsar/pull/3336#discussion_r246435001
 
 

 ##########
 File path: pulsar-io/netty/src/main/java/org/apache/pulsar/io/netty/server/NettyServer.java
 ##########
 @@ -108,6 +116,22 @@ private void runTcp() throws InterruptedException {
         channelFuture.channel().closeFuture().sync();
     }
 
+    private void runHttp() throws InterruptedException {
+        bossGroup = new NioEventLoopGroup(this.numberOfThreads);
+        workerGroup = new NioEventLoopGroup(this.numberOfThreads);
+
+        ServerBootstrap serverBootstrap = new ServerBootstrap();
+        serverBootstrap.group(bossGroup, workerGroup)
+                .channel(NioServerSocketChannel.class)
+                .childHandler(new NettyHttpChannelInitializer(new NettyHttpServerHandler(this.nettySource),
null))
+                .option(ChannelOption.SO_BACKLOG, 1024)
+                .childOption(ChannelOption.SO_KEEPALIVE, true);
+
+        ChannelFuture channelFuture = serverBootstrap.bind(this.host, this.port).sync();
+        channelFuture.channel().closeFuture().sync();
+    }
+
 
 Review comment:
   Actually the runUDP method uses the Bootstrap class while the other two use the ServerBootstrap
class.  I am not sure why that is the case, but it does make the above suggestion a bit more
tricky

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message