Activemq Connection connection.start()

本文探讨了在使用Java消息服务(JMS)时常见的一个问题:消费者未能接收到消息。文章详细介绍了如何确保JMS连接已启动并正确配置,同时提供了排查其他消费者干扰的建议。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://activemq.apache.org/i-am-not-receiving-any-messages-what-is-wrong.html

I am not receiving any messages - what is wrong?

very common gotcha when working with JMS is forgetting to start the JMS connection, creating a consumer and not having it receive any messages. I myself have tripped up over this one many many times! (smile)

Make sure you call the start() method on the JMS connection, otherwise messages will not be dispatched to your consumer.

This is such a common gotcha that as of 4.2 onwards, ActiveMQ will now log a warning if a message is received shortly after the connection was created if the connection was not started (as its so easy to forget to do this part (smile).

For more details see the discussion of the warnAboutUnstartedConnectionTimeout property on the Connection Configuration URI

If you are calling connection.start()

Another common gotcha is due to another consumer grabbing the messages. If its not that then please look at JMX or the Web Console to determine what consumers are available and their status. Then get some Support to help you resolve your issue.

转载于:https://my.oschina.net/u/2308739/blog/820041

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值