.setWorkerThreadPoolSize(cConf.getInt(Constants.MessagingSystem.HTTP_SERVER_WORKER_THREADS)) .setExecThreadPoolSize(cConf.getInt(Constants.MessagingSystem.HTTP_SERVER_EXECUTOR_THREADS)) .setHttpChunkLimit(cConf.getInt(Constants.MessagingSystem.HTTP_SERVER_MAX_REQUEST_SIZE_MB) * 1024 * 1024) .setExceptionHandler(new HttpExceptionHandler() { @Override
.setWorkerThreadPoolSize(cConf.getInt(Constants.MessagingSystem.HTTP_SERVER_WORKER_THREADS)) .setExecThreadPoolSize(cConf.getInt(Constants.MessagingSystem.HTTP_SERVER_EXECUTOR_THREADS)) .setHttpChunkLimit(cConf.getInt(Constants.MessagingSystem.HTTP_SERVER_MAX_REQUEST_SIZE_MB) * 1024 * 1024) .setExceptionHandler(new HttpExceptionHandler() { @Override
@Test public void testContentConsumer() throws Exception { HttpHandlerFactory factory = new HttpHandlerFactory("/content", TransactionControl.IMPLICIT); // Create the file upload handler and starts a netty server with it final File outputDir = TEMP_FOLDER.newFolder(); HttpHandler httpHandler = factory.createHttpHandler( TypeToken.of(FileHandler.class), new AbstractDelegatorContext<FileHandler>() { @Override protected FileHandler createHandler() { return new FileHandler(outputDir); } }, new NoopMetricsContext()); // Creates a Netty http server with 1K request buffer NettyHttpService service = NettyHttpService.builder("test-content-consumer") .setHttpHandlers(httpHandler) .setHttpChunkLimit(1024) .build(); service.start(); try { InetSocketAddress bindAddress = service.getBindAddress(); testUpload(outputDir, bindAddress, ""); testUpload(outputDir, bindAddress, "-no-tx"); } finally { service.stop(); } }