Class KafkaHandler

  • All Implemented Interfaces:
    org.swisspush.gateleen.core.configuration.ConfigurationResourceObserver

    public class KafkaHandler
    extends org.swisspush.gateleen.core.configuration.ConfigurationResourceConsumer
    Handler class for all Kafka related requests. The main responsibilities for this handler are:
    • Manage kafka configuration resource
    • Manage the lifecycle of KafkaProducer based on the kafka configuration resource
    • Convert requests to messages and forward them to kafka
    Author:
    https://github.com/mcweba [Marc-Andre Weber]
    • Constructor Summary

      Constructors 
      Constructor Description
      KafkaHandler​(org.swisspush.gateleen.core.configuration.ConfigurationResourceManager configurationResourceManager, KafkaProducerRepository repository, KafkaMessageSender kafkaMessageSender, java.lang.String configResourceUri, java.lang.String streamingPath)  
      KafkaHandler​(org.swisspush.gateleen.core.configuration.ConfigurationResourceManager configurationResourceManager, KafkaProducerRepository repository, KafkaMessageSender kafkaMessageSender, java.lang.String configResourceUri, java.lang.String streamingPath, java.util.Map<java.lang.String,​java.lang.Object> properties)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean handle​(io.vertx.core.http.HttpServerRequest request)  
      io.vertx.core.Future<java.lang.Void> initialize()  
      boolean isInitialized()  
      void resourceChanged​(java.lang.String resourceUri, io.vertx.core.buffer.Buffer resource)  
      void resourceRemoved​(java.lang.String resourceUri)  
      • Methods inherited from class org.swisspush.gateleen.core.configuration.ConfigurationResourceConsumer

        configResourceUri, configurationResourceManager, schemaResourceName
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KafkaHandler

        public KafkaHandler​(org.swisspush.gateleen.core.configuration.ConfigurationResourceManager configurationResourceManager,
                            KafkaProducerRepository repository,
                            KafkaMessageSender kafkaMessageSender,
                            java.lang.String configResourceUri,
                            java.lang.String streamingPath)
      • KafkaHandler

        public KafkaHandler​(org.swisspush.gateleen.core.configuration.ConfigurationResourceManager configurationResourceManager,
                            KafkaProducerRepository repository,
                            KafkaMessageSender kafkaMessageSender,
                            java.lang.String configResourceUri,
                            java.lang.String streamingPath,
                            java.util.Map<java.lang.String,​java.lang.Object> properties)
    • Method Detail

      • initialize

        public io.vertx.core.Future<java.lang.Void> initialize()
      • isInitialized

        public boolean isInitialized()
      • handle

        public boolean handle​(io.vertx.core.http.HttpServerRequest request)
      • resourceChanged

        public void resourceChanged​(java.lang.String resourceUri,
                                    io.vertx.core.buffer.Buffer resource)
      • resourceRemoved

        public void resourceRemoved​(java.lang.String resourceUri)