0

I am currently trying to implement apace camel spring based routing into my project and am coming across some issues. I am able to get the CamelContext to automatically start when I run my program but I keep getting the messsage:

Total 0 routes, of which 0 is started. Apache Camel 2.6.0 (CamelContext: camel-1) started in 0.790 seconds

This is showing up in the logging.

I will post the "camel-context" and maybe someone can point to where I am going astray. I am lost at the moment and am really trying to get a handle on this technology because it does sound pretty powerful. I hope this is an easy fix! Let me know if you need anything else.

<?xml version="1.0" encoding="UTF-8"?>

<spring:beans xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://camel.apache.org/schema/spring"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:alch="http://service.alchemy.kobie.com/"
xsi:schemaLocation="http://www.springframework.org/schema/beans classpath:META-INF/spring/spring-beans.xsd 
    http://camel.apache.org/schema/spring classpath:META-INF/spring/camel-spring.xsd">

<!-- load properties -->
<spring:bean
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <spring:property name="locations" value="file:backend.properties" />
</spring:bean>

<spring:bean id="properties"
    class="org.apache.camel.component.properties.PropertiesComponent">
    <spring:property name="location" value="file:backend.properties" />
</spring:bean>

<spring:bean id="jmsConnectionFactory" 
    class="org.apache.activemq.ActiveMQConnectionFactory">
    <spring:property name="brokerURL" value="tcp://0.0.0.0:61616?useLocalHost=true" />
</spring:bean>

<spring:bean id="pooledConnectionFactory" 
    class="org.apache.activemq.pool.PooledConnectionFactory">
    <spring:property name="maxConnections" value="8" />
    <spring:property name="maximumActive" value="500" />
    <spring:property name="connectionFactory" ref="jmsConnectionFactory" />
</spring:bean>

<spring:bean id="jmsConfig" 
    class="org.apache.camel.component.jms.JmsConfiguration">
    <spring:property name="connectionFactory" ref="pooledConnectionFactory"/>
    <spring:property name="transacted" value="false"/>
    <spring:property name="concurrentConsumers" value="1"/>
</spring:bean>

<spring:bean id="activemq" 
    class="org.apache.activemq.camel.component.ActiveMQComponent">
    <spring:property name="configuration" ref="jmsConfig"/>
</spring:bean>

<!-- Loaded Beans -->

<spring:bean id="ExactTargetBean" class="com.backend.trigger.TargetBean" /> 
<spring:bean id="TriggerEmailRequestBean" class="com.requests.TriggerEmailRequest" />


<!-- Camel configuration -->

<camelContext xmlns="http://camel.apache.org/schema/spring">
    <route id="genericMessageHandler" streamCache="true">
        <from uri = "activemq:topic:Test.topic"/>
        <multicast>  
            <to uri = "TargetIntegration" />
        </multicast>
    </route>
     <route>
        <from uri="TargetIntegration" />
            <setProperty propertyName="apiuser">
                <simple>${properties:et.username}</simple>
            </setProperty>
            <setProperty propertyName="password">
                <simple>${properties:et.password}</simple>
            </setProperty>
            <setProperty propertyName="triggerName">
                <constant>WelcomeEmail</constant>
            </setProperty>
            <setProperty propertyName="email">
                <constant>patrick@test.com</constant>
            </setProperty>
            <setProperty propertyName="firstName">
                <constant>Patrick</constant>
            </setProperty>
            <setProperty propertyName="lastName">
                <constant>Archambeau</constant>
            </setProperty>
        <to uri = "xslt:xslt/target-integration.xsl" />
        <log message="Transformed Message : ${in.body}" />

        <setBody>
            <simple>qf=xml&amp;xml=${in.body}</simple>
        </setBody>
        <setHeader headerName="CamelHttpMethod">
            <constant>POST</constant>
        </setHeader>
        <setHeader headerName="Content-type">
            <constant>application/x-www-form-urlencoded</constant>
        </setHeader>
        <setHeader headerName="Connection">
            <simple>close</simple>
        </setHeader>
        <log message="Transformed Message : ${in.body}" />
        <to uri = "{{et.integration.url}}" />
        <log message="Transformed Message : ${in.body}" />
    </route>
</camelContext>

4

0 回答 0