hi Forum,

I'm trying to do a simple route, consuming from a JMS queue and handling
several messages in parallel by some Bean.

It's a simple <from uri="activemq:queue:MyQueue"/><threads
executorServiceRef="myPool"><bean beanType="org.Executer" /></threads>
route. camel-context.xml is attached.

Well, it does not work...
The queue has several messages in it, debugging in eclipse I see some JMS
Consumers, but only a single "Camel Cool" thread (that's the name I give to
the threads in the XML), causing the messages to be processed one by one.

What's wrong? where can be the problem?
Is it the ActiveMQ broker? JMS configuration?

I'm using ActiveMQ 5.5.1, Camel 2.8.1. Java 6, on a 32 bit Windows 7
computer.

thanks for any help,
ShlomiJ
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:broker="http://activemq.apache.org/schema/core";
       xmlns:camel="http://camel.apache.org/schema/spring";
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
       http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd";>


    <!-- define connection factory, implemented with ActiveMQ -->
    <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    	<property name="brokerURL" value="tcp://localhost:61616" />
    </bean>
    
    <!-- define a Pool-supported connection factory on top of the "regular" connection factory -->
    <bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
    	<property name="maxConnections" value="8" />
    	<property name="maximumActive" value="500" />
    	<property name="connectionFactory" ref="jmsConnectionFactory" />
    </bean>
    
    <!-- define JMS connectivity properties -->
    <bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
    	<property name="connectionFactory" ref="pooledConnectionFactory"/>
    	<property name="transacted" value="false"/>
    	<property name="concurrentConsumers" value="10"/>
    </bean>
    
    <!-- define the component, from which we'll get endpoints -->
    <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    	<property name="configuration" ref="jmsConfig"/>
    </bean>

	
    <!-- the camel route -->
    <camel:camelContext id="camel" xmlns="http://camel.apache.org/schema/spring";>
		<camel:threadPool id="myPool" threadName="Cool" poolSize="5" maxPoolSize="15" maxQueueSize="250"/>
        <camel:route>
            <!-- incoming orders arrive on this queue -->
            <camel:from uri="activemq:queue:MyQueue"/>
            <camel:threads executorServiceRef="myPool">
            	<camel:bean beanType="org.Executer" method="execute" />
            </camel:threads>
        </camel:route>

    </camel:camelContext>

</beans>

Reply via email to