- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在进入一个实现 IBM MQ 监听 Spring JMS 应用程序的项目,但我无法理解 DefaultMessageListenerContainer 中的“receiveTimeout”。
与来自互联网的资源相比,我认为我的项目有点特别,因为我们对“receiveTimeout”参数使用了非常高的 30 秒值,我不知道这实际上意味着什么。
我试图弄清楚“receiveTimeout”参数的含义,我将在Spring配置后在下面给你我的理解。
仅供引用:我们正在从一个队列中读取/处理许多非常小的消息(大约 100kb)。
这是我们正在使用的 Spring 配置:
<bean id="msgListenerContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer"
p:connectionFactory-ref="mqConnectionFactory"
p:messageListener-ref="myMessageListener" p:sessionTransacted="true"
p:concurrentConsumers="1" p:maxConcurrentConsumers="20"
p:receiveTimeout="30000" p:idleTaskExecutionLimit="10"
p:idleConsumerLimit="5" />
The idleConsumerLimit property is used to specify the the maximum number of consumers that are allowed to be idle at a given time. Increasing this limit causes invokers to be created more aggressively. This can be useful to ramp up the number of consumers faster.
idleTaskExecutionLimit: The limit for the number of allowed idle executions of a receive task. The default is 1 causing idle resources to be closed early once a task does not receive a message. idleTaskExecutionLimit property is set to 10 to allow tasks to execute 10 times instead of the default value of 1.
receiveTimeout property is set to 30 seconds to tell the DMLC's receive operation to poll for message for 30 seconds instead of the default one second.
So this means: If there is a heavy load Spring JMS will start up to 20 consumers (maxConcurrentConsumers) and as soon as the load goes down, these consumers will continue to read messages for 30 seconds (receiveTimeout) before closing or going idle. So after that 5 consumers (idleConsumerLimit) will still idle for 10 seconds (?) (idleTaskExecutionLimit) before closing down.
最佳答案
当询问代理客户端是否有更多工作( receive()
)时使用接收超时 - 它不轮询代理,只是轮询客户端库以查看代理是否发送了更多消息。它与接收消息的频率无关。
当超时发生时,容器立即调用 receive()
再次。
较高的接收超时意味着容器对 stop()
的响应会变慢调用 - 容器只能在 receive()
之间停止调用。
关于spring-jms - 高 Spring JMS DefaultMessageListenerContainer.receiveTimeout 参数是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38746928/
我希望这是一个简单的配置问题,但我似乎无法弄清楚它可能是什么。 设置 Spring-Boor 2.2.2.RELEASE 云启动器 云启动器-aws spring-jms spring-cloud-d
我有以下配置: // Some attributes 以及以下监听器: public class myListener implements MessageListener
我有一个 DefaultMessageListenerContainer 配置如下: DefaultMessageListenerContainer container = new DefaultMe
我希望这是一个简单的配置问题,但我似乎无法弄清楚它可能是什么。 设置 Spring-Boor 2.2.2.RELEASE 云启动器 云启动器-aws spring-jms spring-cloud-d
我正在将 Spring JMS 与以下上下文 XML 文件一起使用。 我的应用程序是命令行独立的,看起来像这样: public static void main(String[]
是否有可能在 onMessage 方法内部知道 MessageListener 正在监听哪个队列? 我的 Spring-config(其中一部分):
我有一个 DefaultMessageListenerContainer,它(在我看来)没有按比例放大。 Container 被定义为监听一个队列,其中有 100 条消息。 我希望容器可以达到任何长度
我正在努力模拟(使用 Mockito)DefaultMessageListenerContainer (org.springframework.jms.listener.DefaultMessageL
使用DefaultJmsListenerContainerFactory有什么好处在 DefaultMessageListenerContainer ? 如果我直接配置 DMLC,我会通过调用 isR
我已将 Spring DefaultMessageListenerContainer 配置为 ActiveMQ 消费者,使用队列中的消息。我们称之为“Test.Queue”我将此代码部署在 4 台不同
我是 Spring Framework 的新手,我的问题如下: 我想实例化 DefaultMessageListenerContainer以编程方式,我使用的代码是: DefaultMessageLi
对于我当前的项目,我需要使用来自许多目的地(从数百到 20 或 30k)的消息,所有目的地都是主题。目前(对于初始负载测试)所有消息都是在同一台服务器上本地创建的,在线程池中。 我当前的 spring
我有一个要求,我在一个队列中有消息,消息选择器的数量是可配置的。我需要并行处理这些消息的地方。 经过深思熟虑,我发现使用多个 DefaultMessageListenerContainer 会产生很好
如果我使用 DefaultMessageListenerContainer 的 Spring要接收 JMS 消息,即使我设置了 sessionAcknowledgeMode,我也不会重新发送 JMS
我开发了使用 Spring JMS 的项目来接收来自队列的消息。并部署Websphere应用服务器(WAS 7.5)集群环境。一旦部署到服务器中,它就工作正常。后来我更新了记录器信息并部署到服务器中。
我正在使用 spring 集成来监听 ibm mq,我想在 hibernate 模式下部署我的应用程序并在需要的时间启动它。因此,我使用了 DefaultMessageListenerContaine
我在 DefaultMessageListenerContainer 内使用 SimpleAsyncTaskExecutor,并且我想使用 JMX mbean 监视 Activity 线程计数。我创建
我有一个案例,我想在同一个“主”线程中运行 DefaultMessageListenerContainer。现在它使用 SimpleAsyncTaskExecutor 每次收到消息时都会生成新线程。
我已经为 jms 监听器配置了 spring 以使用来自 hornetQ 的消息,如下所示。
我正在使用 Spring JMS 连接到 Websphere MQ 服务器。我实现了 SessionAwareListener 接口(interface)来创建自定义监听器,为业务逻辑重用旧代码。 在
我是一名优秀的程序员,十分优秀!