Kafka Channel
To send and receive messages from a Kafka broker, use the TIBCO BusinessEvents Kafka channel. The Kafka channel converts the incoming Kafka messages to the BusinessEvents events and outputs BusinessEvents events as outgoing Kafka messages.
Catalog Functions
You can send and receive events with payload in Kafka channel using Event.sendEvent(), and Event.routeTo(). Currently, Kafka does not support synchronous request-reply of messages; thus, the functions Event.requestEvent() and Event.replyEvent() are not supported.
Kafka Properties
In BusinessEvents, you can specify Kafka properties for broker configurations as BusinessEvents properties. Add the prefix be.channel.kafka to Kafka properties to let BusinessEvents identify them as Kafka channel properties. For example, for specifying the default.replication.factor Kafka property, use be.channel.kafka.default.replication.factor. You can also override an existing Kafka property, which has been exposed through the BusinessEvents Studio channel editor, by using the same prefix.
Kafka Channel Serializers
- KafkaMapSerializer
- The KafkaMapSerializer serializer (com.tibco.cep.driver.kafka.serializer.KafkaMapSerializer) encodes the event properties and the payload as a Java serialized HashMap as bytes. The KafkaMapSerializer is used to send and receive events between BusinessEvents instances. For incoming messages the serializer converts the bytes sequence to event and its payload.
- KafkaJsonSerializer
- The KafkaJsonSerializer serializer (com.tibco.cep.driver.kafka.serializer.KafkaJsonSerializer) serializes and deserializes a BusinessEvents event along with its payload into (or from) JSON. For incoming messages, the KafkaXmlSerializer decodes the text from the message as an JSON string and deserializes it to an event. For outgoing events, the serializer converts the event and its payloads into an JSON string. The KafkaXmlSerializer serializer is useful for processing or sending messages between BusinessEvents and external systems.
- KafkaXmlSerializer
- The KafkaXmlSerializer serializer (com.tibco.cep.driver.kafka.serializer.KafkaXmlSerializer) serializes and deserializes a BusinessEvents event along with its payload into (or from) XML. For incoming messages, the KafkaXmlSerializer decodes the text from the message as an XML string and deserializes it to an event. For outgoing events, the serializer converts the event and its payloads into an XML string. The KafkaXmlSerializer serializer is useful for processing or sending messages between BusinessEvents and external systems.
- Kafka Terminology
Apache Kafka™ is a distributed streaming platform. Kafka runs as a cluster in one or more servers. The Kafka cluster stores streams of records in categories called topics. Each record has a key, value, and a timestamp. - Adding a Kafka Channel in BusinessEvents Application
Configure channel properties and destination properties for Kafka channel to successfully add the Kafka channel to the BusinessEvents application. - Setting Up Authentication for Kafka
You can set up authentication and SSL to improve security between BusinessEvents and Kafka broker.