activemq mysql 配置详解_ActiveMQ配置详解

一.消息目的地策略

在节点destinationPolicy配置策略,可以对单个或者所有的主题和队列进行设置,使用流量监控,当消息达到memoryLimit的时候,ActiveMQ会减慢消息的产生甚至阻塞,destinationPolicy的配置如下:

二.存储配置

producerFlowControl表示是否监控流量,默认为true,如果设置为false,消息就会存在磁盘中以防止内存溢 出;memoryLimit表示在producerFlowControl=”true”的情况下,消息存储在内存中最大量,当消息达到这个值 时,ActiveMQ会减慢消息的产生甚至阻塞。

队列分发策略如下:

propertydefaultdescription

useConsumerPriority

true

use the priority of a consumer when dispatching messages from a Queue

strictOrderDispatch

false

if true queue will not round robin consumers, but it'll use a single one until its prefetch buffer is full

optimizedDispatch

false

don't use a separate thread for dispatching from a Queue

lazyDispatch

false

only page in from store the number of messages that can be dispatched at time

consumersBeforeDispatchStarts

0

when the first consumer connects, wait for specified number of consumers before message dispatching starts

timeBeforeDispatchStarts

0

when the first consumer connects, wait for specified time (in ms) before message dispatching starts

queuePrefetch

n/a

sets the prefetch for consumers that are using the default value

expireMessagesPeriod

30000

the period (in ms) of checks for message expiry on queued messages, value of 0 disables

简单翻译如下:

useConsumerPriority:默认策略,按照用户优先级设置发送消息

strictOrderDispatchPolicy:保证每个topic consumer会以相同的顺序接收消息,代价是性能上的损失

当producer发送的持久化消息到达broker之后,broker首先会把它保存在持久存储中。接下来,如果发现当前有活跃的 consumer,如果这个consumer消费消息的速度能跟上producer生产消息的速度,那么Acti

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值