如何测试在Apache的骆驼(春季)路线

问题描述:

这是我的system.xml如何测试在Apache的骆驼(春季)路线

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:amq="http://activemq.apache.org/schema/core" 
    xsi:schemaLocation=" 
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
     http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd 
     http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> 

    <import resource="jetty.xml" /> 
    <import resource="communication.xml" /> 

    <camelContext xmlns="http://camel.apache.org/schema/spring" 
     id="camel"> 
     <route> 
     <from uri="file://test.json"/> 
      <threads> 
       <bean ref="operationTest" method="test" /> 
      </threads> 
     </route> 
    </camelContext> 
</beans> 

这里是我的communication.xml

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" 
    xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd 
    http://www.springframework.org/schema/util 
    http://www.springframework.org/schema/util/spring-util.xsd"> 

    <bean id="operationTest" class="edu.test.Test"> 
    </bean> 
</beans> 

我有一个主要的

context = new SpringServerContext(new FileSystemXmlApplicationContext("conf/system.xml")); 

    Runtime.getRuntime().addShutdownHook(new Thread(group, new Runnable() { 

     @Override 
     public void run() { 
      stop(); 
     } 

    }, shutdownThreadName)); 
    context.startup(); 

和测试类有一个方法

public Object test(Object info) { 
//prints info 
} 

然而,当我跑步时,没有打印。 。 。

我们不能通过文件触发from标签吗? brokerURL,请检查您的类路径中包含所需骆驼组成的jar:

我也是从Active MQ尝试,没有的强校得到,因为没有终点的

的错误可能为找到。

我使用Active MQ作为路由并且它工作了