Arjun
Arjun

Reputation: 1

Apache camel JMS transacted component performance improvement

I'm working in a project where I'm using Apache camel with Quarkus. There is a route that is consuming messages from IBM MQ. I've initialized a JMS component globally with transacted=true. But whenever it consumes messages from the queue, I can see a visible delay of 1 to 2 seconds. I've also noticed the behavior of transaction by enabling the debug logs. It is initializing and committing for every message and that is causing the delay. My question would be

  1. How can I improve the consumption rate by keeping the transacted=true?
  2. Is there any other way to handle the JMS transaction in Camel?

Code samples:

JMS Component intialization

@Produces
    @ApplicationScoped
    @DefaultBean
    @Named("dbusmq")
    @UnlessBuildProfile("test")
    public JmsComponent configureJms(ConnectionFactory connectionFactory) {
            JmsComponent jmsComponent = new JmsComponent();
            jmsComponent.setConnectionFactory(connectionFactory);
            jmsComponent.setTransacted(true);
            return jmsComponent;
    }

Route

from("dbusmq:queue:DEV.QUEUE?disableReplyTo=true")
.routeId("testMqRoute")
.log("Received Message: ${body}")
.end();

Tried setting cacheLevelName and asyncConumer settings. But couldn't see any improvement.

Upvotes: 0

Views: 75

Answers (0)

Related Questions