springboot集成camel、kafka

1、application.yml 中配置kafka参数

kafka:
  constant: kafka:airport?brokers=127.0.0.1:9092
  consumer: kafka:airport?brokers=127.0.0.1:9092

2、from路由

from(rabbitmqConstant)
.to(kafkaConstant);

from(kafkaConsumer)
.log("Message received from Kafka : ${body}")
.log("on the topic ${headers[kafka.TOPIC]}");

 

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页