启动 ActiveMQ
There now follows instructions on how to run the ActiveMQ Message Broker.
On Windows:
From a console window, change to the installation directory and run ActiveMQ:
cd [activemq_install_dir]
where activemq_install_dir is the directory in which ActiveMQ was installed, e.g., c:/Program Files/ActiveMQ-4.x.
Then type:
bin/activemq
NOTE: Working directories get created relative to the current directory. To create working directories in the proper place, ActiveMQ must be launched from its home/installation directory.
On Unix:
在SHELL命令行模式下,通过下面命令进入到ActiveMQ安装目录:
cd [activemq_install_dir]
然后输入下面命令启动ActiveMQ:
bin/activemq
或
bin/activemq > /tmp/smlog 2>&1 &;
Note: /tmp/smlog may be changed to another file name.
NOTE: Working directories get created relative to the current directory. To create working directories in the proper place, ActiveMQ must be launched from its home/installation directory.
| Warning Do NOT close the console or shell in which ActiveMQ was started, as that will terminate ActiveMQ (unless ActiveMQ was started with nohup). nohup bin/activemq > /tmp/smlog 2>&1 & |
WEB监控 ActiveMQ
There are various ways to monitor ActiveMQ. If you are on version 4.2 or later of ActiveMQ you can then monitor ActiveMQ using the Web Console by pointing your browser at
Or you can use the JMX support to view the running state of ActiveMQ.
停止ActiveMQ
不管在WINDOWS还是UNIX下, 在ActiveMQ 正在运行的控制台或SHELL命令行下输入"CTRL-C" 来终止运行
如果 ActiveMQ 是在后台启动,则可通过以下方法停止:
ps -ef|grep activemq
kill [PID]
[PID] 就是ActiveMQ 运行的进程ID.
配置 ActiveMQ
The ActiveMQ broker should now run. You can configure the broker by specifying an Xml Configuration file as a parameter to the activemq command. An alternative is to use the Broker Configuration URI to configure things on the command line in a concise format (though the configuration options are not as extensive as if you use Java or XML code). You can also
Also see Configuring Transports to see how you can configure the various connection, transport and broker options using the connection URL in the ActiveMQConnectionFactory.
See the Initial Configuration for details of which jars you need to add to your classpath to start using ActiveMQ in your Java code
If you want to use JNDI to connect to your JMS provider then please view the JNDI Support. If you are a Spring user you should read about Spring Support
After the installation, ActiveMQ is running with a basic configuration. For details on configuring options, please see refer to the Configuration section.