← ResourcesConnector migration

Migrating the MuleSoft Kafka connector to Spring Boot

6 min read

The MuleSoft Kafka connector maps directly onto Spring for Apache Kafka. Publishing becomes KafkaTemplate; the message source becomes an @KafkaListener. This guide shows the mapping, a worked example, and how the result is verified against a real Kafka broker rather than a mock.

Operation mapping

  • kafka:publish → KafkaTemplate.send(topic, key, value)
  • kafka:message-listener (source) → a method annotated @KafkaListener(topics = "...")
  • kafka:consume → KafkaTemplate / consumer poll, depending on the flow shape

Before and after: publish

Mule (XML)
<kafka:publish config-ref="kafkaConfig" topic="orders">
  <kafka:message>#[payload]</kafka:message>
</kafka:publish>
Spring Boot (Java)
kafkaTemplate.send("orders", payload);

Before and after: consume

Mule (XML)
<kafka:message-listener config-ref="kafkaConfig" topic="orders"/>
Spring Boot (Java)
@KafkaListener(topics = "orders", groupId = "orders-service")
public void onMessage(String payload) {
    // flow body
}

How the conversion is validated

Kafka is verified against a real broker running in a container, not a mock: the converted app publishes and consumes against an actual Kafka instance and the results are compared. This is the difference between a conversion that compiles and one that is proven to behave the same.

Prove it on your own code

Send us one Mule application and your Postman collection. We convert it and prove the Spring Boot output matches field-by-field — on-premise, inside your environment.