The Apache Kafka event receiver subscribes to a user-defined topic on a user-configured Kafka broker. Then the messages published to that topic are received by the Kafka receiver and forwarded to the WSO2 product engine. This feature is donated by Andres Gomez Ferrer. For more information, see Apache Kafka documentation.
Set up the below prerequisites to start configuring an Apache Kafka event receiver.
- Download Apache Kafka server.
- Copy the following client JAR files from
Kafka_2.10-0.9.0.1 is backward compatible. Therefore, you can use Kafka_2.10-0.8.2.1 client jars to connect with Kafka_2.10-0.9.0.1.
If you are using Kafka_2.11-0.10.0.0, you need to download this jar and save it in the
- Start the Apache Kafka server.
Creating an Kafka event receiver
For instructions on creating an Apache Kafka event receiver, see Configuring Event Receivers.
Configuring adapter properties
Specify the Adapter Properties , when creating an Apache Kafka event receiver using the management console as shown below.
After entering the above adapter properties, select the Event Stream to which you want to map the incoming events, and the Message Format that you want to apply on the receiving events. Also, click Advanced to define custom input mappings based on the Message Format you selected. For more information on custom input mapping types, see Input Mapping Types.
You can also d efine the respective adapter properties of the event receiver based on the transport type within the
<from> element of the event receiver configuration in the
<PRODUCT_HOME>/repository/deployment/server/eventreceivers/ directory as follows.
The above adapter properties are described below.
|Configuration file property||Example|
Server Zookeeper IP
IP address of the Zookeeper Server
Group ID Kafka
Kafka consumer group id which uniquely identifies a set of consumers within the same consumer group
Number of consumer threads
|Optional Configuration Properties|
Valid property and value pairs to denote o ptional configuration properties for Apache Kafka. (E.g. "property1: value1, property2: value2")
For more information on Axis2 JMS properties, go to Apache Kafka Documentation.
|Topic Kafka||Name of the Kafka topic to which, input messages are published|
|Is events duplicated in cluster||In a cluster whether the same event can reach two receiver nodes|
For more information on
kafka event receiver type, see the following sample.