This example demonstrates how messages are read from a
Kafka topic, and how the selected output documents are sent to the downstream Mapper
view.
Download this pipeline
-
Configure the Kafka Consumer Snap. First, we configure the Kafka Consumer Snap
to read the messages from the topic Sample_Topic under the Group ID
consumergroup. We select the Output Mode as One output
document per batch, because we want to view the output records in
batches.
-
Validate the Consumer output. After validation, we can view the output preview
of the Kafka Consumer Snap as follows:
-
-
Configure the Mapper Snap. We use the Mapper Snap to display only those fields
that we require in the output view. Note that we set the Mapping root to
$batch[*] to map the fields of each record in the batch.
Hence, we configure the Mapper Snap as shown below:
-
View the Mapper output. Upon successful execution, we see the output preview
of the Mapper Snap as follows:
- Ensure the Kafka Consumer Snap is connected to the Mapper Snap output view.
- Verify that the Mapping root is correctly set to
$batch[*] in the Mapper Snap.
- Validate that the Kafka Consumer produces batched output as expected.