This closes #574
This commit is contained in:
commit
696206b1de
|
@ -19,6 +19,7 @@ package org.apache.activemq.artemis.cli.commands;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import io.airlift.airline.Command;
|
import io.airlift.airline.Command;
|
||||||
|
import org.apache.activemq.artemis.dto.BrokerDTO;
|
||||||
|
|
||||||
@Command(name = "stop", description = "stops the broker instance")
|
@Command(name = "stop", description = "stops the broker instance")
|
||||||
public class Stop extends Configurable {
|
public class Stop extends Configurable {
|
||||||
|
@ -26,14 +27,9 @@ public class Stop extends Configurable {
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ActionContext context) throws Exception {
|
public Object execute(ActionContext context) throws Exception {
|
||||||
super.execute(context);
|
super.execute(context);
|
||||||
|
BrokerDTO broker = getBrokerDTO();
|
||||||
|
|
||||||
String value = getConfiguration();
|
File file = broker.server.getConfigurationFile().getParentFile();
|
||||||
|
|
||||||
if (value != null && value.startsWith("xml:")) {
|
|
||||||
value = value.substring("xml:".length());
|
|
||||||
}
|
|
||||||
|
|
||||||
File file = new File(value).getParentFile();
|
|
||||||
|
|
||||||
File stopFile = new File(file, "STOP_ME");
|
File stopFile = new File(file, "STOP_ME");
|
||||||
|
|
||||||
|
|
|
@ -96,9 +96,9 @@ start() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$ARTEMIS_USER" -o `id -un` = "$ARTEMIS_USER" ] ; then
|
if [ -z "$ARTEMIS_USER" -o `id -un` = "$ARTEMIS_USER" ] ; then
|
||||||
nohup ${ARTEMIS_INSTANCE}/bin/artemis run > /dev/null 2> /dev/null &
|
nohup "${ARTEMIS_INSTANCE}/bin/artemis" run > /dev/null 2> /dev/null &
|
||||||
else
|
else
|
||||||
sudo -n -u ${ARTEMIS_USER} nohup ${ARTEMIS_INSTANCE}/bin/artemis run > /dev/null 2> /dev/null &
|
sudo -n -u ${ARTEMIS_USER} nohup "${ARTEMIS_INSTANCE}/bin/artemis" run > /dev/null 2> /dev/null &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $! > "${PID_FILE}"
|
echo $! > "${PID_FILE}"
|
||||||
|
|
|
@ -22,10 +22,14 @@
|
||||||
<name>ActiveMQ Artemis: ${artemis.instance.name} @ ${host}</name>
|
<name>ActiveMQ Artemis: ${artemis.instance.name} @ ${host}</name>
|
||||||
<description>Apache ActiveMQ Artemis is a reliable messaging broker</description>
|
<description>Apache ActiveMQ Artemis is a reliable messaging broker</description>
|
||||||
|
|
||||||
|
<env name="ARTEMIS_HOME" value="${artemis.home}"/>
|
||||||
|
<env name="ARTEMIS_INSTANCE" value="${artemis.instance}"/>
|
||||||
|
|
||||||
<logpath>${artemis.instance}\log</logpath>
|
<logpath>${artemis.instance}\log</logpath>
|
||||||
<logmode>roll</logmode>
|
<logmode>roll</logmode>
|
||||||
|
|
||||||
<executable>java</executable>
|
<executable>java</executable>
|
||||||
|
<argument>-Xbootclasspath/a:%ARTEMIS_HOME%\lib\${logmanager}</argument>
|
||||||
<argument>-XX:+UseParallelGC</argument>
|
<argument>-XX:+UseParallelGC</argument>
|
||||||
<argument>-XX:+AggressiveOpts</argument>
|
<argument>-XX:+AggressiveOpts</argument>
|
||||||
<argument>-XX:+UseFastAccessorMethods</argument>
|
<argument>-XX:+UseFastAccessorMethods</argument>
|
||||||
|
@ -40,13 +44,12 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<argument>-classpath</argument>
|
<argument>-classpath</argument>
|
||||||
<argument>"${artemis.home}\lib\artemis-boot.jar"</argument>
|
<argument>%ARTEMIS_HOME%\lib\artemis-boot.jar</argument>
|
||||||
<argument>-Dartemis.home="${artemis.home}"</argument>
|
<argument>-Dartemis.home=%ARTEMIS_HOME%</argument>
|
||||||
<argument>-Dartemis.instance="${artemis.instance}"</argument>
|
<argument>-Dartemis.instance=%ARTEMIS_INSTANCE%</argument>
|
||||||
<argument>-Ddata.dir="${artemis.instance}\data"</argument>
|
|
||||||
<argument>-Djava.util.logging.manager=org.jboss.logmanager.LogManager</argument>
|
<argument>-Djava.util.logging.manager=org.jboss.logmanager.LogManager</argument>
|
||||||
<argument>-Dlogging.configuration="file:${artemis.instance}\etc\logging.properties"</argument>
|
<argument>-Dlogging.configuration=file:%ARTEMIS_INSTANCE%\etc\logging.properties</argument>
|
||||||
<argument>-Djava.security.auth.login.config="${artemis.instance}\etc\login.config"</argument>
|
<argument>-Djava.security.auth.login.config=%ARTEMIS_INSTANCE%\etc\login.config</argument>
|
||||||
|
|
||||||
|
|
||||||
<!-- Debug args: Uncomment to enable debug
|
<!-- Debug args: Uncomment to enable debug
|
||||||
|
|
|
@ -21,11 +21,11 @@ setlocal
|
||||||
if NOT "%ARTEMIS_INSTANCE%"=="" goto CHECK_ARTEMIS_INSTANCE
|
if NOT "%ARTEMIS_INSTANCE%"=="" goto CHECK_ARTEMIS_INSTANCE
|
||||||
PUSHD .
|
PUSHD .
|
||||||
CD %~dp0..
|
CD %~dp0..
|
||||||
set ARTEMIS_INSTANCE=%CD%
|
set ARTEMIS_INSTANCE="%CD%"
|
||||||
POPD
|
POPD
|
||||||
|
|
||||||
:CHECK_ARTEMIS_INSTANCE
|
:CHECK_ARTEMIS_INSTANCE
|
||||||
if exist "%ARTEMIS_INSTANCE%\bin\artemis.cmd" goto CHECK_JAVA
|
if exist %ARTEMIS_INSTANCE%\bin\artemis.cmd goto CHECK_JAVA
|
||||||
|
|
||||||
:NO_HOME
|
:NO_HOME
|
||||||
echo ARTEMIS_INSTANCE environment variable is set incorrectly. Please set ARTEMIS_INSTANCE.
|
echo ARTEMIS_INSTANCE environment variable is set incorrectly. Please set ARTEMIS_INSTANCE.
|
||||||
|
@ -53,17 +53,17 @@ set ARTEMIS_DATA_DIR=%ARTEMIS_INSTANCE%\data
|
||||||
set ARTEMIS_LOG_MANAGER=org.jboss.logmanager.LogManager
|
set ARTEMIS_LOG_MANAGER=org.jboss.logmanager.LogManager
|
||||||
|
|
||||||
rem "Load Profile Config"
|
rem "Load Profile Config"
|
||||||
call "%ARTEMIS_INSTANCE%\etc\artemis.profile.cmd" %*
|
call %ARTEMIS_INSTANCE%\etc\artemis.profile.cmd %*
|
||||||
|
|
||||||
rem "Create full JVM Args"
|
rem "Create full JVM Args"
|
||||||
set JVM_ARGS=%JAVA_ARGS%
|
set JVM_ARGS=%JAVA_ARGS%
|
||||||
if not "%ARTEMIS_CLUSTER_PROPS%"=="" set JVM_ARGS=%JVM_ARGS% %ARTEMIS_CLUSTER_PROPS%
|
if not "%ARTEMIS_CLUSTER_PROPS%"=="" set JVM_ARGS=%JVM_ARGS% %ARTEMIS_CLUSTER_PROPS%
|
||||||
set JVM_ARGS=%JVM_ARGS% -classpath "%ARTEMIS_HOME%\lib\artemis-boot.jar"
|
set JVM_ARGS=%JVM_ARGS% -classpath %ARTEMIS_HOME%\lib\artemis-boot.jar
|
||||||
set JVM_ARGS=%JVM_ARGS% -Dartemis.home="%ARTEMIS_HOME%"
|
set JVM_ARGS=%JVM_ARGS% -Dartemis.home=%ARTEMIS_HOME%
|
||||||
set JVM_ARGS=%JVM_ARGS% -Dartemis.instance="%ARTEMIS_INSTANCE%"
|
set JVM_ARGS=%JVM_ARGS% -Dartemis.instance=%ARTEMIS_INSTANCE%
|
||||||
set JVM_ARGS=%JVM_ARGS% -Ddata.dir="%ARTEMIS_DATA_DIR%"
|
set JVM_ARGS=%JVM_ARGS% -Ddata.dir=%ARTEMIS_DATA_DIR%
|
||||||
set JVM_ARGS=%JVM_ARGS% -Djava.util.logging.manager="%ARTEMIS_LOG_MANAGER%"
|
set JVM_ARGS=%JVM_ARGS% -Djava.util.logging.manager=%ARTEMIS_LOG_MANAGER%
|
||||||
set JVM_ARGS=%JVM_ARGS% -Dlogging.configuration="%ARTEMIS_LOGGING_CONF%"
|
set JVM_ARGS=%JVM_ARGS% -Dlogging.configuration=%ARTEMIS_LOGGING_CONF%
|
||||||
if not "%DEBUG_ARGS%"=="" set JVM_ARGS=%JVM_ARGS% %DEBUG_ARGS%
|
if not "%DEBUG_ARGS%"=="" set JVM_ARGS=%JVM_ARGS% %DEBUG_ARGS%
|
||||||
|
|
||||||
"%_JAVACMD%" %JVM_ARGS% org.apache.activemq.artemis.boot.Artemis %*
|
"%_JAVACMD%" %JVM_ARGS% org.apache.activemq.artemis.boot.Artemis %*
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
@echo off
|
||||||
rem Licensed to the Apache Software Foundation (ASF) under one
|
rem Licensed to the Apache Software Foundation (ASF) under one
|
||||||
rem or more contributor license agreements. See the NOTICE file
|
rem or more contributor license agreements. See the NOTICE file
|
||||||
rem distributed with this work for additional information
|
rem distributed with this work for additional information
|
||||||
|
@ -15,8 +16,8 @@ rem KIND, either express or implied. See the License for the
|
||||||
rem specific language governing permissions and limitations
|
rem specific language governing permissions and limitations
|
||||||
rem under the License.
|
rem under the License.
|
||||||
|
|
||||||
set ARTEMIS_HOME=${artemis.home}
|
set ARTEMIS_HOME="${artemis.home}"
|
||||||
set ARTEMIS_INSTANCE=${artemis.instance}
|
set ARTEMIS_INSTANCE="${artemis.instance}"
|
||||||
|
|
||||||
rem Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml
|
rem Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml
|
||||||
rem set ARTEMIS_CLUSTER_PROPS=-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446
|
rem set ARTEMIS_CLUSTER_PROPS=-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446
|
||||||
|
|
|
@ -31,8 +31,6 @@ under the License.
|
||||||
|
|
||||||
<h1>Getting Started</h1>
|
<h1>Getting Started</h1>
|
||||||
|
|
||||||
<b>Note (Windows users):</b> The broker currently does not support spaces in path names. For this reason the broker should be placed in a directory with no spaces in it's absolute path.<br><br>
|
|
||||||
|
|
||||||
<b>Note (Windows users):</b> Examples below use the shell script `artemis` for use with linux, Windows users should use the `artemis.cmd` script with the same parameters.<br><br>
|
<b>Note (Windows users):</b> Examples below use the shell script `artemis` for use with linux, Windows users should use the `artemis.cmd` script with the same parameters.<br><br>
|
||||||
|
|
||||||
<h2>Creating a broker</h2>
|
<h2>Creating a broker</h2>
|
||||||
|
|
|
@ -21,11 +21,11 @@ setlocal
|
||||||
if NOT "%ARTEMIS_HOME%"=="" goto CHECK_ARTEMIS_HOME
|
if NOT "%ARTEMIS_HOME%"=="" goto CHECK_ARTEMIS_HOME
|
||||||
PUSHD .
|
PUSHD .
|
||||||
CD %~dp0..
|
CD %~dp0..
|
||||||
set ARTEMIS_HOME=%CD%
|
set ARTEMIS_HOME="%CD%"
|
||||||
POPD
|
POPD
|
||||||
|
|
||||||
:CHECK_ARTEMIS_HOME
|
:CHECK_ARTEMIS_HOME
|
||||||
if exist "%ARTEMIS_HOME%\bin\artemis.cmd" goto CHECK_JAVA
|
if exist %ARTEMIS_HOME%\bin\artemis.cmd goto CHECK_JAVA
|
||||||
|
|
||||||
:NO_HOME
|
:NO_HOME
|
||||||
echo ARTEMIS_HOME environment variable is set incorrectly. Please set ARTEMIS_HOME.
|
echo ARTEMIS_HOME environment variable is set incorrectly. Please set ARTEMIS_HOME.
|
||||||
|
@ -53,8 +53,8 @@ set JAVA_ARGS=-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods
|
||||||
rem "Create full JVM Args"
|
rem "Create full JVM Args"
|
||||||
set JVM_ARGS=%JAVA_ARGS%
|
set JVM_ARGS=%JAVA_ARGS%
|
||||||
if not "%ARTEMIS_CLUSTER_PROPS%"=="" set JVM_ARGS=%JVM_ARGS% %ARTEMIS_CLUSTER_PROPS%
|
if not "%ARTEMIS_CLUSTER_PROPS%"=="" set JVM_ARGS=%JVM_ARGS% %ARTEMIS_CLUSTER_PROPS%
|
||||||
set JVM_ARGS=%JVM_ARGS% -classpath "%ARTEMIS_HOME%\lib\artemis-boot.jar"
|
set JVM_ARGS=%JVM_ARGS% -classpath %ARTEMIS_HOME%\lib\artemis-boot.jar
|
||||||
set JVM_ARGS=%JVM_ARGS% -Dartemis.home="%ARTEMIS_HOME%"
|
set JVM_ARGS=%JVM_ARGS% -Dartemis.home=%ARTEMIS_HOME%
|
||||||
if not "%DEBUG_ARGS%"=="" set JVM_ARGS=%JVM_ARGS% %DEBUG_ARGS%
|
if not "%DEBUG_ARGS%"=="" set JVM_ARGS=%JVM_ARGS% %DEBUG_ARGS%
|
||||||
|
|
||||||
"%_JAVACMD%" %JVM_ARGS% org.apache.activemq.artemis.boot.Artemis %*
|
"%_JAVACMD%" %JVM_ARGS% org.apache.activemq.artemis.boot.Artemis %*
|
||||||
|
|
|
@ -592,8 +592,11 @@ final class PageSubscriptionImpl implements PageSubscription {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.tracef("isComplete(%d)::calling is %s", (Object)page, this, consumedPages.isEmpty());
|
boolean isDone = info != null && info.isDone();
|
||||||
return info != null && info.isDone();
|
if (logger.isTraceEnabled()) {
|
||||||
|
logger.tracef("isComplete(%d):: found info=%s, isDone=%s", (Object) page, info, isDone);
|
||||||
|
}
|
||||||
|
return isDone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue