ActiveMQ阻塞问题

hust_moonlight 2014-08-31 10:36:33
使用ActiveMQ,为了测试拔掉了网线,就出来如下异常
- Transport Connection to: tcp://211.69.207.52:11334 failed: java.net.SocketException: Connection reset
- Transport Connection to: tcp://211.69.207.52:11335 failed: java.net.SocketException: Connection reset
- Transport Connection to: tcp://211.69.207.52:11333 failed: java.net.SocketException: Connection reset
- Transport (tcp://211.69.207.52:61616) failed, reason: java.net.SocketException: Connection reset, attempting to automatically reconnect
- Transport (tcp://211.69.207.52:61616) failed, reason: java.net.SocketException: Connection reset, attempting to automatically reconnect
- Transport (tcp://211.69.207.52:61616) failed, reason: java.net.SocketException: Connection reset, attempting to automatically reconnect

此后程序就堵塞在producer.send(msg); 这里
当连上网线后,提示
- Successfully reconnected to tcp://211.69.207.52:61616
- Successfully reconnected to tcp://211.69.207.52:61616

此后程序才能继续跑下去

想让能在网线拔掉的状态下,生产者能继续发消息 不知道这个异常是怎么产生的
...全文
1393 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hust_moonlight 2014-09-03
  • 打赏
  • 举报
回复
引用 2 楼 fangmingshijie 的回复:
你应该设置持久化订阅了吧。有没有这句设置setDeliveryMode(DeliveryMode.PERSISTENT);
就你一个回了,虽然是自己解决了 分都给你得了
hust_moonlight 2014-09-02
  • 打赏
  • 举报
回复
引用 2 楼 fangmingshijie 的回复:
你应该设置持久化订阅了吧。有没有这句设置setDeliveryMode(DeliveryMode.PERSISTENT);
我比较怀疑是内存的问题 我同样的代码在有的机器上是没有这个问题的 不出错的电脑上启动信息最后两句是: - Memory Usage for the Broker (64 mb) is more than the maximum available for the JVM: 63 mb - Store limit is 102400 mb, whilst the data directory: D:\Java Workspace\OSGiConfig\activemq-data\localhost\KahaDB only has 77365 mb of usable space Message broker started .... 而出错的电脑是输出是: - Store limit is 102400 mb, whilst the data directory: D:\Java Workspace\OSGiConfig\activemq-data\localhost\KahaDB only has 34421 mb of usable space - Temporary Store limit is 51200 mb, whilst the temporary data directory: D:\Java Workspace\OSGiConfig\activemq-data\localhost\tmp_storage only has 34421 mb of usable space Message broker started .... 应该是这么个问题吧?
  • 打赏
  • 举报
回复
你应该设置持久化订阅了吧。有没有这句设置setDeliveryMode(DeliveryMode.PERSISTENT);
hust_moonlight 2014-09-02
  • 打赏
  • 举报
回复
不知道是不是我的配置有问题? 启动时的输出是这样: Msg Broker url=tcp://211.69.207.52:61616 - JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi - PListStore:[D:\Java Workspace\OSGiConfig\activemq-data\localhost\tmp_storage] started - Using Persistence Adapter: KahaDBPersistenceAdapter[D:\Java Workspace\OSGiConfig\activemq-data\localhost\KahaDB] - KahaDB is version 4 - Recovering from the journal ... - Recovery replayed 5 operations from the journal in 0.0 seconds. - Apache ActiveMQ 5.7.0 (localhost, ID:penguin-4482-1409623892703-0:1) is starting - Listening for connections at: tcp://penguin:61616 - Connector tcp://penguin:61616 Started - Apache ActiveMQ 5.7.0 (localhost, ID:penguin-4482-1409623892703-0:1) started - For help or more information please see: http://activemq.apache.org - Store limit is 102400 mb, whilst the data directory: D:\Java Workspace\OSGiConfig\activemq-data\localhost\KahaDB only has 34421 mb of usable space - Temporary Store limit is 51200 mb, whilst the temporary data directory: D:\Java Workspace\OSGiConfig\activemq-data\localhost\tmp_storage only has 34421 mb of usable space Message broker started .... - Successfully connected to tcp://211.69.207.52:61616 - Successfully connected to tcp://211.69.207.52:61616 - Successfully connected to tcp://211.69.207.52:61616
hust_moonlight 2014-09-02
  • 打赏
  • 举报
回复
折腾了这么久,原来是因为win7和XP系统有点区别。 xp下地址写为localhost,拔掉网线后也能在本机通信了

67,550

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧