13.2 优化消息生产者

博客已搬家, 更好阅读体验, 猛戳 http://www.jack-yin.com/coding/translation/activemq-in-action/1797.html

13.2 Optimizing message producers

13.2 优化消息生产者

The rate at which producers send  messages to an ActiveMQ message broker  before

they’re dispatched to consumers is a fundamental element of overall application

performance. We’ll now cover some tuning parameters that affect the  throughput

and latency of messages sent from a message producer to an ActiveMQ broker.

在代理分发消息到消息消费者之前,消息生产者发送消息到代理的效率是影响整个应用程序性能

的基本元素.下面我们将关注几个消息生产者发送消息给代理时,影响消息吞吐量和消息发送延迟

的调优参数.

13.2.1 Asynchronous send

13.2.1 异步发送

We’ve already covered  the performance gains  that can be  achieved if you  use

nonpersistent  delivery  for  messages. In  ActiveMQ  nonpersistent  delivery is

reliable, in that delivery of  messages will survive network outages  and system

crashes (as long as the producer is active—it holds messages for redelivery  in

its failover transport cache).  But you can also  get the same performance  gain

for persistent  messages by  setting the  useAsyncSend property  on the  message

producer’s connection factory, as shown next.

我们已经了解了使用非持久化消息分发可以带来性能提升.ActiveMQ中非持久化消息分发是可靠的,

因为消息会在网络故障和系统崩溃(只要消息生产者依然是活动的--此时消息生产者将消息缓存在失效

转移连接器的缓存中)中幸存下来.但是,通过设置消息生产者的连接工厂的useAsyncSend属性,你仍然

可以在使用持久化消息时获得性能提升,请看下面示例代码:

.......................

博客已搬家, 更好阅读体验, 猛戳 http://www.jack-yin.com/coding/translation/activemq-in-action/1797.html

猜你喜欢

转载自jackyin5918.iteye.com/blog/1998422
今日推荐