Actually my idea was to start ActiveMQ + Camel under Jboss and this topic was
exactly about it.

I've found where the problem was, at least with Jboss 5.1.0 + ActiveMQ 5.3 +
Camel 2.0 + Spring 2.5 you need to explicitly write xmlns in beans
definition in your broker-config.xml

aslo, params from  /META-INF/ra.xml (ActiveMQ Resource Adapter)
<config-property>
            <config-property-name>BrokerXmlConfig</config-property-name>
            <config-property-type>java.lang.String</config-property-type>
           
<config-property-value>xbean:broker-config.xml</config-property-value>
</config-property>


and the broker-config.xml should contain following:
<broker xmlns="http://activemq.apache.org/schema/core"; useJmx="true"
useShutdownHook="false" id="broker" name="bruce.broker"> 
...
xmlns is important, otherwise you can not get your broker via Spring, you
should have spreang-beansxxx.jar in your classpath as well.

if you need to include camel configuration file - do it just with resource
import:
<import resource="camel.xml" />

in camel.xml you may specify your routes, for example:


<beans
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd";>
    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring";>

        <!-- You can use a <packages> element for each root package to
search for Java routes -->
        <packageScan>
           <packages>org.foo.bar</packages>
        </packageScan>

        <!-- You can use Spring XML syntax to define the routes here using
the <route> element -->
        <route>
            <from uri="activemq:TEST.FOO1"/>
            <to uri="activemq:TEST.FOO"/>
        </route>
        <!-- TEST TIMER ROUTE -->
        
        <route>
            <from uri="timer://foo?fixedRate=true&amp;period=1000"/>
            <to uri="activemq:TEST.FOO"/>
        </route>
        

    </camelContext>

    <!-- configure the camel activemq component to use the current broker
-->
    <bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="brokerURL" value="tcp://localhost:61616"/>
   </bean>
</beans>



-- 
View this message in context: 
http://www.nabble.com/JBoss-%2B-ActiveMQ-%2B-Camel-%2B-Newbie-tp24056976p26060885.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to