amqp and camel error: route has no input

Question!

I'm having some problems with my rout with Camel. This is my configuration file, very simple:

<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="brokerURL" value="tcp://10.211.55.20:5672"/>
</bean>

<camel:camelContext xmlns="http://camel.apache.org/schema/spring">

    <jmxAgent id="agent" createConnector="false" disabled="true"/>

    <camel:route>
        <route>
            <from uri="activemq:hello?destination.consumer.exclusive=true&amp;destination.consumer.prefetchSize=50"/>
            <to uri="stream:out"/>
        </route>
    </camel:route>
</camel:camelContext>

In this case there I'm using RabbitMQ and hello is the queue name.

Running it, I get this error message:

Invocation of init method failed; nested exception is java.lang.IllegalArgumentException:  Route has no inputs: Route[[] -> [Route[[From[activemq:hello?destination.consumer.exclusive=true&destination.consumer.prefetchSize=50]] -> [To[stream:out]]]]]

Any idea? Where can I get a sample or a tutorial for Camel + RabbitMQ ?

--- UPDATED ---

Following the suggestion on below comment, I fixed the configuration and a little step ahead has been done. Now it's seem to be able to connect to queue but, if I try to write I get "camelContext must be specified" exception

<bean id="messageConverter" class="amqp.spring.converter.XStreamConverter"/>

<rabbit:connection-factory id="connectionFactory" host="10.211.55.20" port="5672" />
<rabbit:template id="amqpTemplate" connection-factory="connectionFactory" message-converter="messageConverter" exchange="amq.fanout" />
<rabbit:admin connection-factory="connectionFactory"/>
<rabbit:queue name="hello"  />

<camel:camelContext xmlns="http://camel.apache.org/schema/spring">
    <camel:route>
        <camel:from uri="file:src/data?noop=true" />
        <camel:log message="Log!"/>
        <camel:to uri="spring-amqp:amq.fanout:hello"/>
    </camel:route>
</camel:camelContext>

thanks,
Andrea



Answers

There are two error. First, the XML seems to be missing namespaces on the route:



This video can help you solving your question :)
By: admin