文档章节

Running Multiple ActiveMQ Instances on One Machine

大圈
 大圈
发布于 2015/07/24 09:56
字数 398
阅读 19
收藏 0

The Integration Zone is brought to you in partnership with WSO2. Learn more about WSO2's API Management by watching their on-demand webinar.

A few weeks ago I started making use of Apache ActiveMQ again as the JMSprovider with my Mule ESB solution. Since it had been a few years that I used ActiveMQ I thought it would be nice to check out some of the (new) features like the failover transport and other clustering features. To be able to test these last things I needed multiple installations of ActiveMQ on my machine. Luckily this isn’t very hard to accomplish, although the documentation on this on the ActiveMQ site is quite minimal.



The first step is to download and unzip the ActiveMQ package, which I did at ~/develop/apache-activemq-5.8.0.

To create the instances I go to the activeMQ home directory and use the ‘create’ command like this:

cd develop/apache-activemq-5.8.0/
./bin/activemq create instanceA
./bin/activemq create instanceB

Now if you do a ‘ls -l’ you will see that there are two subdirectories created, ‘instanceA’ and ‘instanceB’. Since both instances will make use of the default ports we have to modify the config for the second instance. Go to the directory ‘develop/apache-activemq-5.8.0/instanceB/conf’ and open the file ‘jetty.xml’ to make the webconsole available at port ’8162′ by modifying the following line:

<bean id="Connector" class="org.eclipse.jetty.server.nio.SelectChannelConnector">
  <property name="port" value="8162" />
</bean>

Next open the file ‘activemq.xml’ in the same directory and modify the following part:

<transportConnectors>
  <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
  <transportConnector name="openwire" uri="tcp://0.0.0.0:61617?maximumConnections=1000&wireformat.maxFrameSize=104857600"/>
  <transportConnector name="amqp" uri="amqp://0.0.0.0:5673?maximumConnections=1000&wireformat.maxFrameSize=104857600"/>
 </transportConnectors>

That’s it! Make sure both files are saved and start the first instance with:

cd ~/develop/apache-activemq-5.8.0/instanceA/bin
./instanceA console

Open up a new console and run the commands:

cd /Users/pascal/develop/apache-activemq-5.8.0/instanceB/bin
./instanceB console


Now you have two instances running next to each other and can start testing the ‘advanced’ functions of ActiveMQ.


The Integration Zone is brought to you in partnership with WSO2. Learn more about WSO2's API Management by watching their on-demand webinar.

Published at DZone with permission of Pascal Alma, DZone MVB. (source)

Opinions expressed by DZone contributors are their own.


本文转载自:https://dzone.com/articles/running-multiple-active

大圈
粉丝 4
博文 57
码字总数 21291
作品 0
朝阳
系统管理员
私信 提问
activeMq5.5版本正常启动 5.10.2版本启动结果如下,求高人解答

进入bin目录下启动 activemq.bat 就出现下面的结果,应该是版本问题。求有缘人解答 Java Runtime: Oracle Corporation 1.7.0_79 D:\jdk7\jre Heap sizes: current=1005568k free=989808k ma...

沐阳6011
2015/08/21
781
1
ActiveMQ 功能

activemq-all-5.8.0.jar,和slf4j-log4j12-1.6.1.jar 冲突了,这个怎么解决呢。 SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/C:/Users/chen/.......

唯风
2014/01/15
967
2
Ubuntu下安装ActiveMQ

主要参考http://www.jmkg.co.uk/2010/08/31/installing-activemq-on-ubuntu/,略有补充 1. 下载安装包,建立activemq用户,安装 下载最新的activemq,写此文时为5.7。 cd /opt/tar xvzf xxx...

RuralHunter
2013/01/22
0
0
Win7环境下安装ActiveMQ

参考ActiveMQ官方文档:http://activemq.apache.org/getting-started.html 安装ActiveMQ 近来要学习JMS,在网上查了些资料,发现ActiveMQ是比较流行的JMS开源框架,决定使用ActiveMQ来学习J...

纠结名字
2015/08/09
0
0
JMS配置说明-----activeMQ-5.6

1 简介 activeMQ是一个完全支持JMS1.1 和J2EE规范的JMS Provider实现; 尽管规范出台已经是很久的事情了,但JMS在当今的J2EE应用中仍然扮演着特殊的地位; 特性列表 多种语言和协议编写客户端...

次渠龙哥
2018/06/26
0
0

没有更多内容

加载失败,请刷新页面

加载更多

Jenkins系列_插件安装及报错处理

进入Jenkins之后我们可以进行插件的安装,插件管理位于以下模块: 发现上面报了一堆错误,是因为插件的依赖没有安装好,那么这一节,就先把这些错误解决掉吧。解决完成后,也就基本会使用插件...

shzwork
今天
2
0
mysql mysql的所有查询语句和聚合函数(整理一下,忘记了可以随时看看)

查询所有字段 select * from 表名; 查询自定字段 select 字段名 from 表名; 查询指定数据 select * from 表名 where 条件; 带关键字IN的查询 select * from 表名 where 条件 [not] in(元素...

edison_kwok
昨天
9
0
多线程同时加载缓存实现

import com.google.common.cache.Cache;import com.google.common.cache.CacheBuilder;import java.util.concurrent.ExecutionException;import java.util.concurrent.ExecutorServi......

暗中观察
昨天
3
0
利用VisualVM 内存查看

准备工作,建几个测试类。等下就是要查看这几个类里面的属性 package visualvm;public class MultiObject { private String str; private int i; MultiObject(String str...

冷基
昨天
2
0
组装一台工作游戏两用机

一、配置清单如下: 分类 项目 价格(元) 主板 华硕(ASUS)TUF Z370-PLUS GAMING II 电竞特工 Z370二代 支持9代CPU 1049 CPU 英特尔(Intel) i7 8700K 酷睿六核 盒装CPU处理器 2640 风扇 九...

mbzhong
昨天
4
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部