2017-10-10 1 views
1

Ceci est mon system.xmlComment tester les routes à dos de chameau apache (printemps)

<?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> 

Voici mon 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> 

J'ai une principale

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

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

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

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

et la classe de test a une méthode de

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

Pourtant, quand je cours, rien ne s'imprime. . . Ne pouvons-nous pas déclencher la balise from par un fichier?

Je suis également en train de MQ actif et n'est pas une erreur se succédant de

en raison de Aucun critère n'a été constaté pour: brokerURL, s'il vous plaît vérifier votre classpath contient le pot de composant Camel nécessaire.

Répondre

0

J'ai utilisé Active MQ pour l'itinéraire et cela a fonctionné