apache-kafkakafka-rest

Kafka rest proxy: can I have two consumer instances in one consumer group


I'm using Kafka 0.10 REST proxy service, I have the following questions please:

1, Can I have two consumer instances in the same consume group?

2, How long the timeout of consumer instance once it was created or last used?

3, Is there Java or Python API for using Kafka REST APIs?


Solution

  • 1) yes you can have multiple consumers in the same consumer group

    2) the timeout is set in the configuration parameters for the REST Proxy so this may vary from installation to installation but the default is 5 minutes (300000 ms)

    From the Confluent documentation site https://docs.confluent.io/current/kafka-rest/docs/config.html

    consumer.instance.timeout.ms
    Amount of idle time before a consumer instance is automatically destroyed.
    
    Type: int
    Default: 300000
    

    3) There is no provided Java or Python Wrapper API for using Kafka REST API because most people would just use the native Kafka Java or Python APIs and bypass the extra step of going through a REST Proxy. If that is not an option in your use case then you might search github for third party REST API wrappers in Java or Python. I know there is one in JavaScript for use in browser apps. It should not be too hard to build a Java or Python wrapper on the REST API if one does not already exist.