如何在karaf中驱动服务器ip属性

时间:2017-10-20 10:47:06

标签: apache-camel apache-karaf

我正在卡拉夫部署一个罐子。

我的罐子里有一条骆驼路线

仅复制路线部分:

                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服务器凭据进行硬编码,但我希望将此属性文件驱动。

1 个答案:

答案 0 :(得分:0)

了解Camel的属性占位符,您可以在其中外部化配置并从Camel路由中引用它们:http://camel.apache.org/using-propertyplaceholder.html