use of com.wavefront.agent.listeners.RawLogsIngesterPortUnificationHandler in project java by wavefrontHQ.
the class PushAgent method startRawLogsIngestionListener.
@VisibleForTesting
protected void startRawLogsIngestionListener(int port, LogsIngester logsIngester) {
String strPort = String.valueOf(port);
if (proxyConfig.isHttpHealthCheckAllPorts())
healthCheckManager.enableHealthcheck(port);
ChannelHandler channelHandler = new RawLogsIngesterPortUnificationHandler(strPort, logsIngester, hostnameResolver, tokenAuthenticator, healthCheckManager, preprocessors.get(strPort));
startAsManagedThread(port, new TcpIngester(createInitializer(channelHandler, port, proxyConfig.getRawLogsMaxReceivedLength(), proxyConfig.getRawLogsHttpBufferSize(), proxyConfig.getListenerIdleConnectionTimeout(), getSslContext(strPort), getCorsConfig(strPort)), port).withChildChannelOptions(childChannelOptions), "listener-logs-raw-" + port);
logger.info("listening on port: " + strPort + " for raw logs");
}
use of com.wavefront.agent.listeners.RawLogsIngesterPortUnificationHandler in project java by wavefrontHQ.
the class LogsIngesterTest method setup.
private void setup(LogsIngestionConfig config) throws IOException, GrokException, ConfigurationException {
logsIngestionConfig = config;
// HACK: Never call flush automatically.
logsIngestionConfig.aggregationIntervalSeconds = 10000;
logsIngestionConfig.verifyAndInit();
mockPointHandler = createMock(ReportableEntityHandler.class);
mockHistogramHandler = createMock(ReportableEntityHandler.class);
mockFactory = createMock(ReportableEntityHandlerFactory.class);
expect((ReportableEntityHandler) mockFactory.getHandler(HandlerKey.of(ReportableEntityType.POINT, "logs-ingester"))).andReturn(mockPointHandler).anyTimes();
expect((ReportableEntityHandler) mockFactory.getHandler(HandlerKey.of(ReportableEntityType.HISTOGRAM, "logs-ingester"))).andReturn(mockHistogramHandler).anyTimes();
replay(mockFactory);
logsIngesterUnderTest = new LogsIngester(mockFactory, () -> logsIngestionConfig, null, now::get, nanos::get);
logsIngesterUnderTest.start();
filebeatIngesterUnderTest = new FilebeatIngester(logsIngesterUnderTest, now::get);
rawLogsIngesterUnderTest = new RawLogsIngesterPortUnificationHandler("12345", logsIngesterUnderTest, x -> "testHost", TokenAuthenticatorBuilder.create().build(), new NoopHealthCheckManager(), null);
}
Aggregations