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

Kafka channel provides the following serializers to handle payloads:
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.
Note: If you are migrating a project from earlier version which contains KafkaStringPayloadSerializer then the project still works in this version. However, the KafkaStringPayloadSerializer serializer is not available for a new Kafka channel.

Kafka Channel Example

A sample TIBCO BusinessEvents application that uses the new Kafka channel is available under BE_HOME/examples/standard/KafkaChannel.