I am using Camel 2.12.1 (from Talend ESB 5.4) I am using a rather simple camel route to read from an activemq queue with 5 concurrent consumers. The full blueprint config is attached.
<route> <from uri="activemq:queue:ts-test?concurrentConsumers=5" /> <delay> <constant>2000</constant> </delay> <to uri="log:test" /> </route> what I would expect is that the route would consume from the queue on 5 different threads and that the log would show outputs where "blocks" of 5 timestamps are close together with gaps of 2 seconds between the "blocks" as the route uses a delay of 2 seconds to emulate processing. However what I see is that despite requesting concurrentConsumers=5 it seems that it processes one message at a time (each log entry is about 2 seconds apart). Can anyone point me into the right direction to make the route consume concurrently? 13:23:42,966 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 8] 13:23:44,968 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 17] 13:23:46,970 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 26] 13:23:48,973 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 7] 13:23:50,975 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 16] 13:23:52,977 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 25] 13:23:54,979 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 6] 13:23:56,982 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 15] 13:23:58,984 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 24] 13:24:00,986 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 5] 13:24:02,989 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 14] 13:24:04,991 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 23] 13:24:06,993 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 4] 13:24:08,995 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 13] 13:24:10,998 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 22] 13:24:13,001 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 3] 13:24:15,004 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 12] 13:24:17,006 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 21] 13:24:19,007 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 30] 13:24:21,010 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 2] 13:24:23,012 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 11] 13:24:25,015 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 20] 13:24:27,017 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 29] 13:24:29,019 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 1] 13:24:31,021 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 10] 13:24:33,023 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 19] 13:24:35,026 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 28] 13:24:37,028 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 9] 13:24:39,030 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 18] 13:24:41,033 | INFO | onsumer[ts-test] | test | rg.apache.camel.util.CamelLogger 176 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello 27] Thanks in advance! -- Lothar Werzinger Principal Architect Tradescape, Inc. - Enabling Efficient Digital Marketplaces +1-650-931-6719 (direct) +1-800-697-6068 (main) Ext. 116 [email protected]<https://mail.google.com/mail/?view=cm&fs=1&tf=1&[email protected]> http://www.tradescape.biz -- This message and any attachment (the "message") is intended solely for the addressees and is confidential. If you receive this message by mistake, please delete it and notify the sender immediately. Any use not in accordance with its purpose, any out-spread or disclosure, either as a whole or partially, is prohibited except with formal approval. Internet cannot guarantee the integrity of this message, therefore Tradescape will not be liable for the message if modified. -
<?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0" xmlns:camel="http://camel.apache.org/schema/blueprint" xmlns:activemq="http://activemq.apache.org/schema/core" xsi:schemaLocation=" http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd "> <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="brokerURL" value="tcp://localhost:61616" /> </bean> <bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start" destroy-method="stop"> <property name="maxConnections" value="8" /> <property name="connectionFactory" ref="jmsConnectionFactory" /> </bean> <bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration"> <property name="connectionFactory" ref="pooledConnectionFactory" /> <property name="concurrentConsumers" value="10" /> </bean> <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> <property name="configuration" ref="jmsConfig" /> <!-- if we are using transacted then enable CACHE_CONSUMER (if not using XA) to run faster see more details at: http://camel.apache.org/jms <property name="transacted" value="true"/> <property name="cacheLevelName" value="CACHE_CONSUMER" /> --> </bean> <camelContext xmlns="http://camel.apache.org/schema/blueprint"> <route> <from uri="activemq:queue:ts-test?concurrentConsumers=5" /> <delay> <constant>2000</constant> </delay> <to uri="log:test" /> </route> </camelContext> </blueprint>
