It's slow because you're creating/destroying connections repeatedly; you need
pooling:
PooledConnectionFactory connectionFactory =
new
PooledConnectionFactory("vm://mybroker?broker.persistent=false");
CamelContext context = new DefaultCamelContext();
context.addComponent(
"test-jms2",
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
context.addComponent(
"test-jms"
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
Also, don't use *threads() * with /concurrentConsumer/, use the latter only.
context.addRoutes(new RouteBuilder() {
@Override
public void configure() {
from(
"test-jms:queue:test.queue?concurrentConsumers=5&asyncConsumer=false")
.to("test-jms2:queue:test2.queue");
}
});
I was able to send thousands of messages in just a few seconds with those
optimizations alone,
Hope it helps
Raffi
--
View this message in context:
http://camel.465427.n5.nabble.com/Camel-route-ACtiveMQ-to-ActiveMq-has-low-transactions-per-second-tp5777819p5779820.html
Sent from the Camel - Users mailing list archive at Nabble.com.