Parameters 以Camel格式在处理器、bean等之间传递参数
我的情况如下所述 例如,考虑我下面定义的路线Parameters 以Camel格式在处理器、bean等之间传递参数,parameters,Parameters,我的情况如下所述 例如,考虑我下面定义的路线 from("file:SOURCE/data?noop=true") .bean(Bean1.class, "someMethod") .process(someProcessorBean1) .bean(Bean1.class, "someMethod") .bean(ServiceBean.class, "serviceMethod") .process(someProcessorBean2) .b
from("file:SOURCE/data?noop=true")
.bean(Bean1.class, "someMethod")
.process(someProcessorBean1)
.bean(Bean1.class, "someMethod")
.bean(ServiceBean.class, "serviceMethod")
.process(someProcessorBean2)
.bean(ServiceBean2.class, "serviceMethod2")
.bean(Bean1.class, "someMethod")
.process(someProcessorBean3)
.bean(Bean1.class, "someMethod")
我使用Bean1的someMethod()
获取Hashmap中的一些参数,Hashmap是在不同的处理器中设置的,我将用于其他目的
我可以在camel上下文中设置Hashmap,如下所示
getContext().setProperties(contextMap);
我可以在Bean1中检索到相同的内容,如下所示
exchange.getContext().getProperties();
现在,getContext()
中可用的hashmap是Map
,而这不是我们可以通过method参数中的@Properties访问的属性映射。
我想在Map
中设置可以访问@Properties param的属性
如何设置接受映射的属性(@Properties)?exchange.getProperties()-将为接受映射的Camel上下文提供属性集