ActiveMQ setup of tcp socket using mina



I am trying to setup a simple demo of activemq and mina. I edited the camelContext in the activemq.xml file to include two mina tcp sockets, two queues and routes as such:

listenerA -> qA -> listenerB
listenerB -> qB -> listenerA

The intent is to have two way pass through between two telnet sessions. Later, I will add more fancy features such as filtering, routing to a topic and my own codec on each listener.

Here is my camelcontext:

    <!-- You can use a <package> element for each root package to search for Java routes --> 

    <endpoint id="listener_A" uri="mina:tcp://localhost:42000?textline=true"/> 
    <endpoint id="listener_B" uri="mina:tcp://localhost:42001?textline=true"/> 

            <!-- You can use Spring XML syntax to define the routes here using the <route> element --> 
        <from ref="listener_A"/> 
        <to uri="activemq:qA"/> 
        <from uri="activemq:qB"/> 
        <to ref="listener_A"/> 
        <from ref="listener_B"/> 
        <to uri="activemq:qB"/> 
        <from uri="activemq:qA"/> 
        <to ref="listener_B"/> 

When I start activemq I get an exception:

org.apache.camel.NoSuchEndpointException: No endpoint could be found for: mina:tcp://localhost:42000?textline=true

Do I explicitly need to add a mina bean? If so where and how?

1 Answer: 

Do you have camel-mina.jar and the mina jars on the classpath?

Based on the thread here it seems to have fixed it.