Am trying to read from RabbitMQ queue using Amqp.InboundAdapter, process it & then push it onto another queue.
So the flow looks like this:
Amqp.InboundAdapter --> service activator --> Amqp.outboundAdapter
But the problem is the processing speed are very very slow. The delivery rate at the rabbitmq console is 0.2/sec or 1sec which is very slow.
What could be causing this slowness?
IntegrationFlows.from(
Amqp.inboundAdapter(connectionFactory, IncomingQueue)
.configureContainer(c -> {
c.concurrentConsumers(classicFlatFileConcurrentConsumers);
c.prefetchCount(incomingPrefetchCount);
c.adviceChain(new Advice[]{retryOperationsInterceptor});
c.channelTransacted(false);
})
)
.handle(myTransformer)
.split()
.filter(ResultDTO.class, dto -> dto.getID() != null)
.handle(Amqp.outboundAdapter(rabbitTemplate).routingKey(OutputQueueName))
.get();
Note that am using rabbitTemplate in Amqp.OutboundAdapter, which has usePublisherConnection set to True.
When I don't use spring integration, then the message rates are high around 1000 msg/sec in the rabbitmq console.