All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
titleSample Proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="KafkaTransport"
       transports="https http"
       startOnLoad="true"
       trace="disable">
   <description/>
   <target>
      <inSequence>
         <kafkaTransport.init>
            <brokerList>localhost:9092</brokerList>
         </kafkaTransport.init>
         <kafkaTransport.kafkaproduce-operation>
            <topic>test</topic>
         </kafkaTransport.kafkaproduce-operation>
      </inSequence>
   </target>
</proxy>            

The following image shows how to send the messages using a sample client(JMeter).
Image Modified

Analyzing the output

  • Run the following command to verify the messages
    bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning

...

         The Kafka connector publishes the messages from the Kafka brokers.