ActiveMQ的启动和配置介绍

来源:互联网 发布:邢山虎 知乎 编辑:程序博客网 时间:2024/06/05 08:26

原文地址:http://activemq.apache.org/version-5-getting-started.html

Starting ActiveMQ with a different configuration file

By default ActiveMQ uses the conf/activemq.xml as the main configuration file when starting. If you want to use a different configuration file you can specify this as a parameter.

ActiveMQ 5.8 or older

For example to use conf/activemq-demo.xml which includes the web demos, you do as follows:

bin/activemq console xbean:conf/activemq-demo.xml

To start Active in console mode and load the conf/activemq-demo.xml file. Yes you need the xbean: as prefix.

And to launch as a background process you can do:

bin/activemq start xbean:conf/activemq-demo.xml

ActiveMQ 5.9 onwards

For example to use examples/conf/activemq-demo.xml which includes the web demos, you do as follows:

bin/activemq console xbean:examples/conf/activemq-demo.xml

To start Active in console mode and load the examples/conf/activemq-demo.xml file. Yes you need the xbean: as prefix.

And to launch as a background process you can do:

bin/activemq start xbean:examples/conf/activemq-demo.xml

Configuring 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.

Additional Resources

If you are new to using ActiveMQ, running the Web Samples or the Examples is a good next step to learn more about ActiveMQ.


0 0
原创粉丝点击