最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

spring - How to reduce IBM "MQ get without data" call using DefaultJmsListenerContainerFactory - Stack Overflo

programmeradmin1浏览0评论

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?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论