一、安装
1. 从activemq.apache.org下载最新版本的ActiveMQ 二进制压缩文件apache-activemq-x.x.x-bin.zip(其中x.x.x是ActiveMQ的版本号码)
2. 将文件解压至任一地方即可,记作${ActiveMQ}
二、启动
1. 运行文件夹${ActiveMQ}/bin/activemq.bat。即会输入类似的如下信息:
Java Runtime: Sun Microsystems Inc. 1.6.0_20 D:\Java\jdk1.6.0_20\jre
Heap sizes: current=15872k free=13396k max=506816k
JVM args: -Dcom.sun.management.jmxremote -Xmx512M -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Djava.util.logging.config.file=logging.properties -Dactivemq.classpath=D:\Java\apache-activemq-5.5.0\bin\../conf;D:\Java\apache-activemq-5.5.0\bin\../conf; -Dactivemq.home=D:\Java\apache-activemq-5.5.0\bin\.. -Dactivemq.base=D:\Java\apache-activemq-5.5.0\bin\..
ACTIVEMQ_HOME: D:\Java\apache-activemq-5.5.0\bin\..
ACTIVEMQ_BASE: D:\Java\apache-activemq-5.5.0\bin\..
Loading message broker from: xbean:activemq.xml
INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@bb7465: startup date [Sat Aug 20 01:58:38 CST 2011]; root of context hierarchy
WARN | destroyApplicationContextOnStop parameter is deprecated, please use shutdown hooks instead
INFO | PListStore:D:\Java\apache-activemq-5.5.0\bin\..\data\localhost\tmp_storage started
INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[D:\Java\apache-activemq-5.5.0\bin\..\data\kahadb]
INFO | KahaDB is version 3
INFO | Recovering from the journal
INFO | Recovery replayed 1 operations from the journal in 0.016 seconds.
INFO | ActiveMQ 5.5.0 JMS Message Broker (localhost) is starting
INFO | For help or more information please see: http://activemq.apache.org/
INFO | Listening for connections at: tcp://PC-201012101012:61616
INFO | Connector openwire Started
INFO | ActiveMQ JMS Message Broker (localhost, ID:PC-201012101012-3784-1313776719906-0:1) started
INFO | jetty-7.1.6.v20100715
INFO | ActiveMQ WebConsole initialized.
INFO | Initializing Spring FrameworkServlet 'dispatcher'
INFO | ActiveMQ Console at http://0.0.0.0:8161/admin
INFO | Initializing Spring root WebApplicationContext
INFO | OSGi environment not detected.
INFO | Apache Camel 2.7.0 (CamelContext: camel) is starting
INFO | JMX enabled. Using ManagedManagementStrategy.
INFO | Found 5 packages with 16 @Converter classes to load
INFO | Loaded 152 type converters in 0.593 seconds
INFO | Connector vm://localhost Started
INFO | Route: route1 started and consuming from: Endpoint[activemq://example.A]
INFO | Total 1 routes, of which 1 is started.
INFO | Apache Camel 2.7.0 (CamelContext: camel) started in 1.062 seconds
INFO | Camel Console at http://0.0.0.0:8161/camel
INFO | ActiveMQ Web Demos at http://0.0.0.0:8161/demo
INFO | RESTful file access application at http://0.0.0.0:8161/fileserver
INFO | Started SelectChannelConnector@0.0.0.0:8161
三、测试
1. 因为ActiveMQ内嵌了jetty服务器,所以可以通过如下方式来测试ActiveMQ是否启动
管理平台网址: http://localhost:8161/admin/
Demo网址 : http://localhost:8161/demo/
2.ActiveMQ默认的TCP端口是61616。所以通过如下命令进行检查
netstat -an|find "61616"
3. ActiveMQ默认的Jetty端口8161。所以也可以通过如下命令进行检查
netstat -an|find "8161"