Reading an individual message from a Kafka topic
You can use the KafkaRead node to read an individual message published on a Kafka topic, by specifying the offset position of the message in the topic.
Before you begin
About this task
You can use a KafkaRead node to help with error processing in a Kafka flow. For example, if the processing of a message fails in a Kafka consumer message flow, you can use the KafkaRead node to reprocess that individual message. You can also use a KafkaRead node in a flow with a Timer node to control the processing of a range of messages in a partition on a topic. For more information, see Processing Kafka messages.
You can specify a message in a partition on a Kafka topic, by using the partition property on the KafkaRead node. For more information about partitions in Kafka topics, see the Apache Kafka documentation.
For more information about subscribing to topics on a Kafka server by using a KafkaConsumer node, see Consuming messages from Kafka topics. For more information about publishing messages to a Kafka topic by using a KafkaProducer node, see Producing messages on Kafka topics.
By default, if the message at the specified offset is not available, the input message is sent to the No match terminal. Alternatively, you can choose to read either the earliest or the latest message in the partition if the specified message is unavailable, by setting one of those values in the Action when message unavailable property of the KafkaRead node. You can also override this value dynamically by using the mqsiapplybaroverride command.
You can configure the KafkaRead by using the Isolation Level property on the Transactionality tab to wait for uncommitted messages to be committed before returning the message. If the message is not committed before the timeout expires, the node operates in the same way as for messages that do not exist.
Procedure
Complete the following steps to read an individual message that is published on a Kafka topic: