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
<kafka:publish config-ref="kafkaConfig" topic="orders">
<kafka:message>#[payload]</kafka:message>
</kafka:publish>kafkaTemplate.send("orders", payload);Before and after: consume
<kafka:message-listener config-ref="kafkaConfig" topic="orders"/>@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.
