camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hooty223 <hooty...@gmail.com>
Subject Camel standalone with embedded activemq broker
Date Mon, 22 Jun 2015 19:09:33 GMT
I am running a standalone camel app with an embedded activemq broker where
the broker and route definitions are defined in xml file.

I just created a timer to trigger messages to be sent to a queue.

When I run in eclipse, everything is fine - both producers and consumers are
happy. However, when I run outside of the eclipse environment, I get the
following exceptions:

nested exception is javax.jms.JMSException: Could not create Transport.
Reason: java.io.IOException: Broker named 'myBroker' does not exist.

this is my broker.xml file:
	<broker id="broker" brokerName="myBroker" useShutdownHook="false"
		useJmx="true" persistent="true" dataDirectory="activemq-data"
		xmlns="http://activemq.apache.org/schema/core">

		<transportConnectors>
			
			<transportConnector name="vm" uri="vm://myBroker" />
			
			<transportConnector name="tcp" uri="tcp://0.0.0.0:61616" />
		</transportConnectors>

	</broker>
this is my camel-route.xml file:
	
	<import resource="classpath*:broker.xml " />


	
	
	<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
		
		<property name="brokerURL"
			value="vm://myBroker?create=false&amp;waitForStart=5000" />
	</bean>

    
    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
        
        <route>
            <from uri="timer:foo?period=1s" />
            
            <transform>
                <simple>Message at ${date:now:yyyy-MM-dd HH:mm:ss}</simple>
            </transform>
            <to uri="activemq:queue:inbox" />
        </route>
        
        <route>
            <from uri="activemq:queue:inbox" />
            <to uri="activemq:queue:outbox" />
        </route>
    </camelContext>

thanks.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-standalone-with-embedded-activemq-broker-tp5768486.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message