Camel Route设置用于基于静态属性值进行测试

时间:2013-04-11 15:07:10

标签: spring apache-camel

我正在尝试在接口层引入单元测试。
在代码中,我们提供<from:sedaQueueName>并且camel解析消息并将其发送到外部系统。 我想将路线<to:ExternalSystem>更改为<to:PrintMessageOnScreen> 我已经使用静态全局值isUnitTest来获取容器外的数据库连接 有没有办法在应用程序Context中使用相同的变量值来决定我的路线? 我可以使用Spring SL访问属性值,如下所示:

<bean id="forTesting" class="test.UnitTest">
        <property name="isUnitTest">
            <value>#{T(test.UnitTest).isUnitTest}</value>
        </property>
    </bean>

我不确定如何在骆驼路线中读取此属性并根据其值确定我的路线。

1 个答案:

答案 0 :(得分:0)

您可以使用dynamic router查看documentation,也可以在documentation

使用基于内容的路由器