Skip to main content

Consumers in the Schema

In our example schema, we have a single consumer named new-orders-consumer, of type kafka.

{
"name": "new-orders-consumer",
"type": "kafka",
"eventDispatcher": "new-order-dispatcher",
"config": {
"groupId": "group-id-1",
"topics": "new-orders",
"fromBeginning": true
}
}

It's event dispatcher is new-order-dispatcher.

An event dispatcher is responsible for taking in a Kafka message and mapping it into a structure the engine can understand.

If you check the code you can see how the kafka message comes in and how we translate it into a Gallifrey Rules event.

Under each consumer you have a config which might be different for different types of consumers. In this example, it's of type interface KafkaConsumerConfig