关于JMS性能一些相关

 

感觉作用不是很大,但还是记到这里。均属转载。
  • Start the consumer before you start the producer so that the initial messages do not need to queue.
  • Use a ConnectionConsumer to process messages concurrently with a ServerSessionPool.
  • Close resources (e.g. connections, session objects, producers, consumers) when finished with them.
  • DUPS_OK_ACKNOWLEDGE and AUTO_ACKNOWLEDGE perform better than CLIENT_ACKNOWLEDGE.
  • Use separate transactional sessions and non-transactional sessions for transactional and non-transactional messages.
  • Tune the Destination parameters: a smaller capacity increases message throughput; a higher redelivery delay and lower redelivery limit reduces the overhead.
  • Choose non-durable (NON_PERSISTENT) messages wherever appropriate to avoid the persistency overhead.
  • Set the TimeToLive value as low as feasible (default is for messages to never expire).
  • Receive messages asynchronously with a MessageListener implementation.
  • Choose the message type that minimizes memory overheads.
  • Use 'transient' variables to reduce serialization overheads.
  • 在消费/生产一条消息时,均创建一个全新Consumer/Producer,工作完毕即可关闭,此工作方式的好处是不产生死连接,但是同时带来了性能的大幅下降,Consumer/Producer的创建,是一个非常耗时的过程,需要连接JMS中间件,注册监听器,确认,关闭过程需要通知中间件卸载监听器。
  • 频繁的短连接将对JMS中间件稳定性的影响。很多JMS中间件经受不住高并发短连接操作,会造成队列假死,消息丢失、消息脏读等问题,特别是在进行select操作过程中更为明显。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值