private void configureServerRuntime(DoctorKafkaAppConfig configuration, DoctorKafkaConfig config) { DefaultServerFactory defaultServerFactory = (DefaultServerFactory) configuration.getServerFactory(); // Disable gzip compression for HTTP, this is required in-order to make // Server-Sent-Events work, else due to GZIP the browser waits for entire chunks // to arrive thereby the UI receiving no events // We are programmatically disabling it here so it makes it easy to launch // Firefly GzipHandlerFactory gzipHandlerFactory = new GzipHandlerFactory(); gzipHandlerFactory.setEnabled(false); defaultServerFactory.setGzipFilterFactory(gzipHandlerFactory); // Note that if someone explicitly enables gzip in the Dropwizard config YAML // then // this setting will be over-ruled causing the UI to stop working // Disable HTTP request logging LogbackAccessRequestLogFactory accessRequestLogFactory = new LogbackAccessRequestLogFactory(); accessRequestLogFactory.setAppenders(ImmutableList.of()); defaultServerFactory.setRequestLogFactory(accessRequestLogFactory); // Disable admin connector defaultServerFactory.setAdminConnectors(ImmutableList.of()); // Configure bind host and port number HttpConnectorFactory application = (HttpConnectorFactory) HttpConnectorFactory.application(); application.setPort(config.getWebserverPort()); defaultServerFactory.setApplicationConnectors(Collections.singletonList(application)); }