我正在卡拉夫部署一个罐子。
我的罐子里有一条骆驼路线
from("file:/app/billing/billingip/HOBSRating/data/mediation/voice/input?include=USAGE_VOICE.*.txt")
.doTry()
.log("#########The Camel Header before loading into kafka topic ######## :${headers}")
.log("#########The Camel Body before loading into kafka topic ######## :${body}")
.to("kafka:172.20.211.201:9092?topic=VoiceStream&zookeeperHost=172.20.211.201&zookeeperPort=9092&serializerClass=kafka.serializer.StringEncoder")
/* .to("kafka:${kafkaserver}?topic=DataStream&zookeeperHost=${zookeeperHost}&zookeeperPort=${zookeeperport}&serializerClass=kafka.serializer.StringEncoder")*/
.to("file:/app/billing/billingip/HOBSRating/data/mediation/voice/success")
.doCatch(Exception.class)
.log("########The exception message is ####### :${exception.message}")
.log("########The stack trace of the exception is ####### :${exception.stacktrace}")
.to("file:/app/billing/billingip/HOBSRating/data/mediation/voice/error")
.log("############### End of Voice Cdr to Kafka Topic Route ################")
目前,我正在对kafka服务器凭据进行硬编码,但我希望将此属性文件驱动。
答案 0 :(得分:0)
了解Camel的属性占位符,您可以在其中外部化配置并从Camel路由中引用它们:http://camel.apache.org/using-propertyplaceholder.html