Produce Message

 

Let’s see how we can produce  or publish message to topic using kafka connector

Create project in anypoint studio

Drag and drop publish operation for apache kafka from mule palette(add the kafka module if not present on mule palette)

configure the topic name

Produce Message - Kafka Connector

 

Configure Bootstrap server URLs on the connector configuration

Produce Message - Kafka Connector

 

Create the payload to send the message on kafka topic

Produce Message - Kafka Connector

 

Deploy the application and test

Message published successfully, you can run the below command and see  the published message

Alternatively you can also use the consume operation to consume the published message

kafka-console-consumer.bat –bootstrap-server localhost:9092 –topic test –from-beginning

  
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
 
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.


Share this:
Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
murth
murth
2 years ago

Can I consume message from Kafka prepared topic ?