CORAL WIKI

KafkaConsumerActor

The KafkaConsumerActor (Kafka consumer actor) is a Coral Actor that can emits incoming Kafka messages as JSON message.

Creating a KafkaConsumerActor

The creation JSON of the KafkaConsumerActor (see Coral Actor) has "type": "kafka-consumer". The params value is a JSON with the following field:

field type required description
topic string yes the Kafka bus topic to read
kafka map yes a set of kafka properties for the consumer

The properties of the kafka attribute should include at least the following:

field type required description
group.id string yes the unique identifier to read a stream (do not use the same name simultaneously for different instances)
zookeeper.connect string yes the ip address(es) of the zookeeper node(s) to connect to

Other properties may be supplied cf. the Kafka consumer properties.

Example

{
  "data": {
    "type": "actors",
    "attributes": {
      "type": "kafka-consumer",
      "params": {
        "topic": "clickstream",
        "kafka": {
          "zookeeper.connect": "localhost:2181",
          "group.id": "mygroup"
        }
      }
    }
  }
}

Trigger

The KafkaConsumerActor has no trigger. Conceptually, the Kafka stream can be thought of as trigger.

Emit

The KafkaConsumerActor emits Kafka messages as JSON. Message bodies are assumed to be in proper JSON format.

State

The KafkaConsumerActor keeps no state.

Collect

The KafkaConsumerActor does not collect state from other actors.

Timer

The KafkaConsumerActor does not provide timer actions.