...
if myConfig.xml is in the classpath
Code Block |
activemq xbean:myConfig.xml
|
or to use the file path system
Code Block |
activemq xbean:file:../conf/myConfig.xml
|
AMQ 3.x
Code Block |
activemq myConfig.xml
|
Or to use the default config file its just
Code Block |
activemq
|
If you have a source distribution you can run a broker using Maven specifying one of these configuration files as follows
under the assembly module run :
Code Block |
maven server -Dconfig=xbean:file:src/release/conf/activemq.xml
|
If your classpath is set up correctly you can achieve the same thing from the command line
Code Block |
java org.apache.activemq.broker.Main xbean:file:src/release/conf/activemq.xml
|
...
You can also use the XML Configuration to configure embedded brokers. For example using the JNDI configuration mechanism you can do the following
BrokerXmlConfigFromJNDITest
Or of you want to explicitly configure the embedded broker via Java code you can do the following
BrokerXmlConfigStartTest
...