如何在骆驼路线XML中检索交换属性? [英] How to retrieve a exchange property in the camel route XML?

查看:97
本文介绍了如何在骆驼路线XML中检索交换属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在路由中运行一个循环.我的路线为

I have to run a loop in the route. my route looks as

<camel:loop>
      <camel:constant>${property.x}</camel:constant> 
</camel:loop>

我的处理器看起来像

Date date = new Date();
    this.LOGGER
            .info("\n****WELCOME TO THE REQUEST OF CHECK PROCESSOR**");
    int y=4;
    Integer a=new Integer(y);
    exchange.setProperty(x,a);
    int k=(Integer) exchange.getProperty(x);
    this.LOGGER
    .info("\n***WELCOME TO THE REQUEST OF CHECK PROCESSOR ENDINGGGGGGGG***"+"a=   "+a+"  Y=  "+y+"  x=   "+exchange.getProperty(x)+"  k=  "+k);

在运行此值时x =4.我想在骆驼路线XML文件中访问此x.

while running this the value of x= 4.I want to access this x in the camel route XML file.

推荐答案

一个好主意是花一些时间在Camel网站上查找您的要求.请参见exchangeProperty: http://camel.apache.org/exchangeproperty.html

A good idea is to spend a bit time on the Camel website to find what you ask. See the exchangeProperty: http://camel.apache.org/exchangeproperty.html

这篇关于如何在骆驼路线XML中检索交换属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆