Adds new variables for activemq.conf and activemq.data to allow for easy externalization of configuration and data files.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1245654 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2012-02-17 16:57:35 +00:00
parent 9f0a673e36
commit 3a561cc8c7
22 changed files with 474 additions and 427 deletions

View File

@ -40,8 +40,6 @@ import java.util.StringTokenizer;
/** /**
* Main class that can bootstrap an ActiveMQ broker console. Handles command * Main class that can bootstrap an ActiveMQ broker console. Handles command
* line argument parsing to set up and run broker tasks. * line argument parsing to set up and run broker tasks.
*
*
*/ */
public class Main { public class Main {
@ -62,10 +60,10 @@ public class Main {
// Parse for extension directory option // Parse for extension directory option
app.parseExtensions(tokens); app.parseExtensions(tokens);
// lets add the conf directory first, to find the log4j.properties just in case its not // lets add the conf directory first, to find the log4j.properties just in case its not
// in the activemq.classpath system property or some jar incorrectly includes one // in the activemq.classpath system property or some jar incorrectly includes one
File confDir = new File(app.getActiveMQBase(), "conf"); File confDir = app.getActiveMQConfig();
app.addClassPath(confDir); app.addClassPath(confDir);
// Add the following to the classpath: // Add the following to the classpath:
// //
@ -96,7 +94,6 @@ public class Main {
} }
app.addExtensionDirectory(new File(homeLibDir, "optional")); app.addExtensionDirectory(new File(homeLibDir, "optional"));
app.addExtensionDirectory(new File(homeLibDir, "web")); app.addExtensionDirectory(new File(homeLibDir, "web"));
} }
// Add any custom classpath specified from the system property // Add any custom classpath specified from the system property
@ -125,7 +122,7 @@ public class Main {
/** /**
* Print out what's in the classloader tree being used. * Print out what's in the classloader tree being used.
* *
* @param cl * @param cl
* @return depth * @return depth
*/ */
@ -219,17 +216,17 @@ public class Main {
System.out.println("Java Runtime: " + buffer.toString()); System.out.println("Java Runtime: " + buffer.toString());
buffer = new StringBuilder(); buffer = new StringBuilder();
buffer.append("current="); buffer.append("current=");
buffer.append(Runtime.getRuntime().totalMemory()/1024L); buffer.append(Runtime.getRuntime().totalMemory()/1024L);
buffer.append("k free="); buffer.append("k free=");
buffer.append(Runtime.getRuntime().freeMemory()/1024L); buffer.append(Runtime.getRuntime().freeMemory()/1024L);
buffer.append("k max="); buffer.append("k max=");
buffer.append(Runtime.getRuntime().maxMemory()/1024L); buffer.append(Runtime.getRuntime().maxMemory()/1024L);
buffer.append("k"); buffer.append("k");
System.out.println(" Heap sizes: " + buffer.toString()); System.out.println(" Heap sizes: " + buffer.toString());
List jvmArgs = ManagementFactory.getRuntimeMXBean().getInputArguments(); List<?> jvmArgs = ManagementFactory.getRuntimeMXBean().getInputArguments();
buffer = new StringBuilder(); buffer = new StringBuilder();
for (Object arg : jvmArgs) { for (Object arg : jvmArgs) {
buffer.append(" ").append(arg); buffer.append(" ").append(arg);
} }
@ -237,14 +234,16 @@ public class Main {
System.out.println("ACTIVEMQ_HOME: " + getActiveMQHome()); System.out.println("ACTIVEMQ_HOME: " + getActiveMQHome());
System.out.println("ACTIVEMQ_BASE: " + getActiveMQBase()); System.out.println("ACTIVEMQ_BASE: " + getActiveMQBase());
System.out.println("ACTIVEMQ_CONFIG: " + getActiveMQConfig());
System.out.println("ACTIVEMQ_DATA: " + getActiveMQDataDir());
ClassLoader cl = getClassLoader(); ClassLoader cl = getClassLoader();
Thread.currentThread().setContextClassLoader(cl); Thread.currentThread().setContextClassLoader(cl);
// Use reflection to run the task. // Use reflection to run the task.
try { try {
String[] args = tokens.toArray(new String[tokens.size()]); String[] args = tokens.toArray(new String[tokens.size()]);
Class task = cl.loadClass(TASK_DEFAULT_CLASS); Class<?> task = cl.loadClass(TASK_DEFAULT_CLASS);
Method runTask = task.getMethod("main", new Class[] { Method runTask = task.getMethod("main", new Class[] {
String[].class, InputStream.class, PrintStream.class String[].class, InputStream.class, PrintStream.class
}); });
@ -277,7 +276,7 @@ public class Main {
* The extension directory feature will not work if the broker factory is * The extension directory feature will not work if the broker factory is
* already in the classpath since we have to load him from a child * already in the classpath since we have to load him from a child
* ClassLoader we build for it to work correctly. * ClassLoader we build for it to work correctly.
* *
* @return true, if extension dir can be used. false otherwise. * @return true, if extension dir can be used. false otherwise.
*/ */
public boolean canUseExtdir() { public boolean canUseExtdir() {
@ -299,8 +298,6 @@ public class Main {
for (Iterator<File> iter = activeMQClassPath.iterator(); iter.hasNext();) { for (Iterator<File> iter = activeMQClassPath.iterator(); iter.hasNext();) {
File dir = iter.next(); File dir = iter.next();
// try{ System.out.println("Adding to classpath: " +
// dir.getCanonicalPath()); }catch(Exception e){}
urls.add(dir.toURI().toURL()); urls.add(dir.toURI().toURL());
} }
@ -310,25 +307,16 @@ public class Main {
File[] files = dir.listFiles(); File[] files = dir.listFiles();
if (files != null) { if (files != null) {
// Sort the jars so that classpath built is // Sort the jars so that classpath built is consistently in the same
// consistently // order. Also allows us to use jar names to control classpath order.
// in the same order. Also allows us to use jar Arrays.sort(files, new Comparator<File>() {
// names to control public int compare(File f1, File f2) {
// classpath order.
Arrays.sort(files, new Comparator() {
public int compare(Object o1, Object o2) {
File f1 = (File)o1;
File f2 = (File)o2;
return f1.getName().compareTo(f2.getName()); return f1.getName().compareTo(f2.getName());
} }
}); });
for (int j = 0; j < files.length; j++) { for (int j = 0; j < files.length; j++) {
if (files[j].getName().endsWith(".zip") || files[j].getName().endsWith(".jar")) { if (files[j].getName().endsWith(".zip") || files[j].getName().endsWith(".jar")) {
// try{ System.out.println("Adding to
// classpath: " +
// files[j].getCanonicalPath());
// }catch(Exception e){}
urls.add(files[j].toURI().toURL()); urls.add(files[j].toURI().toURL());
} }
} }
@ -393,4 +381,26 @@ public class Main {
return activeMQBase; return activeMQBase;
} }
public File getActiveMQConfig() {
File activeMQConfig = null;
if (System.getProperty("activemq.conf") != null) {
activeMQConfig = new File(System.getProperty("activemq.conf"));
} else {
activeMQConfig = new File(getActiveMQBase() + "/conf");
}
return activeMQConfig;
}
public File getActiveMQDataDir() {
File activeMQDataDir = null;
if (System.getProperty("activemq.data") != null) {
activeMQDataDir = new File(System.getProperty("activemq.data"));
} else {
activeMQDataDir = new File(getActiveMQBase() + "/data");
}
return activeMQDataDir;
}
} }

View File

@ -5,31 +5,31 @@
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<!-- START SNIPPET: xbean --> <!-- START SNIPPET: xbean -->
<beans <beans
xmlns="http://www.springframework.org/schema/beans" xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core" xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi" xmlns:osgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd"> http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
<broker brokerName="web-console" useJmx="true" xmlns="http://activemq.apache.org/schema/core"> <broker brokerName="web-console" useJmx="true" xmlns="http://activemq.apache.org/schema/core">
<persistenceAdapter> <persistenceAdapter>
<kahaDB directory="${activemq.base}/data/kahadb"/> <kahaDB directory="${activemq.data}/kahadb"/>
</persistenceAdapter> </persistenceAdapter>
<transportConnectors> <transportConnectors>
@ -40,4 +40,4 @@
</broker> </broker>
</beans> </beans>
<!-- END SNIPPET: xbean --> <!-- END SNIPPET: xbean -->

View File

@ -90,8 +90,14 @@ if [ -z "$ACTIVEMQ_BASE" ] ; then
fi fi
# Active MQ configuration directory # Active MQ configuration directory
if [ -z "$ACTIVEMQ_CONFIG_DIR" ] ; then if [ -z "$ACTIVEMQ_CONF" ] ; then
ACTIVEMQ_CONFIG_DIR="$ACTIVEMQ_BASE/conf" # Preserve old configuration setting functionality.
if [ -z "$ACTIVEMQ_CONFIG_DIR" ] ; then
ACTIVEMQ_CONF="$ACTIVEMQ_BASE/conf"
ACTIVEMQ_CONF_DIR="ACTIVEMQ_DATA"
else
ACTIVEMQ_CONF="$ACTIVEMQ_CONFIG_DIR"
fi
fi fi
# Configure a user with non root priviledges, if no user is specified do not change user # Configure a user with non root priviledges, if no user is specified do not change user
@ -99,9 +105,15 @@ if [ -z "$ACTIVEMQ_USER" ] ; then
ACTIVEMQ_USER="" ACTIVEMQ_USER=""
fi fi
# Active MQ configuration directory # Active MQ data directory
if [ -z "$ACTIVEMQ_DATA_DIR" ]; then if [ -z "$ACTIVEMQ_DATA" ] ; then
ACTIVEMQ_DATA_DIR="$ACTIVEMQ_BASE/data" # Preserve old configuration setting functionality.
if [ -z "$ACTIVEMQ_DATA_DIR" ] ; then
ACTIVEMQ_DATA="$ACTIVEMQ_BASE/data"
ACTIVEMQ_DATA_DIR="ACTIVEMQ_DATA"
else
ACTIVEMQ_DATA="$ACTIVEMQ_DATA_DIR"
fi
fi fi
setCurrentUser(){ setCurrentUser(){
@ -381,6 +393,8 @@ invokeJar(){
-Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \ -Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \
-Dactivemq.home=\"${ACTIVEMQ_HOME}\" \ -Dactivemq.home=\"${ACTIVEMQ_HOME}\" \
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \ -Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
$ACTIVEMQ_CYGWIN \ $ACTIVEMQ_CYGWIN \
-jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS >/dev/null 2>&1 & -jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS >/dev/null 2>&1 &
RET=\"\$?\"; APID=\"\$!\"; RET=\"\$?\"; APID=\"\$!\";
@ -393,6 +407,8 @@ invokeJar(){
-Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \ -Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \
-Dactivemq.home=\"${ACTIVEMQ_HOME}\" \ -Dactivemq.home=\"${ACTIVEMQ_HOME}\" \
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \ -Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
$ACTIVEMQ_CYGWIN \ $ACTIVEMQ_CYGWIN \
-jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS --pid $PID & -jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS --pid $PID &
RET=\"\$?\"; APID=\"\$!\"; RET=\"\$?\"; APID=\"\$!\";
@ -403,6 +419,8 @@ invokeJar(){
-Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \ -Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \
-Dactivemq.home=\"${ACTIVEMQ_HOME}\" \ -Dactivemq.home=\"${ACTIVEMQ_HOME}\" \
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \ -Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
$ACTIVEMQ_CYGWIN \ $ACTIVEMQ_CYGWIN \
-jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS" $DOIT_POSTFIX -jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS" $DOIT_POSTFIX
RET="$?" RET="$?"

View File

@ -6,9 +6,9 @@
# The ASF licenses this file to You under the Apache License, Version 2.0 # The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with # (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at # the License. You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -116,10 +116,22 @@ if [ -z "$ACTIVEMQ_BASE" ] ; then
ACTIVEMQ_BASE="$ACTIVEMQ_HOME" ACTIVEMQ_BASE="$ACTIVEMQ_HOME"
fi fi
# Active MQ configuration directory
if [ -z "$ACTIVEMQ_CONF" ] ; then
ACTIVEMQ_CONF="$ACTIVEMQ_BASE/conf"
fi
# Active MQ data directory
if [ -z "$ACTIVEMQ_DATA" ] ; then
ACTIVEMQ_DATA="$ACTIVEMQ_BASE/data"
fi
# For Cygwin, switch paths to Windows format before running java # For Cygwin, switch paths to Windows format before running java
if $cygwin; then if $cygwin; then
ACTIVEMQ_HOME=`cygpath --windows "$ACTIVEMQ_HOME"` ACTIVEMQ_HOME=`cygpath --windows "$ACTIVEMQ_HOME"`
ACTIVEMQ_BASE=`cygpath --windows "$ACTIVEMQ_BASE"` ACTIVEMQ_BASE=`cygpath --windows "$ACTIVEMQ_BASE"`
ACTIVEMQ_CONF=`cygpath --windows "$ACTIVEMQ_CONF"`
ACTIVEMQ_DATA=`cygpath --windows "$ACTIVEMQ_DATA"`
ACTIVEMQ_CLASSPATH=`cygpath --path --windows "$ACTIVEMQ_CLASSPATH"` ACTIVEMQ_CLASSPATH=`cygpath --path --windows "$ACTIVEMQ_CLASSPATH"`
JAVA_HOME=`cygpath --windows "$JAVA_HOME"` JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
CLASSPATH=`cygpath --path --windows "$CLASSPATH"` CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
@ -127,7 +139,7 @@ if $cygwin; then
fi fi
# Set default classpath # Set default classpath
ACTIVEMQ_CLASSPATH="${ACTIVEMQ_BASE}/conf;"$ACTIVEMQ_CLASSPATH ACTIVEMQ_CLASSPATH="${ACTIVEMQ_CONF};"$ACTIVEMQ_CLASSPATH
if [ ""$1 = "start" ] ; then if [ ""$1 = "start" ] ; then
if [ -z "$ACTIVEMQ_OPTS" ] ; then if [ -z "$ACTIVEMQ_OPTS" ] ; then
@ -149,7 +161,7 @@ fi
#ACTIVEMQ_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005" #ACTIVEMQ_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
if [ -n "$CYGHOME" ]; then if [ -n "$CYGHOME" ]; then
exec "$JAVACMD" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS -Dactivemq.classpath="${ACTIVEMQ_CLASSPATH}" -Dactivemq.home="${ACTIVEMQ_HOME}" -Dactivemq.base="${ACTIVEMQ_BASE}" -Dcygwin.user.home="$CYGHOME" -jar "${ACTIVEMQ_HOME}/bin/run.jar" $@ exec "$JAVACMD" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS -Dactivemq.classpath="${ACTIVEMQ_CLASSPATH}" -Dactivemq.home="${ACTIVEMQ_HOME}" -Dactivemq.base="${ACTIVEMQ_BASE}" -Dactivemq.conf="${ACTIVEMQ_CONF}" -Dactivemq.data="${ACTIVEMQ_DATA}" -Dcygwin.user.home="$CYGHOME" -jar "${ACTIVEMQ_HOME}/bin/run.jar" $@
else else
exec "$JAVACMD" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS -Dactivemq.classpath="${ACTIVEMQ_CLASSPATH}" -Dactivemq.home="${ACTIVEMQ_HOME}" -Dactivemq.base="${ACTIVEMQ_BASE}" -jar "${ACTIVEMQ_HOME}/bin/run.jar" $@ exec "$JAVACMD" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS -Dactivemq.classpath="${ACTIVEMQ_CLASSPATH}" -Dactivemq.home="${ACTIVEMQ_HOME}" -Dactivemq.base="${ACTIVEMQ_BASE}" -Dactivemq.conf="${ACTIVEMQ_CONF}" -Dactivemq.data="${ACTIVEMQ_DATA}" -jar "${ACTIVEMQ_HOME}/bin/run.jar" $@
fi fi

View File

@ -71,6 +71,10 @@ echo.
if "%ACTIVEMQ_BASE%" == "" set ACTIVEMQ_BASE=%ACTIVEMQ_HOME% if "%ACTIVEMQ_BASE%" == "" set ACTIVEMQ_BASE=%ACTIVEMQ_HOME%
if "%ACTIVEMQ_CONF%" == "" set ACTIVEMQ_CONF=%ACTIVEMQ_HOME%\conf
if "%ACTIVEMQ_DATA%" == "" set ACTIVEMQ_DATA=%ACTIVEMQ_HOME%\data
if /i not "%1" == "start" goto debugOpts if /i not "%1" == "start" goto debugOpts
@ -88,9 +92,8 @@ REM Uncomment to enable remote debugging
REM SET ACTIVEMQ_DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 REM SET ACTIVEMQ_DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
REM Setup ActiveMQ Classpath. Default is the conf directory. REM Setup ActiveMQ Classpath. Default is the conf directory.
set ACTIVEMQ_CLASSPATH=%ACTIVEMQ_BASE%/conf;%ACTIVEMQ_CLASSPATH% set ACTIVEMQ_CLASSPATH=%ACTIVEMQ_CONF%;%ACTIVEMQ_DATA%;%ACTIVEMQ_CLASSPATH%
"%_JAVACMD%" %SUNJMX% %ACTIVEMQ_DEBUG_OPTS% %ACTIVEMQ_OPTS% %SSL_OPTS% -Dactivemq.classpath="%ACTIVEMQ_CLASSPATH%" -Dactivemq.home="%ACTIVEMQ_HOME%" -Dactivemq.base="%ACTIVEMQ_BASE%" -Dactivemq.data="%ACTIVEMQ_DATA%" -Dactivemq.conf="%ACTIVEMQ_CONF%" -jar "%ACTIVEMQ_HOME%/bin/run.jar" %*
"%_JAVACMD%" %SUNJMX% %ACTIVEMQ_DEBUG_OPTS% %ACTIVEMQ_OPTS% %SSL_OPTS% -Dactivemq.classpath="%ACTIVEMQ_CLASSPATH%" -Dactivemq.home="%ACTIVEMQ_HOME%" -Dactivemq.base="%ACTIVEMQ_BASE%" -jar "%ACTIVEMQ_HOME%/bin/run.jar" %*
goto end goto end

View File

@ -71,6 +71,10 @@ echo.
if "%ACTIVEMQ_BASE%" == "" set ACTIVEMQ_BASE=%ACTIVEMQ_HOME% if "%ACTIVEMQ_BASE%" == "" set ACTIVEMQ_BASE=%ACTIVEMQ_HOME%
if "%ACTIVEMQ_CONF%" == "" set ACTIVEMQ_CONF=%ACTIVEMQ_HOME%\conf
if "%ACTIVEMQ_DATA%" == "" set ACTIVEMQ_DATA=%ACTIVEMQ_HOME%\data
if "%ACTIVEMQ_OPTS%" == "" set ACTIVEMQ_OPTS=-Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties if "%ACTIVEMQ_OPTS%" == "" set ACTIVEMQ_OPTS=-Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties
if "%SUNJMX%" == "" set SUNJMX=-Dcom.sun.management.jmxremote if "%SUNJMX%" == "" set SUNJMX=-Dcom.sun.management.jmxremote
@ -82,11 +86,11 @@ REM SET ACTIVEMQ_DEBUG_OPTS="-agentlib:yjpagent"
REM Uncomment to enable remote debugging REM Uncomment to enable remote debugging
REM SET ACTIVEMQ_DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 REM SET ACTIVEMQ_DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
REM Setup ActiveMQ Classpath. REM Setup ActiveMQ Classpath.
REM Add instance conf dir before AMQ install conf dir to pick up instance-specific classpath entries first REM Add instance conf dir before AMQ install conf dir to pick up instance-specific classpath entries first
set ACTIVEMQ_CLASSPATH=%ACTIVEMQ_BASE%/conf;%ACTIVEMQ_HOME%/conf;%ACTIVEMQ_CLASSPATH% set ACTIVEMQ_CLASSPATH=%ACTIVEMQ_CONF%;%ACTIVEMQ_BASE%/conf;%ACTIVEMQ_HOME%/conf;%ACTIVEMQ_CLASSPATH%
"%_JAVACMD%" %SUNJMX% %ACTIVEMQ_DEBUG_OPTS% %ACTIVEMQ_OPTS% %SSL_OPTS% -Dactivemq.classpath="%ACTIVEMQ_CLASSPATH%" -Dactivemq.home="%ACTIVEMQ_HOME%" -Dactivemq.base="%ACTIVEMQ_BASE%" -jar "%ACTIVEMQ_HOME%/bin/run.jar" start %* "%_JAVACMD%" %SUNJMX% %ACTIVEMQ_DEBUG_OPTS% %ACTIVEMQ_OPTS% %SSL_OPTS% -Dactivemq.classpath="%ACTIVEMQ_CLASSPATH%" -Dactivemq.home="%ACTIVEMQ_HOME%" -Dactivemq.base="%ACTIVEMQ_BASE%" -Dactivemq.conf="%ACTIVEMQ_CONF%" -Dactivemq.data="%ACTIVEMQ_DATA%" -jar "%ACTIVEMQ_HOME%/bin/run.jar" start %*
goto end goto end

View File

@ -5,9 +5,9 @@
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -25,26 +25,26 @@
<!-- Allows us to use system properties as variables in this configuration file --> <!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations"> <property name="locations">
<value>file:${activemq.base}/conf/credentials.properties</value> <value>file:${activemq.conf}/credentials.properties</value>
</property> </property>
</bean> </bean>
<!-- <!--
The <broker> element is used to configure the ActiveMQ broker. The <broker> element is used to configure the ActiveMQ broker.
--> -->
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data"> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
<!-- <!--
For better performances use VM cursor and small memory limit. For better performances use VM cursor and small memory limit.
For more information, see: For more information, see:
http://activemq.apache.org/message-cursors.html http://activemq.apache.org/message-cursors.html
Also, if your producer is "hanging", it's probably due to producer flow control. Also, if your producer is "hanging", it's probably due to producer flow control.
For more information, see: For more information, see:
http://activemq.apache.org/producer-flow-control.html http://activemq.apache.org/producer-flow-control.html
--> -->
<destinationPolicy> <destinationPolicy>
<policyMap> <policyMap>
<policyEntries> <policyEntries>
@ -56,9 +56,9 @@
<policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb"> <policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb">
<!-- Use VM cursor for better latency <!-- Use VM cursor for better latency
For more information, see: For more information, see:
http://activemq.apache.org/message-cursors.html http://activemq.apache.org/message-cursors.html
<pendingQueuePolicy> <pendingQueuePolicy>
<vmQueueCursor/> <vmQueueCursor/>
</pendingQueuePolicy> </pendingQueuePolicy>
@ -66,38 +66,38 @@
</policyEntry> </policyEntry>
</policyEntries> </policyEntries>
</policyMap> </policyMap>
</destinationPolicy> </destinationPolicy>
<!-- <!--
The managementContext is used to configure how ActiveMQ is exposed in The managementContext is used to configure how ActiveMQ is exposed in
JMX. By default, ActiveMQ uses the MBean server that is started by JMX. By default, ActiveMQ uses the MBean server that is started by
the JVM. For more information, see: the JVM. For more information, see:
http://activemq.apache.org/jmx.html http://activemq.apache.org/jmx.html
--> -->
<managementContext> <managementContext>
<managementContext createConnector="false"/> <managementContext createConnector="false"/>
</managementContext> </managementContext>
<!-- <!--
Configure message persistence for the broker. The default persistence Configure message persistence for the broker. The default persistence
mechanism is the KahaDB store (identified by the kahaDB tag). mechanism is the KahaDB store (identified by the kahaDB tag).
For more information, see: For more information, see:
http://activemq.apache.org/persistence.html http://activemq.apache.org/persistence.html
--> -->
<persistenceAdapter> <persistenceAdapter>
<kahaDB directory="${activemq.base}/data/kahadb"/> <kahaDB directory="${activemq.data}/kahadb"/>
</persistenceAdapter> </persistenceAdapter>
<!-- <!--
The systemUsage controls the maximum amount of space the broker will The systemUsage controls the maximum amount of space the broker will
use before slowing down producers. For more information, see: use before slowing down producers. For more information, see:
http://activemq.apache.org/producer-flow-control.html http://activemq.apache.org/producer-flow-control.html
<systemUsage> <systemUsage>
<systemUsage> <systemUsage>
<memoryUsage> <memoryUsage>
@ -111,13 +111,13 @@
</tempUsage> </tempUsage>
</systemUsage> </systemUsage>
</systemUsage> </systemUsage>
--> -->
<!-- <!--
The transport connectors expose ActiveMQ over a given protocol to The transport connectors expose ActiveMQ over a given protocol to
clients and other brokers. For more information, see: clients and other brokers. For more information, see:
http://activemq.apache.org/configuring-transports.html http://activemq.apache.org/configuring-transports.html
--> -->
<transportConnectors> <transportConnectors>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/> <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
@ -125,12 +125,12 @@
</broker> </broker>
<!-- <!--
Enable web consoles, REST and Ajax APIs and demos Enable web consoles, REST and Ajax APIs and demos
Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
--> -->
<import resource="jetty.xml"/> <import resource="jetty.xml"/>
</beans> </beans>
<!-- END SNIPPET: example --> <!-- END SNIPPET: example -->

View File

@ -22,7 +22,7 @@
<bean id="securityLoginService" class="org.eclipse.jetty.security.HashLoginService"> <bean id="securityLoginService" class="org.eclipse.jetty.security.HashLoginService">
<property name="name" value="ActiveMQRealm" /> <property name="name" value="ActiveMQRealm" />
<property name="config" value="${activemq.base}/conf/jetty-realm.properties" /> <property name="config" value="${activemq.conf}/jetty-realm.properties" />
</bean> </bean>
<bean id="securityConstraint" class="org.eclipse.jetty.http.security.Constraint"> <bean id="securityConstraint" class="org.eclipse.jetty.http.security.Constraint">

View File

@ -24,7 +24,7 @@
<!-- Allows us to use system properties as variables in this configuration file --> <!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations"> <property name="locations">
<value>file:${activemq.base}/conf/credentials.properties</value> <value>file:${activemq.conf}/credentials.properties</value>
</property> </property>
</bean> </bean>

View File

@ -5,24 +5,24 @@
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<!-- <!--
Communicate with a broker using command agent over XMPP Communicate with a broker using command agent over XMPP
For more information, see: For more information, see:
http://activemq.apache.org/command-agent.html and http://activemq.apache.org/command-agent.html and
http://activemq.apache.org/xmpp.html http://activemq.apache.org/xmpp.html
To run ActiveMQ with this configuration add xbean:conf/activemq-command.xml to your command To run ActiveMQ with this configuration add xbean:conf/activemq-command.xml to your command
e.g. $ bin/activemq console xbean:conf/activemq-command.xml e.g. $ bin/activemq console xbean:conf/activemq-command.xml
--> -->
<beans <beans
@ -31,22 +31,22 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<!-- Allows us to use system properties as variables in this configuration file --> <!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="command-broker" dataDirectory="${activemq.base}/data"> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="command-broker" dataDirectory="${activemq.data}">
<managementContext> <managementContext>
<managementContext createConnector="true"/> <managementContext createConnector="true"/>
</managementContext> </managementContext>
<transportConnectors> <transportConnectors>
<!-- Create a XMPP transport for XMPP clients. --> <!-- Create a XMPP transport for XMPP clients. -->
<transportConnector name="xmpp" uri="xmpp://localhost:61222"/> <transportConnector name="xmpp" uri="xmpp://localhost:61222"/>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/> <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
</transportConnectors> </transportConnectors>
</broker> </broker>
<!-- Create a command agent --> <!-- Create a command agent -->
<commandAgent xmlns="http://activemq.apache.org/schema/core" brokerUrl="vm://localhost"/> <commandAgent xmlns="http://activemq.apache.org/schema/core" brokerUrl="vm://localhost"/>
</beans> </beans>

View File

@ -5,54 +5,54 @@
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<!-- <!--
Demonstrates various ActiveMQ configuration options Demonstrates various ActiveMQ configuration options
To run ActiveMQ with this configuration add xbean:conf/activemq-demo.xml to your command To run ActiveMQ with this configuration add xbean:conf/activemq-demo.xml to your command
e.g. $ bin/activemq console xbean:conf/activemq-demo.xml e.g. $ bin/activemq console xbean:conf/activemq-demo.xml
--> -->
<beans <beans
xmlns="http://www.springframework.org/schema/beans" xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<!-- <!--
Allows us to use system properties as variables in this configuration Allows us to use system properties as variables in this configuration
file. For more information, see the Javadoc: file. For more information, see the Javadoc:
http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.html http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.html
--> -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations"> <property name="locations">
<value>file:${activemq.base}/conf/credentials.properties</value> <value>file:${activemq.conf}/credentials.properties</value>
</property> </property>
</bean> </bean>
<!-- <!--
The <broker> element is used to configure the ActiveMQ broker. The <broker> element is used to configure the ActiveMQ broker.
Tips: Tips:
- Change the brokerName attribute to something unique - Change the brokerName attribute to something unique
--> -->
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="amq-broker" useJmx="true" destroyApplicationContextOnStop="true"> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="amq-broker" useJmx="true" destroyApplicationContextOnStop="true">
<!-- <!--
Examples of destination-specific policies using destination Examples of destination-specific policies using destination
names or wildcards. For more information, see: names or wildcards. For more information, see:
http://activemq.apache.org/per-destination-policies.html http://activemq.apache.org/per-destination-policies.html
http://activemq.apache.org/destination-features.html http://activemq.apache.org/destination-features.html
http://activemq.apache.org/slow-consumer-handling.html http://activemq.apache.org/slow-consumer-handling.html
@ -61,22 +61,22 @@
<destinationPolicy> <destinationPolicy>
<policyMap> <policyMap>
<policyEntries> <policyEntries>
<!-- <!--
Limit ALL queues and topics to using 5mb of memory and turn on producer flow control Limit ALL queues and topics to using 5mb of memory and turn on producer flow control
--> -->
<policyEntry queue=">" producerFlowControl="true" memoryLimit="5mb"/> <policyEntry queue=">" producerFlowControl="true" memoryLimit="5mb"/>
<policyEntry topic=">" producerFlowControl="true" memoryLimit="5mb"> <policyEntry topic=">" producerFlowControl="true" memoryLimit="5mb">
<dispatchPolicy> <dispatchPolicy>
<!-- <!--
Use total ordering, see: Use total ordering, see:
http://activemq.apache.org/total-ordering.html http://activemq.apache.org/total-ordering.html
--> -->
<strictOrderDispatchPolicy/> <strictOrderDispatchPolicy/>
</dispatchPolicy> </dispatchPolicy>
<subscriptionRecoveryPolicy> <subscriptionRecoveryPolicy>
<!-- <!--
Upon subscription, receive the last image sent Upon subscription, receive the last image sent
on the destination. on the destination.
--> -->
<lastImageSubscriptionRecoveryPolicy/> <lastImageSubscriptionRecoveryPolicy/>
</subscriptionRecoveryPolicy> </subscriptionRecoveryPolicy>
@ -85,90 +85,90 @@
</policyMap> </policyMap>
</destinationPolicy> </destinationPolicy>
<!-- <!--
The managementContext is used to configure how ActiveMQ is exposed in The managementContext is used to configure how ActiveMQ is exposed in
JMX. By default, ActiveMQ uses the MBean server that is started by JMX. By default, ActiveMQ uses the MBean server that is started by
the JVM. For more information, see: the JVM. For more information, see:
http://activemq.apache.org/jmx.html http://activemq.apache.org/jmx.html
--> -->
<managementContext> <managementContext>
<managementContext createConnector="false"/> <managementContext createConnector="false"/>
</managementContext> </managementContext>
<!-- <!--
The network connectors are used to create a network of brokers. For The network connectors are used to create a network of brokers. For
more information, see: more information, see:
http://activemq.apache.org/networks-of-brokers.html http://activemq.apache.org/networks-of-brokers.html
--> -->
<!-- networkConnectors--> <!-- networkConnectors-->
<!-- <!--
This connector automatically discovers the other brokers using This connector automatically discovers the other brokers using
IP multicast. Such discovery is possible only because the IP multicast. Such discovery is possible only because the
openwire transport connector is advertised via the default IP openwire transport connector is advertised via the default IP
multicast group. For more information on multicast, see: multicast group. For more information on multicast, see:
http://activemq.apache.org/multicast-transport-reference.html http://activemq.apache.org/multicast-transport-reference.html
<networkConnector name="default-nc" uri="multicast://default"/> <networkConnector name="default-nc" uri="multicast://default"/>
--> -->
<!-- <!--
Example of a static configuration. For more information, see: Example of a static configuration. For more information, see:
http://activemq.apache.org/static-transport-reference.html http://activemq.apache.org/static-transport-reference.html
<networkConnector name="host1 and host2" uri="static://(tcp://host1:61616,tcp://host2:61616)"/> <networkConnector name="host1 and host2" uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
--> -->
<!-- /networkConnectors--> <!-- /networkConnectors-->
<!-- <!--
Configure message persistence for the broker. The default persistence Configure message persistence for the broker. The default persistence
mechanism is the AMQ store (identified by the amqPersistenceAdapter). mechanism is the AMQ store (identified by the amqPersistenceAdapter).
For more information, see: For more information, see:
http://activemq.apache.org/persistence.html http://activemq.apache.org/persistence.html
--> -->
<persistenceAdapter> <persistenceAdapter>
<kahaDB directory="${activemq.base}/data/dynamic-broker1/kahadb" indexWriteBatchSize="1000" enableIndexWriteAsync="true" enableJournalDiskSyncs="false" /> <kahaDB directory="${activemq.data}/dynamic-broker1/kahadb" indexWriteBatchSize="1000" enableIndexWriteAsync="true" enableJournalDiskSyncs="false" />
</persistenceAdapter> </persistenceAdapter>
<!-- <!--
Configure the following if you wish to use journaled JDBC for message Configure the following if you wish to use journaled JDBC for message
persistence. persistence.
<persistenceFactory> <persistenceFactory>
<journalPersistenceAdapterFactory dataDirectory="${activemq.base}/data" dataSource="#postgres-ds"/> <journalPersistenceAdapterFactory dataDirectory="${activemq.data}" dataSource="#postgres-ds"/>
</persistenceFactory> </persistenceFactory>
--> -->
<!-- <!--
Configure the following if you wish to use non-journaled JDBC for message Configure the following if you wish to use non-journaled JDBC for message
persistence. persistence.
<persistenceAdapter> <persistenceAdapter>
<jdbcPersistenceAdapter dataSource="#postgres-ds"/> <jdbcPersistenceAdapter dataSource="#postgres-ds"/>
</persistenceAdapter> </persistenceAdapter>
--> -->
<!-- <!--
The sslContext can be used to configure broker-specific SSL properties. The sslContext can be used to configure broker-specific SSL properties.
For more information, see: For more information, see:
http://activemq.apache.org/how-do-i-use-ssl.html http://activemq.apache.org/how-do-i-use-ssl.html
--> -->
<sslContext> <sslContext>
<sslContext keyStore="file:${activemq.base}/conf/broker.ks" <sslContext keyStore="file:${activemq.conf}/broker.ks"
keyStorePassword="password" trustStore="file:${activemq.base}/conf/broker.ts" keyStorePassword="password" trustStore="file:${activemq.conf}/broker.ts"
trustStorePassword="password"/> trustStorePassword="password"/>
</sslContext> </sslContext>
<!-- <!--
The systemUsage controls the maximum amount of space the broker will The systemUsage controls the maximum amount of space the broker will
use before slowing down producers. For more information, see: use before slowing down producers. For more information, see:
http://activemq.apache.org/producer-flow-control.html http://activemq.apache.org/producer-flow-control.html
--> -->
<systemUsage> <systemUsage>
@ -186,14 +186,14 @@
</systemUsage> </systemUsage>
<!-- <!--
The transport connectors expose ActiveMQ over a given protocol to The transport connectors expose ActiveMQ over a given protocol to
clients and other brokers. For more information, see: clients and other brokers. For more information, see:
http://activemq.apache.org/configuring-transports.html http://activemq.apache.org/configuring-transports.html
--> -->
<transportConnectors> <transportConnectors>
<!-- Create a TCP transport that is advertised on via an IP multicast <!-- Create a TCP transport that is advertised on via an IP multicast
group named default. --> group named default. -->
<transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default"/> <transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default"/>
<!-- Create a SSL transport. Make sure to configure the SSL options <!-- Create a SSL transport. Make sure to configure the SSL options
@ -210,34 +210,34 @@
<!-- <!--
Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker
For more details see For more details see
http://activemq.apache.org/enterprise-integration-patterns.html http://activemq.apache.org/enterprise-integration-patterns.html
--> -->
<import resource="camel.xml"/> <import resource="camel.xml"/>
<!-- <!--
An embedded servlet engine for serving up the Admin console and other demos. An embedded servlet engine for serving up the Admin console and other demos.
For more information, see: For more information, see:
http://activemq.apache.org/web-console.html http://activemq.apache.org/web-console.html
--> -->
<import resource="jetty.xml"/> <import resource="jetty.xml"/>
<!-- <!--
Uncomment to create a command agent to respond to message based admin Uncomment to create a command agent to respond to message based admin
commands on the ActiveMQ.Agent topic. For more information, see: commands on the ActiveMQ.Agent topic. For more information, see:
http://activemq.apache.org/command-agent.html http://activemq.apache.org/command-agent.html
<commandAgent xmlns="http://activemq.apache.org/schema/core" brokerUrl="vm://localhost"/> <commandAgent xmlns="http://activemq.apache.org/schema/core" brokerUrl="vm://localhost"/>
--> -->
<!-- <!--
This xbean configuration file supports all the standard Spring XML This xbean configuration file supports all the standard Spring XML
configuration options such as the following bean definitions. configuration options such as the following bean definitions.
--> -->
<!-- Postgres DataSource Sample Setup --> <!-- Postgres DataSource Sample Setup -->

View File

@ -5,29 +5,29 @@
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<!-- <!--
Create a dynamic network of brokers Create a dynamic network of brokers
For more information, see: For more information, see:
http://activemq.apache.org/networks-of-brokers.html http://activemq.apache.org/networks-of-brokers.html
To run this example network of ActiveMQ brokers run To run this example network of ActiveMQ brokers run
$ bin/activemq console xbean:conf/activemq-dynamic-network-broker1.xml $ bin/activemq console xbean:conf/activemq-dynamic-network-broker1.xml
and and
$ bin/activemq console xbean:conf/activemq-dynamic-network-broker2.xml $ bin/activemq console xbean:conf/activemq-dynamic-network-broker2.xml
in separate consoles in separate consoles
--> -->
<beans <beans
@ -39,7 +39,7 @@
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="dynamic-broker1" dataDirectory="${activemq.base}/data"> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="dynamic-broker1" dataDirectory="${activemq.data}">
<!-- Destination specific policies using destination names or wildcards --> <!-- Destination specific policies using destination names or wildcards -->
<destinationPolicy> <destinationPolicy>
@ -64,21 +64,21 @@
<!-- <!--
Configure network connector to use multicast protocol Configure network connector to use multicast protocol
For more information, see For more information, see
http://activemq.apache.org/multicast-transport-reference.html http://activemq.apache.org/multicast-transport-reference.html
--> -->
<networkConnectors> <networkConnectors>
<networkConnector uri="multicast://default" <networkConnector uri="multicast://default"
dynamicOnly="true" dynamicOnly="true"
networkTTL="3" networkTTL="3"
prefetchSize="1" prefetchSize="1"
decreaseNetworkConsumerPriority="true" /> decreaseNetworkConsumerPriority="true" />
</networkConnectors> </networkConnectors>
<persistenceAdapter> <persistenceAdapter>
<kahaDB directory="${activemq.base}/data/dynamic-broker1/kahadb"/> <kahaDB directory="${activemq.data}/dynamic-broker1/kahadb"/>
</persistenceAdapter> </persistenceAdapter>
<!-- The maximum amount of space the broker will use before slowing down producers --> <!-- The maximum amount of space the broker will use before slowing down producers -->
<systemUsage> <systemUsage>
<systemUsage> <systemUsage>
@ -94,14 +94,14 @@
</systemUsage> </systemUsage>
</systemUsage> </systemUsage>
<!-- <!--
The transport connectors ActiveMQ will listen to The transport connectors ActiveMQ will listen to
Configure discovery URI to use multicast protocol Configure discovery URI to use multicast protocol
--> -->
<transportConnectors> <transportConnectors>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616" discoveryUri="multicast://default" /> <transportConnector name="openwire" uri="tcp://0.0.0.0:61616" discoveryUri="multicast://default" />
</transportConnectors> </transportConnectors>
</broker> </broker>

View File

@ -5,29 +5,29 @@
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<!-- <!--
Create a dynamic network of brokers Create a dynamic network of brokers
For more information, see: For more information, see:
http://activemq.apache.org/networks-of-brokers.html http://activemq.apache.org/networks-of-brokers.html
To run this example network of ActiveMQ brokers run To run this example network of ActiveMQ brokers run
$ bin/activemq console xbean:conf/activemq-dynamic-network-broker1.xml $ bin/activemq console xbean:conf/activemq-dynamic-network-broker1.xml
and and
$ bin/activemq console xbean:conf/activemq-dynamic-network-broker2.xml $ bin/activemq console xbean:conf/activemq-dynamic-network-broker2.xml
in separate consoles in separate consoles
--> -->
<beans <beans
@ -35,12 +35,12 @@
xmlns:amq="http://activemq.apache.org/schema/core" xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"> http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="dynamic-broker2" dataDirectory="${activemq.base}/data"> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="dynamic-broker2" dataDirectory="${activemq.data}">
<!-- Destination specific policies using destination names or wildcards --> <!-- Destination specific policies using destination names or wildcards -->
<destinationPolicy> <destinationPolicy>
@ -65,38 +65,38 @@
<!-- <!--
Configure network connector to use multicast protocol Configure network connector to use multicast protocol
For more information, see For more information, see
http://activemq.apache.org/multicast-transport-reference.html http://activemq.apache.org/multicast-transport-reference.html
--> -->
<networkConnectors> <networkConnectors>
<networkConnector uri="multicast://default" <networkConnector uri="multicast://default"
dynamicOnly="true" dynamicOnly="true"
networkTTL="3" networkTTL="3"
prefetchSize="1" prefetchSize="1"
decreaseNetworkConsumerPriority="true" /> decreaseNetworkConsumerPriority="true" />
</networkConnectors> </networkConnectors>
<persistenceAdapter>
<kahaDB directory="${activemq.base}/data/dynamic-broker2/kahadb" />
</persistenceAdapter>
<!-- The maximum amount of space the broker will use before slowing down producers -->
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage limit="20 mb"/>
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb" name="foo"/>
</storeUsage>
<tempUsage>
<tempUsage limit="100 mb"/>
</tempUsage>
</systemUsage>
</systemUsage>
<!--
<persistenceAdapter>
<kahaDB directory="${activemq.data}/dynamic-broker2/kahadb" />
</persistenceAdapter>
<!-- The maximum amount of space the broker will use before slowing down producers -->
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage limit="20 mb"/>
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb" name="foo"/>
</storeUsage>
<tempUsage>
<tempUsage limit="100 mb"/>
</tempUsage>
</systemUsage>
</systemUsage>
<!--
The transport connectors ActiveMQ will listen to The transport connectors ActiveMQ will listen to
Configure discovery URI to use multicast protocol Configure discovery URI to use multicast protocol
--> -->

View File

@ -5,27 +5,27 @@
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<!-- <!--
Use JDBC for message persistence Use JDBC for message persistence
For more information, see: For more information, see:
http://activemq.apache.org/persistence.html http://activemq.apache.org/persistence.html
You need to add Derby database to your classpath in order to make this example work. You need to add Derby database to your classpath in order to make this example work.
Download it from http://db.apache.org/derby/ and put it in the ${ACTIVEMQ_HOME}/lib/optional/ folder Download it from http://db.apache.org/derby/ and put it in the ${ACTIVEMQ_HOME}/lib/optional/ folder
Optionally you can configure any other RDBM as shown below Optionally you can configure any other RDBM as shown below
To run ActiveMQ with this configuration add xbean:conf/activemq-jdbc.xml to your command To run ActiveMQ with this configuration add xbean:conf/activemq-jdbc.xml to your command
e.g. $ bin/activemq console xbean:conf/activemq-jdbc.xml e.g. $ bin/activemq console xbean:conf/activemq-jdbc.xml
--> -->
<beans <beans
@ -37,26 +37,26 @@
<!-- Allows us to use system properties as variables in this configuration file --> <!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations"> <property name="locations">
<value>file:${activemq.base}/conf/credentials.properties</value> <value>file:${activemq.conf}/credentials.properties</value>
</property> </property>
</bean> </bean>
<broker useJmx="false" brokerName="jdbcBroker" xmlns="http://activemq.apache.org/schema/core"> <broker useJmx="false" brokerName="jdbcBroker" xmlns="http://activemq.apache.org/schema/core">
<persistenceAdapter> <persistenceAdapter>
<jdbcPersistenceAdapter dataDirectory="${activemq.base}/data" dataSource="#derby-ds"/> <jdbcPersistenceAdapter dataDirectory="${activemq.data}" dataSource="#derby-ds"/>
</persistenceAdapter> </persistenceAdapter>
<transportConnectors> <transportConnectors>
<transportConnector name="default" uri="tcp://0.0.0.0:61616"/> <transportConnector name="default" uri="tcp://0.0.0.0:61616"/>
</transportConnectors> </transportConnectors>
</broker> </broker>
<!-- Embedded Derby DataSource Sample Setup --> <!-- Embedded Derby DataSource Sample Setup -->
<bean id="derby-ds" class="org.apache.derby.jdbc.EmbeddedDataSource"> <bean id="derby-ds" class="org.apache.derby.jdbc.EmbeddedDataSource">
<property name="databaseName" value="derbydb"/> <property name="databaseName" value="derbydb"/>
<property name="createDatabase" value="create"/> <property name="createDatabase" value="create"/>
</bean> </bean>
<!-- Postgres DataSource Sample Setup --> <!-- Postgres DataSource Sample Setup -->
<!-- <!--
<bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource"> <bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource">

View File

@ -5,27 +5,27 @@
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<!-- <!--
Tune ActiveMQ broker so it can handle large number of queues (tens of thousands) Tune ActiveMQ broker so it can handle large number of queues (tens of thousands)
For more information, see: For more information, see:
http://activemq.apache.org/how-do-i-configure-10s-of-1000s-of-queues-in-a-single-broker-.html http://activemq.apache.org/how-do-i-configure-10s-of-1000s-of-queues-in-a-single-broker-.html
Be sure to make necessary changes in your startup script, to Be sure to make necessary changes in your startup script, to
1. Give broker enough memory 1. Give broker enough memory
2. Disable dedicated task runner 2. Disable dedicated task runner
e.g. ACTIVEMQ_OPTS="-Xmx1024M -Dorg.apache.activemq.UseDedicatedTaskRunner=false" e.g. ACTIVEMQ_OPTS="-Xmx1024M -Dorg.apache.activemq.UseDedicatedTaskRunner=false"
To run ActiveMQ with this configuration add xbean:conf/activemq-scalability.xml to your command To run ActiveMQ with this configuration add xbean:conf/activemq-scalability.xml to your command
e.g. $ bin/activemq console xbean:conf/activemq-scalability.xml e.g. $ bin/activemq console xbean:conf/activemq-scalability.xml
--> -->
@ -39,12 +39,12 @@
<!-- Allows us to use system properties as variables in this configuration file --> <!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data" useJmx="false" advisorySupport="false"> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" useJmx="false" advisorySupport="false">
<!-- <!--
Turn on optimizedDispatch Turn on optimizedDispatch
For more information, see: For more information, see:
http://activemq.apache.org/per-destination-policies.html http://activemq.apache.org/per-destination-policies.html
--> -->
<destinationPolicy> <destinationPolicy>
<policyMap> <policyMap>
@ -54,17 +54,17 @@
</policyMap> </policyMap>
</destinationPolicy> </destinationPolicy>
<!-- <!--
Use KahaDB for persistence Use KahaDB for persistence
For more information, see: For more information, see:
http://activemq.apache.org/kahadb.html http://activemq.apache.org/kahadb.html
--> -->
<persistenceAdapter> <persistenceAdapter>
<kahaDB directory="${activemq.base}/data/kahadb" enableIndexWriteAsync="true"/> <kahaDB directory="${activemq.data}/kahadb" enableIndexWriteAsync="true"/>
</persistenceAdapter> </persistenceAdapter>
<!-- <!--
Use NIO transport Use NIO transport
For more information, see: For more information, see:
http://activemq.apache.org/configuring-transports.html#ConfiguringTransports-TheNIOTransport http://activemq.apache.org/configuring-transports.html#ConfiguringTransports-TheNIOTransport
--> -->
@ -73,5 +73,5 @@
</transportConnectors> </transportConnectors>
</broker> </broker>
</beans> </beans>

View File

@ -50,7 +50,7 @@
<bean id="propertyConfigurer" class="org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer"> <bean id="propertyConfigurer" class="org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer">
<constructor-arg ref="configurationEncryptor" /> <constructor-arg ref="configurationEncryptor" />
<property name="location" value="file:${activemq.base}/conf/credentials-enc.properties"/> <property name="location" value="file:${activemq.conf}/credentials-enc.properties"/>
</bean> </bean>
<!-- <!--

View File

@ -5,9 +5,9 @@
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -24,9 +24,9 @@
<!-- Allows us to use system properties as variables in this configuration file --> <!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" /> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
<!-- <!--
The <broker> element is used to configure the ActiveMQ broker. The <broker> element is used to configure the ActiveMQ broker.
advisories incurr a hit with every add connection|destination|producer|consumer advisories incurr a hit with every add connection|destination|producer|consumer
- client side: providerUrl = tcp://localhost:61616?jms.watchTopicAdvisories=false - client side: providerUrl = tcp://localhost:61616?jms.watchTopicAdvisories=false
statistics have a small impact on concurrency so disable statistics have a small impact on concurrency so disable
@ -35,19 +35,19 @@
ACTIVEMQ_OPTS_MEMORY="-Xmx11g -Xms6g -Dorg.apache.activemq.UseDedicatedTaskRunner=false -Djava.util.logging.config.file=logging.properties -XX:+UseLargePages" ACTIVEMQ_OPTS_MEMORY="-Xmx11g -Xms6g -Dorg.apache.activemq.UseDedicatedTaskRunner=false -Djava.util.logging.config.file=logging.properties -XX:+UseLargePages"
--> -->
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost"
dataDirectory="${activemq.base}/data" deleteAllMessagesOnStartup="true" dataDirectory="${activemq.data}" deleteAllMessagesOnStartup="true"
advisorySupport="false" advisorySupport="false"
enableStatistics="false" enableStatistics="false"
schedulerSupport="false" schedulerSupport="false"
useJmx="false"> useJmx="false">
<destinationPolicy> <destinationPolicy>
<policyMap> <policyMap>
<policyEntries> <policyEntries>
<!-- <!--
producerFlowControll thread unnecessary with no memory limits producerFlowControll thread unnecessary with no memory limits
with no failover, no need to suppress duplicates so audit can be disabled with no failover, no need to suppress duplicates so audit can be disabled
message expiry thread unnecessary as normal dispatch will handle expiry message expiry thread unnecessary as normal dispatch will handle expiry
--> -->
<policyEntry topic=">" producerFlowControl="false" enableAudit="false" expireMessagesPeriod="0"> <policyEntry topic=">" producerFlowControl="false" enableAudit="false" expireMessagesPeriod="0">
@ -61,19 +61,19 @@
<!-- keep all references in memory --> <!-- keep all references in memory -->
<vmQueueCursor/> <vmQueueCursor/>
</pendingQueuePolicy> </pendingQueuePolicy>
</policyEntry> </policyEntry>
</policyEntries> </policyEntries>
</policyMap> </policyMap>
</destinationPolicy> </destinationPolicy>
<!-- <!--
The managementContext is used to configure how ActiveMQ is exposed in The managementContext is used to configure how ActiveMQ is exposed in
JMX. By default, ActiveMQ uses the MBean server that is started by JMX. By default, ActiveMQ uses the MBean server that is started by
the JVM. For more information, see: the JVM. For more information, see:
http://activemq.apache.org/jmx.html http://activemq.apache.org/jmx.html
--> -->
<managementContext> <managementContext>
<managementContext createConnector="false"/> <managementContext createConnector="false"/>
@ -84,15 +84,15 @@
<!-- write in max 62k chunks to max disk io bandwith --> <!-- write in max 62k chunks to max disk io bandwith -->
<!-- use small number of data files (seldom switch) --> <!-- use small number of data files (seldom switch) -->
<!-- keep index off the disk (in cache) --> <!-- keep index off the disk (in cache) -->
<kahaDB directory="${activemq.base}/data/kahadb" <kahaDB directory="${activemq.data}/kahadb"
cleanupInterval="300000" checkpointInterval="50000" cleanupInterval="300000" checkpointInterval="50000"
journalMaxWriteBatchSize="62k" journalMaxWriteBatchSize="62k"
journalMaxFileLength="1g" journalMaxFileLength="1g"
indexCacheSize="100000" indexWriteBatchSize="100000" indexCacheSize="100000" indexWriteBatchSize="100000"
/> />
</persistenceAdapter> </persistenceAdapter>
<!-- ensure there is loads or memory for destinations --> <!-- ensure there is loads or memory for destinations -->
<systemUsage> <systemUsage>
<systemUsage> <systemUsage>
@ -101,18 +101,18 @@
</memoryUsage> </memoryUsage>
</systemUsage> </systemUsage>
</systemUsage> </systemUsage>
<!-- <!--
The transport connectors expose ActiveMQ over a given protocol to The transport connectors expose ActiveMQ over a given protocol to
clients and other brokers. For more information, see: clients and other brokers. For more information, see:
http://activemq.apache.org/configuring-transports.html http://activemq.apache.org/configuring-transports.html
--> -->
<transportConnectors> <transportConnectors>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/> <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
</transportConnectors> </transportConnectors>
</broker> </broker>
</beans> </beans>

View File

@ -5,29 +5,29 @@
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<!-- <!--
Create a static network of brokers Create a static network of brokers
For more information, see: For more information, see:
http://activemq.apache.org/networks-of-brokers.html http://activemq.apache.org/networks-of-brokers.html
To run this example network of ActiveMQ brokers run To run this example network of ActiveMQ brokers run
$ bin/activemq console xbean:conf/activemq-static-network-broker1.xml $ bin/activemq console xbean:conf/activemq-static-network-broker1.xml
and and
$ bin/activemq console xbean:conf/activemq-static-network-broker2.xml $ bin/activemq console xbean:conf/activemq-static-network-broker2.xml
in separate consoles in separate consoles
--> -->
<beans <beans
@ -35,13 +35,13 @@
xmlns:amq="http://activemq.apache.org/schema/core" xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"> http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
<!-- Allows us to use system properties as variables in this configuration file --> <!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="static-broker1" dataDirectory="${activemq.base}/data"> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="static-broker1" dataDirectory="${activemq.data}">
<!-- Destination specific policies using destination names or wildcards --> <!-- Destination specific policies using destination names or wildcards -->
<destinationPolicy> <destinationPolicy>
@ -63,18 +63,18 @@
<managementContext createConnector="true"/> <managementContext createConnector="true"/>
</managementContext> </managementContext>
<!-- <!--
The store and forward broker networks ActiveMQ will listen to. The store and forward broker networks ActiveMQ will listen to.
We'll leave it empty as duplex network will be configured by another broker We'll leave it empty as duplex network will be configured by another broker
Take a look at activemq-static_network-broker2.xml for example Take a look at activemq-static_network-broker2.xml for example
--> -->
<networkConnectors> <networkConnectors>
</networkConnectors> </networkConnectors>
<persistenceAdapter> <persistenceAdapter>
<kahaDB directory="${activemq.base}/data/static-broker1/kahadb" /> <kahaDB directory="${activemq.data}/static-broker1/kahadb" />
</persistenceAdapter> </persistenceAdapter>
<!-- The maximum amount of space the broker will use before slowing down producers --> <!-- The maximum amount of space the broker will use before slowing down producers -->
<systemUsage> <systemUsage>
<systemUsage> <systemUsage>
@ -94,7 +94,7 @@
<transportConnectors> <transportConnectors>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/> <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
</transportConnectors> </transportConnectors>
</broker> </broker>
</beans> </beans>

View File

@ -5,29 +5,29 @@
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<!-- <!--
Create a static network of brokers Create a static network of brokers
For more information, see: For more information, see:
http://activemq.apache.org/networks-of-brokers.html http://activemq.apache.org/networks-of-brokers.html
To run this example network of ActiveMQ brokers run To run this example network of ActiveMQ brokers run
$ bin/activemq console xbean:conf/activemq-static-network-broker1.xml $ bin/activemq console xbean:conf/activemq-static-network-broker1.xml
and and
$ bin/activemq console xbean:conf/activemq-static-network-broker2.xml $ bin/activemq console xbean:conf/activemq-static-network-broker2.xml
in separate consoles in separate consoles
--> -->
<beans <beans
@ -35,13 +35,13 @@
xmlns:amq="http://activemq.apache.org/schema/core" xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"> http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
<!-- Allows us to use system properties as variables in this configuration file --> <!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="static-broker2" dataDirectory="${activemq.base}/data"> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="static-broker2" dataDirectory="${activemq.data}">
<!-- Destination specific policies using destination names or wildcards --> <!-- Destination specific policies using destination names or wildcards -->
<destinationPolicy> <destinationPolicy>
@ -63,18 +63,18 @@
<managementContext createConnector="true" connectorPort="1100"/> <managementContext createConnector="true" connectorPort="1100"/>
</managementContext> </managementContext>
<!-- <!--
The store and forward broker networks ActiveMQ will listen to The store and forward broker networks ActiveMQ will listen to
Create a duplex connector to the first broker Create a duplex connector to the first broker
--> -->
<networkConnectors> <networkConnectors>
<networkConnector uri="static:(tcp://localhost:61616)" duplex="true"/> <networkConnector uri="static:(tcp://localhost:61616)" duplex="true"/>
</networkConnectors> </networkConnectors>
<persistenceAdapter> <persistenceAdapter>
<kahaDB directory="${activemq.base}/data/static-broker2/kahadb" /> <kahaDB directory="${activemq.data}/static-broker2/kahadb" />
</persistenceAdapter> </persistenceAdapter>
<!-- The maximum amount of space the broker will use before slowing down producers --> <!-- The maximum amount of space the broker will use before slowing down producers -->
<systemUsage> <systemUsage>
<systemUsage> <systemUsage>
@ -94,7 +94,7 @@
<transportConnectors> <transportConnectors>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61618"/> <transportConnector name="openwire" uri="tcp://0.0.0.0:61618"/>
</transportConnectors> </transportConnectors>
</broker> </broker>
</beans> </beans>

View File

@ -5,25 +5,25 @@
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<!-- <!--
Use Stomp protocol Use Stomp protocol
For better behavior under heavy usage, be sure to: For better behavior under heavy usage, be sure to:
1. Give broker enough memory 1. Give broker enough memory
2. Disable dedicated task runner 2. Disable dedicated task runner
e.g. ACTIVEMQ_OPTS="-Xmx1024M -Dorg.apache.activemq.UseDedicatedTaskRunner=false" e.g. ACTIVEMQ_OPTS="-Xmx1024M -Dorg.apache.activemq.UseDedicatedTaskRunner=false"
To run ActiveMQ with this configuration add xbean:conf/activemq-stomp.xml to your command To run ActiveMQ with this configuration add xbean:conf/activemq-stomp.xml to your command
e.g. $ bin/activemq console xbean:conf/activemq-stomp.xml e.g. $ bin/activemq console xbean:conf/activemq-stomp.xml
--> -->
@ -37,26 +37,26 @@
<!-- Allows us to use system properties as variables in this configuration file --> <!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations"> <property name="locations">
<value>file:${activemq.base}/conf/credentials.properties</value> <value>file:${activemq.conf}/credentials.properties</value>
</property> </property>
</bean> </bean>
<!-- <!--
The <broker> element is used to configure the ActiveMQ broker. The <broker> element is used to configure the ActiveMQ broker.
--> -->
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data"> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
<!-- <!--
For better performances use VM cursor and small memory limit. For better performances use VM cursor and small memory limit.
For more information, see: For more information, see:
http://activemq.apache.org/message-cursors.html http://activemq.apache.org/message-cursors.html
Also, if your producer is "hanging", it's probably due to producer flow control. Also, if your producer is "hanging", it's probably due to producer flow control.
For more information, see: For more information, see:
http://activemq.apache.org/producer-flow-control.html http://activemq.apache.org/producer-flow-control.html
--> -->
<destinationPolicy> <destinationPolicy>
<policyMap> <policyMap>
<policyEntries> <policyEntries>
@ -68,9 +68,9 @@
<policyEntry queue=">" producerFlowControl="false"> <policyEntry queue=">" producerFlowControl="false">
<!-- Use VM cursor for better latency <!-- Use VM cursor for better latency
For more information, see: For more information, see:
http://activemq.apache.org/message-cursors.html http://activemq.apache.org/message-cursors.html
<pendingQueuePolicy> <pendingQueuePolicy>
<vmQueueCursor/> <vmQueueCursor/>
</pendingQueuePolicy> </pendingQueuePolicy>
@ -79,55 +79,55 @@
</policyEntries> </policyEntries>
</policyMap> </policyMap>
</destinationPolicy> </destinationPolicy>
<!-- <!--
The managementContext is used to configure how ActiveMQ is exposed in The managementContext is used to configure how ActiveMQ is exposed in
JMX. By default, ActiveMQ uses the MBean server that is started by JMX. By default, ActiveMQ uses the MBean server that is started by
the JVM. For more information, see: the JVM. For more information, see:
http://activemq.apache.org/jmx.html http://activemq.apache.org/jmx.html
--> -->
<managementContext> <managementContext>
<managementContext createConnector="false"/> <managementContext createConnector="false"/>
</managementContext> </managementContext>
<!-- <!--
Configure message persistence for the broker. The default persistence Configure message persistence for the broker. The default persistence
mechanism is the KahaDB store (identified by the kahaDB tag). mechanism is the KahaDB store (identified by the kahaDB tag).
For more information, see: For more information, see:
http://activemq.apache.org/persistence.html http://activemq.apache.org/persistence.html
--> -->
<persistenceAdapter> <persistenceAdapter>
<kahaDB directory="${activemq.base}/data/kahadb"/> <kahaDB directory="${activemq.data}/kahadb"/>
</persistenceAdapter> </persistenceAdapter>
<!-- <!--
The transport connectors expose ActiveMQ over a given protocol to The transport connectors expose ActiveMQ over a given protocol to
clients and other brokers. For more information, see: clients and other brokers. For more information, see:
http://activemq.apache.org/configuring-transports.html http://activemq.apache.org/configuring-transports.html
--> -->
<transportConnectors> <transportConnectors>
<transportConnector name="stomp" uri="stomp://0.0.0.0:61612?transport.closeAsync=false"/> <transportConnector name="stomp" uri="stomp://0.0.0.0:61612?transport.closeAsync=false"/>
<transportConnector name="stomp+nio" uri="stomp+nio://0.0.0.0:61613?transport.closeAsync=false"/> <transportConnector name="stomp+nio" uri="stomp+nio://0.0.0.0:61613?transport.closeAsync=false"/>
</transportConnectors> </transportConnectors>
</broker> </broker>
<!-- <!--
Uncomment to enable Camel Uncomment to enable Camel
Take a look at activemq-camel.xml for more details Take a look at activemq-camel.xml for more details
<import resource="camel.xml"/> <import resource="camel.xml"/>
--> -->
<!-- <!--
Enable web consoles, REST and Ajax APIs and demos Enable web consoles, REST and Ajax APIs and demos
Take a look at activemq-jetty.xml for more details Take a look at activemq-jetty.xml for more details
--> -->
<import resource="jetty.xml"/> <import resource="jetty.xml"/>
</beans> </beans>

View File

@ -5,22 +5,22 @@
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<!-- <!--
Tune ActiveMQ broker for high throughput of messages Tune ActiveMQ broker for high throughput of messages
Be sure to make necessary changes in your producer and consumer, since there you can make the most notable difference Be sure to make necessary changes in your producer and consumer, since there you can make the most notable difference
For more information, see: For more information, see:
http://activemq.apache.org/performance-tuning.html http://activemq.apache.org/performance-tuning.html
To run ActiveMQ with this configuration add xbean:conf/activemq-throughput.xml to your command To run ActiveMQ with this configuration add xbean:conf/activemq-throughput.xml to your command
e.g. $ bin/activemq console xbean:conf/activemq-throughput.xml e.g. $ bin/activemq console xbean:conf/activemq-throughput.xml
--> -->
@ -34,11 +34,11 @@
<!-- Allows us to use system properties as variables in this configuration file --> <!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data" useJmx="false" advisorySupport="false"> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" useJmx="false" advisorySupport="false">
<!-- <!--
Use VM cursor Use VM cursor
For more information, see: For more information, see:
http://activemq.apache.org/message-cursors.html http://activemq.apache.org/message-cursors.html
--> -->
<destinationPolicy> <destinationPolicy>
@ -56,21 +56,21 @@
</policyEntry> </policyEntry>
</policyEntries> </policyEntries>
</policyMap> </policyMap>
</destinationPolicy> </destinationPolicy>
<!-- <!--
Use KahaDB for persistence Use KahaDB for persistence
Tune it a bit so we minimize IO operations Tune it a bit so we minimize IO operations
For more information, see: For more information, see:
http://activemq.apache.org/kahadb.html http://activemq.apache.org/kahadb.html
--> -->
<persistenceAdapter> <persistenceAdapter>
<kahaDB directory="${activemq.base}/data/kahadb" enableJournalDiskSyncs="false" indexWriteBatchSize="10000" indexCacheSize="1000"/> <kahaDB directory="${activemq.data}/kahadb" enableJournalDiskSyncs="false" indexWriteBatchSize="10000" indexCacheSize="1000"/>
</persistenceAdapter> </persistenceAdapter>
<!-- <!--
Use TCP transport Use TCP transport
For more information, see: For more information, see:
http://activemq.apache.org/configuring-transports.html http://activemq.apache.org/configuring-transports.html
--> -->
<transportConnectors> <transportConnectors>
@ -78,5 +78,5 @@
</transportConnectors> </transportConnectors>
</broker> </broker>
</beans> </beans>

View File

@ -5,9 +5,9 @@
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -21,13 +21,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker brokerName="broker" persistent="false" useJmx="false" xmlns="http://activemq.apache.org/schema/core"> <broker brokerName="broker" persistent="false" useJmx="false" xmlns="http://activemq.apache.org/schema/core">
<persistenceAdapter> <persistenceAdapter>
<kahaPersistenceAdapter directory = "${activemq.home}/activemq-data"/> <kahaPersistenceAdapter directory = "${activemq.data}/kaha"/>
</persistenceAdapter> </persistenceAdapter>
<transportConnectors> <transportConnectors>