diff --git a/services/src/main/java/io/druid/guice/RealtimeModule.java b/services/src/main/java/io/druid/guice/RealtimeModule.java index 276f850049a..ae4ca1319df 100644 --- a/services/src/main/java/io/druid/guice/RealtimeModule.java +++ b/services/src/main/java/io/druid/guice/RealtimeModule.java @@ -31,6 +31,9 @@ import io.druid.segment.realtime.FireDepartment; import io.druid.segment.realtime.NoopSegmentPublisher; import io.druid.segment.realtime.RealtimeManager; import io.druid.segment.realtime.SegmentPublisher; +import io.druid.segment.realtime.firehose.ChatHandlerProvider; +import io.druid.segment.realtime.firehose.NoopChatHandlerProvider; +import io.druid.segment.realtime.firehose.ServiceAnnouncingChatHandlerProvider; import io.druid.server.QueryResource; import io.druid.server.initialization.JettyServerInitializer; import org.eclipse.jetty.server.Server; @@ -57,6 +60,20 @@ public class RealtimeModule implements Module publisherBinder.addBinding("noop").to(NoopSegmentPublisher.class); binder.bind(DbSegmentPublisher.class).in(LazySingleton.class); + PolyBind.createChoice( + binder, + "druid.realtime.chathandler.type", + Key.get(ChatHandlerProvider.class), + Key.get(NoopChatHandlerProvider.class) + ); + final MapBinder handlerProviderBinder = PolyBind.optionBinder( + binder, Key.get(ChatHandlerProvider.class) + ); + handlerProviderBinder.addBinding("announce") + .to(ServiceAnnouncingChatHandlerProvider.class).in(LazySingleton.class); + handlerProviderBinder.addBinding("noop") + .to(NoopChatHandlerProvider.class).in(LazySingleton.class); + JsonConfigProvider.bind(binder, "druid.realtime", RealtimeManagerConfig.class); binder.bind(new TypeLiteral>(){}) .toProvider(FireDepartmentsProvider.class)