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.
KafkaStringPayloadSerializer
The KafkaStringPayloadSerializer serializer (com.tibco.cep.driver.kafka.serializer.KafkaStringPayloadSerializer) serializes and deserializes the event payload, ignoring the event properties. For incoming messages, the KafkaStringPayloadSerializer decodes the text from the message as an XML string and sets it to the event's payload. For outgoing events, the serializer converts XML payloads to an XML string. The KafkaStringPayloadSerializer serializer is useful for consuming XML strings from external systems, such as, TIBCO BusinessWorks.

Kafka Channel Example

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