All docs This doc
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

The publishMessage operation allows you to publish messages to Kafka brokers using Kafka topics.

  • topic: The name of the topic.

Sample scenario

Following is a sample scenario that demonstrates how to send messages to a Kafka broker using Kafka topics.

  • Download and install Apache Kafka. For more information, see Apache Kafka documentation
  • Copy the following client libraries from the <KAFKA_HOME>/lib directory to the <ESB_HOME>/repository/components/lib directory.

    • kafka_2.9.2-
    • scala-library-2.9.2.jar
    • zkclient-0.3.jar
    • zookeeper-3.3.4.jar
    • metrics-core-2.2.0.jar
  • Run the following command to start the ZooKeeper server:

    bin/ config/

    You will see the following log:

  • Run the following command to start the Kafka server:

    bin/ config/

    You will see the following log:

Building the sample

Following is a sample proxy service that illustrates how you can connect to a Kakfa broker with the init operation and use the publishMessages operation to publish the messages with the topic.

<proxy xmlns=""
       transports="https http"

Following is a sample client(JMeter) screen that displays how to send a message:

Analyzing the output

  • Run the following command to verify the messages:

    bin/ --zookeeper localhost:2181 --topic test --from-beginning

    You will see the following message content:


         This demonstrates that the Kafka connector publishes messages from the Kafka brokers.


  • No labels