Class KafkaQueueFactory<T extends KafkaQueue<ID,​DATA>,​ID,​DATA>

    • Constructor Detail

      • KafkaQueueFactory

        public KafkaQueueFactory()
    • Method Detail

      • getDefaultBootstrapServers

        public String getDefaultBootstrapServers()
        Default Kafka bootstrap server list (format host1:9092,host2:port2,host3:port3), passed to all queues created by this factory.
        Returns:
        Since:
        0.6.2
      • setDefaultBootstrapServers

        public void setDefaultBootstrapServers​(String defaultBootstrapServers)
        Default Kafka bootstrap server list (format host1:9092,host2:port2,host3:port3), passed to all queues created by this factory.
        Parameters:
        defaultBootstrapServers -
        Since:
        0.6.2
      • getDefaultTopicName

        public String getDefaultTopicName()
        Default name of Kafka topic to store queue messages, passed to all queues created by this factory.
        Returns:
        Since:
        0.6.2
      • setDefaultTopicName

        public void setDefaultTopicName​(String defaultTopicName)
        Default name of Kafka topic to store queue messages, passed to all queues created by this factory.
        Parameters:
        defaultTopicName -
        Since:
        0.6.2
      • getDefaultConsumerGroupId

        public String getDefaultConsumerGroupId()
        Default Kafka group-id to consume messages, passed to all queues created by this factory.
        Returns:
        Since:
        0.6.2
      • setDefaultConsumerGroupId

        public void setDefaultConsumerGroupId​(String defaultConsumerGroupId)
        Default Kafka group-id to consume messages, passed to all queues created by this factory.
        Parameters:
        defaultConsumerGroupId -
        Since:
        0.6.2
      • getDefaultProducerType

        public com.github.ddth.kafka.KafkaClient.ProducerType getDefaultProducerType()
        Default Kafka's producer type, used to send messages (default KafkaClient.ProducerType.LEADER_ACK), passed to all queues created by this factory.
        Returns:
      • setDefaultProducerType

        public void setDefaultProducerType​(com.github.ddth.kafka.KafkaClient.ProducerType defaultProducerType)
        Default Kafka's producer type, used to send messages (default KafkaClient.ProducerType.LEADER_ACK), passed to all queues created by this factory.
        Parameters:
        defaultProducerType -
      • getDefaultProducerProps

        public Properties getDefaultProducerProps()
        Default custom configuration properties for Kafka producer, passed to all queues created by this factory.
        Returns:
      • setDefaultProducerProps

        public void setDefaultProducerProps​(Properties defaultProducerProps)
        Default custom configuration properties for Kafka producer, passed to all queues created by this factory.
        Parameters:
        defaultProducerProps -
      • getDefaultConsumerProps

        public Properties getDefaultConsumerProps()
        Default custom configuration properties for Kafka consumer, passed to all queues created by this factory.
        Returns:
      • setDefaultConsumerProps

        public void setDefaultConsumerProps​(Properties defaultConsumerProps)
        Default custom configuration properties for Kafka consumer, passed to all queues created by this factory.
        Parameters:
        defaultConsumerProps -
      • isDefaultSendAsync

        public boolean isDefaultSendAsync()
        Should messages sent to Kafka asynchronously (default true)?
        Returns:
        Since:
        0.6.2
      • getDefaultSendAsync

        public boolean getDefaultSendAsync()
        Should messages sent to Kafka asynchronously (default true)?
        Since:
        0.6.2
      • setDefaultSendAsync

        public void setDefaultSendAsync​(boolean defaultSendAsync)
        Should messages sent to Kafka asynchronously (default true)?
        Parameters:
        defaultSendAsync -
        Since:
        0.6.2
      • getDefaultKafkaClient

        protected com.github.ddth.kafka.KafkaClient getDefaultKafkaClient()
        If all KafkaQueue instances are connecting to one Kafka broker, it's a good idea to pre-create a KafkaClient instance and share it amongst KafkaQueue instances created from this factory by assigning it to defaultKafkaClient (see setDefaultKafkaClient(KafkaClient)).
        Returns:
        Since:
        0.7.1
      • setDefaultKafkaClient

        protected KafkaQueueFactory<T,​ID,​DATA> setDefaultKafkaClient​(com.github.ddth.kafka.KafkaClient kafkaClient,
                                                                                 boolean setMyOwnKafkaClient)
        If all KafkaQueue instances are connecting to one Kafka broker, it's a good idea to pre-create a KafkaClient instance and share it amongst KafkaQueue instances created from this factory by assigning it to defaultKafkaClient (see setDefaultKafkaClient(KafkaClient)).
        Parameters:
        kafkaClient -
        setMyOwnKafkaClient -
        Returns:
        Since:
        0.7.1