In our setup, we are observing a significant number of 'MQ get without data' messages alongside 'MQ get with data' messages. With the following configuration, we see 85 calls per second for 'MQ get with Data' and 71 calls per second for 'MQ get without data' over a one-hour period.
We aim to further reduce the occurrence of 'MQ get without data' messages because empty gets can contribute to CPU overhead and we are also charged based on the number of 'get' calls. The provided statistics represent the best performance we could achieve with the current settings.
Furthermore, we have four @JmsListener components, each listening to a different queue, but all utilizing the same JmsListenerContainerFactory. Message processing time is around 8ms
@Bean
public JmsListenerContainerFactory jmsListenerContainerFactory(
ConnectionFactory defaultJmsConnectionFactory,
DestinationResolver jndiDestinationResolver,
ThreadPoolTaskExecutor jmsThreadPoolTaskExecutor) {
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(defaultJmsConnectionFactory);
factory.setReceiveTimeout(120000L);
factory.setDestinationResolver(jndiDestinationResolver);
factory.setSubscriptionDurable(false);
factory.setTaskExecutor(jmsThreadPoolTaskExecutor);
factory.setBackOff(new FixedBackOff(40*1000, 3));
factory.setConcurrency("1-1");
return factory;
}
@Bean
public ThreadPoolTaskExecutor jmsThreadPoolTaskExecutor() {
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
taskExecutor.setCorePoolSize(4);
taskExecutor.setMaxPoolSize(6);
taskExecutor.setQueueCapacity(100);
taskExecutor.setKeepAliveSeconds(30);
taskExecutor.initialize();
taskExecutor.setThreadNamePrefix("jms-");
return taskExecutor;
}
I tried with increasing core pool size of ThreadPoolTaskExecutor and also multiple consumer but all leads to more MQ get without data calls.
Is there any other setting that can reduce MQ get without data calls?