Producing messages on Kafka topics
You can use the KafkaProducer node to connect to the Kafka messaging system and publish messages on Kafka topics.
Before you begin
About this task
You can use the KafkaProducer node to publish messages that are generated from within your message flow to a topic that is hosted on a Kafka server. The published messages are then available to be received by consumers (subscribers) reading from the topic.
You can use a KafkaConsumer node in a message flow to subscribe to a specified topic on a Kafka server. You can also use a KafkaRead node to read an individual message on a specified topic. For more information about using these nodes, see Consuming messages from Kafka topics and Reading an individual message from a Kafka topic.
The KafkaProducer node publishes messages non-transactionally to the Kafka server, and they are available to be read by consuming applications as soon as they are published. Because the publish operation is non-transactional, if the flow is rolled back after the message passes through the KafkaProducer node, the publication of the message to the Kafka server is not rolled back. However, you can use the Acks property on the KafkaProducer node to configure synchronous processing of the message, by specifying that the KafkaProducer node must wait for confirmation that the message was successfully received by the Kafka server before continuing in the flow. The options that you can specify for the Acks property are described in the steps of this task topic.
You can use Kafka custom header properties to add metadata to Kafka messages for use
during message processing. These properties are set in the LocalEnvironment, in a folder called
KafkaHeader
. For more information, see Setting and retrieving Kafka custom header properties.
Procedure
Complete the following steps to use IBM App Connect Enterprise to publish messages to a topic on a Kafka server: