The KafkaConsumerActor
(Kafka consumer actor) is a Coral Actor that listens to a Kafka topic and emits incoming Kafka messages as JSON messages.
The KafkaConsumerActor has "type": "kafka-consumer"
. The params
value is a JSON with the following fields:
field | type | required | description |
---|---|---|---|
topic |
string | yes | the Kafka topic to read |
kafka : group.id |
string | yes | the unique identifier to read a stream. |
kafka : zookeeper.connect |
string | yes | the ip address(es) of the ZooKeeper node(s) to connect to. |
Other supplied properties will be interpreted as Kafka consumer properties, if the field matches a Kafka consumer property.
The group.id
is a unique identifier that Kafka uses to memorize the offset in the topic the actor listens to. For instance, if a Kafka consumer actor has listened to 100 messages from the start using group.id
“mygroup”, any other Kafka consumer actor with the same group.id
will start from message 101. If another group.id
is chosen, the offset is set to 0.
The KafkaConsumerActor
has no trigger, but is triggered by incoming Kafka events on the topic the actor listens to.
The KafkaConsumerActor
emits Kafka messages as JSON objects. Message bodies of Kafka events are assumed to be in proper JSON format.
The KafkaConsumerActor
keeps no state.
The KafkaConsumerActor
does not collect state from other actors.
The KafkaConsumerActor
does not provide timer actions.