如何设置NMS侦听器容器的预取限制 [英] How do I set the prefetch limit for NMS listener container

查看:103
本文介绍了如何设置NMS侦听器容器的预取限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了在连接URL上,我如何在spring config中设置预取限制.我找不到任何属性的文档,并且Connection URL上的参数似乎不起作用.此外,我需要在消费者层面上做到这一点.这是我下面的配置.

Other than on the connection URL, how do I set the prefetch limit in spring config. I can't find any doc on any of the properties and the param on the Connection URL doesn't seem to work. Besides, I need to do this on the consumer level. Here is my config below.

   <nms:listener-container 
    connection-factory="SingleConnectionFactory" 
    concurrency="${GraphManagerService.NMS.Consumers}"
    auto-startup="false">
    <nms:listener ref="MessageListenerAdapter" destination="${GraphManagerService.NMS.QueueName}" />
   </nms:listener-container>

推荐答案

要针对每个用户执行此操作,请将选项添加到目标.

To do this on a per-consumer basis you add the option to the destination.

myQueue?consumer.prefetchSize = 10

myQueue?consumer.prefetchSize=10

这篇关于如何设置NMS侦听器容器的预取限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆