apache activemq的重连
1、activemq的重连机制
maxReconnectAttempts |
-1 | 0 |
From version 5.6 onwards: -1 is default and means retry forever, 0 means don't retry (only try connection once but no retry). |
版本不一样,设置重连的值也不一样,5.6之前的是0代表无限重连,5.6之前的是-1代表重连
http://activemq.apache.org/failover-transport-reference.html
2、activemq的配置host出现问题
在linux的/etc/hosts/目录下添加配置信息
[2015-10-21 18:17:43][WARN ][org.apache.activemq.util.IdGenerator:58] could not generate unique stub
java.net.UnknownHostException: portal.test: portal.test: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1438) ~[na:1.7.0_09-icedtea]
at org.apache.activemq.util.IdGenerator.<clinit>(IdGenerator.java:52) ~[activemq-all-activemq-all-5.3.2.jar:5.3.2]
at org.apache.activemq.ActiveMQConnection.<clinit>(ActiveMQConnection.java:110) [activemq-all-activemq-all-5.3.2.jar:5.3.2]
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:291) [activemq-all-activemq-all-5.3.2.jar:5.3.2]
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:259) [activemq-all-activemq-all-5.3.2.jar:5.3.2]
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:230) [activemq-all-activemq-all-5.3.2.jar:5.3.2]
at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:178) [activemq-all-activemq-all-5.3.2.jar:5.3.2]
at org.apache.activemq.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:125) [activemq-pool-5.3.2.jar:5.3.2]
at org.apache.activemq.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:110) [activemq-pool-5.3.2.jar:5.3.2]
at org.apache.activemq.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:81) [activemq-pool-5.3.2.jar:5.3.2]
at org.springframework.jms.connection.SingleConnectionFactory.doCreateConnection(SingleConnectionFactory.java:342) [spring-jms-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:288) [spring-jms-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:225) [spring-jms-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184) [spring-jms-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:405) [spring-jms-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.jms.listener.AbstractJmsListeningContainer.establishSharedConnection(AbstractJmsListeningContainer.java:373) [spring-jms-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.jms.listener.DefaultMessageListenerContainer.establishSharedConnection(DefaultMessageListenerContainer.java:765) [spring-jms-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.jms.listener.AbstractJmsListeningContainer.doStart(AbstractJmsListeningContainer.java:280) [spring-jms-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.jms.listener.AbstractJmsListeningContainer.start(AbstractJmsListeningContainer.java:265) [spring-jms-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.jms.listener.DefaultMessageListenerContainer.start(DefaultMessageListenerContainer.java:566) [spring-jms-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:167) [spring-context-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:51) [spring-context-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:339) [spring-context-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:143) [spring-context-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:108) [spring-context-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:945) [spring-context-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) [spring-context-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410) [spring-web-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) [spring-web-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779) [catalina.jar:7.0.26]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273) [catalina.jar:7.0.26]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.26]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895) [catalina.jar:7.0.26]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871) [catalina.jar:7.0.26]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615) [catalina.jar:7.0.26]
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958) [catalina.jar:7.0.26]
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1599) [catalina.jar:7.0.26]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_09-icedtea]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [na:1.7.0_09-icedtea]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.7.0_09-icedtea]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_09-icedtea]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_09-icedtea]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_09-icedtea]
Caused by: java.net.UnknownHostException: portal.test: Name or service not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.7.0_09-icedtea]
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:866) ~[na:1.7.0_09-icedtea]
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1258) ~[na:1.7.0_09-icedtea]
at java.net.InetAddress.getLocalHost(InetAddress.java:1434) ~[na:1.7.0_09-icedtea]
... 43 common frames omitted
[2015-10-21 18:17:43][INFO ][org.springframework.jms.connection.CachingConnectionFactory:291] Established shared JMS Connection: PooledConnection { org.apache.activemq.pool.ConnectionPool@64055601 }
apache activemq的重连的更多相关文章
- Apache ActiveMQの版本更迭和Apache ActiveMQの故障转移
本文描述apache activemq 版本更迭的原因以及Apache ActiveMQのThe Failover Transport new features in 5.2.0 1.对信息的传输/ ...
- 消息队列MQ - Apache ActiveMQ
Apache ActiveMQ是Apache软件基金会所研发的开放源码消息中间件:由于ActiveMQ是一个纯Jave程式,因此只需要操作系统支持Java虚拟机,ActiveMQ便可执行. 1.que ...
- apache activemq 学习笔记
0.activemq的概念 activemq实现了jms(java Message server),用于接收,发送,处理消息的开源消息总线. 1.activemq和jms的区别 jms说白了就是jav ...
- How to Setup Replicated LevelDB Persistence in Apache ActiveMQ 5.9--转载
原文地址:https://simplesassim.wordpress.com/2013/11/03/how-to-setup-replicated-leveldb-persistence-in-ap ...
- Apache ActiveMQ消息中间件的基本使用
Apache ActiveMQ是Apache软件基金会所研发的开放源码消息中间件:由于ActiveMQ是一个纯Java程式,因此只需要操作系统支援Java虚拟机,ActiveMQ便可执行. 支持Jav ...
- Apache ActiveMQ实战(2)-集群
ActiveMQ的集群 内嵌代理所引发的问题: 消息过载 管理混乱 如何解决这些问题--集群的两种方式: Master slave Broker clusters ActiveMQ的集群有两种方式: ...
- Apache ActiveMQ实战(1)-基本安装配置与消息类型
ActiveMQ简介 ActiveMQ是一种开源的,实现了JMS1.1规范的,面向消息(MOM)的中间件,为应用程序提供高效的.可扩展的.稳定的和安全的企业级消息通信.ActiveMQ使用Apache ...
- Linux下apache activemq的安装与配置
ActiveMQ 是Apache出品,最流行的,能力强劲的开源消息总线.ActiveMQ 是一个完全支持JMS1.1和J2EE 1.4规范 的 JMS Provider实现,尽管JMS规范出台已经是很 ...
- Apache ActiveMQ 学习一
Apache ActiveMQ 5.8.0 Java 7 support (compiled with jdk6 and validated with jdk7) apache-activemq-5. ...
随机推荐
- linux rpm问题:怎样查看rpm安装包的安装路径
x rpm问题:怎样查看rpm安装包的安装路径 2010-07-12 21:19:15 标签:rpm linux 路径 休闲 职场 rpm -qpl xxxxxx.rpm 1.如何安装rpm软件包 ...
- C#学习笔记--详解委托,事件与回调函数
.Net编程中最经常用的元素,事件必然是其中之一.无论在ASP.NET还是WINFrom开发中,窗体加载(Load),绘制(Paint),初始化(Init)等等.“protected void Pag ...
- 与你相遇好幸运,Sails.js自定义数据库名
在/api/models/下,自定义的.js文件内容 module.exports = { tableName: '自定义的数据库名', autoCreatedAt: false, //关闭 au ...
- 14.模板方法模式(Template Method)
using System; namespace ConsoleApplication7 { class Program { /// <summary> /// 模板方法模式——在一个抽象类 ...
- Faster-rnnlm代码分析1 - 词表构建,Nnet成员
https://github.com/yandex/faster-rnnlm Gdb ./rnnlm r -rnnlm model-good.faster -train thread.titl ...
- ytu 2558: 游起来吧!超妹!(水题,趣味数学题)
2558: 游起来吧!超妹! Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 7 Solved: 3[Submit][Status][Web Board ...
- HDU5781 ATM Mechine(DP 期望)
应该是machine 和POJ3783 Balls类型相似. 现在上界为i元,猜错次数最多为j时,开始猜测为k元,有两种情况: 1 猜中:(i - k + 1) * dp[i - k][j] 2 猜不 ...
- 攻城狮在路上(贰) Spring(四)--- Spring BeanFactory简介
BeanFactory时Spring框架最核心的接口,它提供了高级IoC的配置机制,使管理不同类型的Java对象成为了可能.我们一般称BeanFactory为IoC容器.BeanFactory是Spr ...
- oracle检查点队列(checkpoint queue)
buffer cache CBC链 按地址链 LRU 干净buffer LRUW 脏buffer 按照冷热 checkpoint queue:链buffer,①链脏块②按buffer第一次脏的时 ...
- WPF QuickStart系列之线程模型(Thread Model)
这篇博客将介绍WPF中的线程模型. 首先我们先来看一个例子,用来计算一定范围内的素数个数. XAML: <Grid> <Grid.RowDefinitions> <Row ...