【问题标题】:Inside a Camel Processor, variable declared to hold property from camel property place holder is not working在骆驼处理器中,声明为保存骆驼属性占位符的属性的变量不起作用
【发布时间】:2017-10-13 06:44:32
【问题描述】:

我定义了一个属性PFlow_XXXX="some value",它是使用骆驼属性占位符读取的。在处理器内部,属性值是通过从文件名中提取xxx value 来构造的。现在,当我尝试像这样在处理器内部获取此属性的值时

exchange.getContext().resolvePropertyPlaceholders("{{xsdPathVar}}"));

String xsdPathVar = "PFlow_"+extracting from file.

但这不起作用。有人可以帮助我如何从字符串变量中读取属性值。

【问题讨论】:

  • 什么不工作,你能提供一个更好的例子或解释得更好一点。

标签: jboss apache-camel jbossfuse


【解决方案1】:

使用propertyPlaceholder 时,您可以使用@PropertyInjectannotation 将属性注入bean:

@PropertyInject(value = "xsdPathVar")
String xsdPathVar;

Public class MyProcessor implements Processor {
    ...
}

我不完全确定这是否是您要求的?

【讨论】:

    猜你喜欢
    • 2014-05-13
    • 2016-12-10
    • 1970-01-01
    • 2019-01-16
    • 2016-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多