ActiveMQConnectionFactory sendTimeout(ActiveMQConnectionFactory sendTimeout)

编程入门 行业动态 更新时间:2024-10-27 17:18:57
ActiveMQConnectionFactory sendTimeout(ActiveMQConnectionFactory sendTimeout)

根据ActiveMQ站点上的此配置页面 , connection.sendTimeout属性为:

等待消息发送 响应的时间 ,默认值为零表示永远等待。 永远等待允许代理对来自该客户端的消息进行流控制,如果它是快速生产者,或者没有消费者,如果它没有减慢生产者的速度,则代理会耗尽内存。 不会影响Stomp客户端,因为代理会发送发送消息。 (自ActiveMQ-CPP 2.2.1起)

我很难解释这意味着什么(以及sendTimeout属性到底是什么/它做了什么):

什么是“消息发送”对象? 为什么ActiveMQ会等待回复? 它不是在JMS连接的服务器端吗? 它不应该等待请求吗? 它实际上超时了什么? 什么时候应该使用?

提前致谢!

According to this config page on the ActiveMQ site, the connection.sendTimeout property is:

Time to wait on Message Sends for a Response, default value of zero indicates to wait forever. Waiting forever allows the broker to have flow control over messages coming from this client if it is a fast producer or there is no consumer such that the broker would run out of memory if it did not slow down the producer. Does not affect Stomp clients as the sends are ack'd by the broker. (Since ActiveMQ-CPP 2.2.1)

I'm having difficulty interpreting what this means (and what the sendTimeout property really is/what it does):

What is a "Message Sends" object? Why would ActiveMQ be waiting for a response? Isn't it on the server-side of a JMS connection? Shouldn't it be waiting for a request? What does it actually timeout? When should it be used?

Thanks in advance!

最满意答案

超时会影响客户端向Broker发送消息。 在发送不是异步的情况下,客户端等待Broker返回指示消息已被接收并添加到消息存储的响应。 在某些情况下,如果经纪人已经参与了生产者流量控制,这可能会长时间阻塞,因为已达到其预设的内存限制之一。 如果客户端应用程序无法容忍长时间等待发送,则可以配置此超时,以便MessageProducer :: send不会无限期阻塞。

消息以同步模式发送,因为Connection使用alwaysSyncSend = true配置,或者因为MessageProducer在传递模式设置为Persistent的情况下发送。

通常,如果您已将Broker配置为与您的用例匹配的限制,则不应使用此设置。

The timeout affects the send of a Message by the client to the Broker. In the case where a send is not async then the client waits for the Broker to return a response indicating that the Message was received and added to the Message store. In some cases this can block for a long time if the Broker has engaged producer flow control because one of its preset memory limits has been reached. If the client application can't tolerate a long wait on send it could configure this timeout so that MessageProducer::send doesn't indefinitely block.

Messages are sent in synchronous mode either because the Connection was configured with alwaysSyncSend=true or because the MessageProducer is sending with the delivery mode set to Persistent.

In general this setting shouldn't need to be used if you've configured your Broker with limits that match your use case.

更多推荐

本文发布于:2023-04-29 08:40:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1335989.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:ActiveMQConnectionFactory   sendTimeout

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!