191.5.2. Kafka에 메시지 생성

Kafka에 메시지를 쓰기 위해 필요한 최소 경로는 다음과 같습니다.

from("direct:start")
    .setBody(constant("Message from Camel"))          // Message to send
    .setHeader(KafkaConstants.KEY, constant("Camel")) // Key of the message
    .to("kafka:test?brokers=localhost:9092");