This closes #287
This commit is contained in:
commit
1bb2d0837d
|
@ -1,4 +1,4 @@
|
|||
<!-- The web server is only bound to loalhost by default -->
|
||||
<web bind="http://localhost:${http.port}" path="web">
|
||||
<app url="jolokia" war="jolokia-war-1.3.1.war"/>
|
||||
<app url="jolokia" war="jolokia-war-1.3.2.war"/>
|
||||
</web>
|
||||
|
|
|
@ -66,13 +66,11 @@ NAME
|
|||
artemis create - creates a new broker instance
|
||||
|
||||
SYNOPSIS
|
||||
artemis create [--allow-anonymous]
|
||||
[--cluster-password <clusterPassword>] [--cluster-user <clusterUser>]
|
||||
artemis create [--allow-anonymous] [--cluster-password <clusterPassword>] [--cluster-user <clusterUser>]
|
||||
[--clustered] [--data <data>] [--encoding <encoding>] [--force]
|
||||
[--home <home>] [--host <host>] [--java-options <javaOptions>]
|
||||
[--password <password>] [--port-offset <portOffset>] [--replicated]
|
||||
[--role <role>] [--shared-store] [--silent] [--user <user>] [--]
|
||||
<directory>
|
||||
[--role <role>] [--shared-store] [--silent] [--user <user>] [--] <directory>
|
||||
...
|
||||
</PRE>
|
||||
|
||||
|
@ -107,33 +105,6 @@ The broker comes shipped with an in depth user manual and a bunch of examples to
|
|||
|
||||
The examples are shipped inside the distribution folder under "examples"</br></br>
|
||||
|
||||
<h2 id="release-notes---apache-activemq-artemis-1.1.0">Release Notes - Apache ActiveMQ Artemis 1.1.0</h2>
|
||||
<p>A complete list of JIRAs for the 1.1.0 release can be found at the <a href="https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12332642&styleName=Html&projectId=12315920&Create=Create&atl_token=A5KQ-2QAV-T4JA-FDED%7C708a588702fdb54724fe817fd07ee4c5610de292%7Clin">Apache ActiveMQ Artemis project JIRA</a></p>
|
||||
<p>Overall Apache ActiveMQ Artemis 1.1.0 has several improvements and it's a nice polish on top of Apache ActiveMQ Artemis 1.0.0, things like better examples, better OpenWire support and the first release of MQTT.</p>
|
||||
<p>We would like to highlight the following accomplishments on this release:</p>
|
||||
<ul>
|
||||
<li><p>[<a href="https://issues.apache.org/jira/browse/ARTEMIS-154">ARTEMIS-154</a>] This is our first implementation of the MQTT support.</p></li>
|
||||
<li><p><a href="https://issues.apache.org/jira/browse/ARTEMIS-178">ARTEMIS-178</a> The examples are now using the CLI to create and start servers reflecting real cases used in production. The documentation about the examples has been updated. Please refer to the documentation for more information about this.</p></li>
|
||||
<li><p>[<a href="https://issues.apache.org/jira/browse/ARTEMIS-116">ARTEMIS-116</a>] The CLI has been improved. There are new tools to compact the journal and we did a lot of polish around the CLI.</p></li>
|
||||
<li><p><strong>Improvements on OpenWire</strong> We fixed several issues around OpenWire</p></li>
|
||||
</ul>
|
||||
<h3 id="where-we-are-still-improving.">Where we are still improving.</h3>
|
||||
<p>1.1.0 has improved a lot, and these are the areas we are still working on:</p>
|
||||
<ul>
|
||||
<li><p>This is the first release with MQTT. We would like to hear from you if you have any issues around MQTT as we are continuously improving the MQTT support</p></li>
|
||||
<li>Short list of what need to be implemented on OpenWire for future releases:
|
||||
<ul>
|
||||
<li>Reconnection</li>
|
||||
<li>Better Flow Control on producers</li>
|
||||
<li>Compressed messages</li>
|
||||
<li>Optimized ACKs</li>
|
||||
<li>Streamlet support</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Release Notes - ActiveMQ Artemis 1.0.0</h2>
|
||||
|
||||
The ActiveMQ Artemis 1.0.0 release notes can be found in the <a href="https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12315920&version=12328953">Apache ActiveMQ Artemis project JIRA</a>.
|
||||
Release Notes for all version can be found at <a href="https://issues.apache.org/jira/browse/ARTEMIS/?selectedTab=com.atlassian.jira.jira-projects-plugin:versions-panel">here</a></a>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -82,15 +82,15 @@ public interface ActiveMQServerLogger extends BasicLogger {
|
|||
void serverStarting(String type, Configuration configuration);
|
||||
|
||||
@LogMessage(level = Logger.Level.INFO)
|
||||
@Message(id = 221001, value = "Apache ActiveMQ Artemis Message Broker version {0} [nodeID={1}] {2}", format = Message.Format.MESSAGE_FORMAT)
|
||||
void serverStarted(String fullVersion, SimpleString nodeId, String identity);
|
||||
@Message(id = 221001, value = "Apache ActiveMQ Artemis Message Broker version {0} [{1}, nodeID={2}] {3}", format = Message.Format.MESSAGE_FORMAT)
|
||||
void serverStarted(String fullVersion, String name, SimpleString nodeId, String identity);
|
||||
|
||||
@LogMessage(level = Logger.Level.INFO)
|
||||
@Message(id = 221002, value = "Apache ActiveMQ Artemis Message Broker version {0} [{1}] stopped", format = Message.Format.MESSAGE_FORMAT)
|
||||
void serverStopped(String version, SimpleString nodeId);
|
||||
@Message(id = 221002, value = "Apache ActiveMQ Artemis Message Broker version {0} [{1}] stopped, uptime {2}", format = Message.Format.MESSAGE_FORMAT)
|
||||
void serverStopped(String version, SimpleString nodeId, String uptime);
|
||||
|
||||
@LogMessage(level = Logger.Level.INFO)
|
||||
@Message(id = 221003, value = "trying to deploy queue {0}", format = Message.Format.MESSAGE_FORMAT)
|
||||
@Message(id = 221003, value = "Trying to deploy queue {0}", format = Message.Format.MESSAGE_FORMAT)
|
||||
void deployQueue(SimpleString queueName);
|
||||
|
||||
@LogMessage(level = Logger.Level.INFO)
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.lang.management.ManagementFactory;
|
|||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
|
@ -133,6 +134,7 @@ import org.apache.activemq.artemis.utils.ExecutorFactory;
|
|||
import org.apache.activemq.artemis.utils.OrderedExecutorFactory;
|
||||
import org.apache.activemq.artemis.utils.ReusableLatch;
|
||||
import org.apache.activemq.artemis.utils.SecurityFormatter;
|
||||
import org.apache.activemq.artemis.utils.TimeUtils;
|
||||
import org.apache.activemq.artemis.utils.VersionLoader;
|
||||
|
||||
/**
|
||||
|
@ -266,6 +268,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
|
||||
private ServiceRegistry serviceRegistry;
|
||||
|
||||
private Date startDate;
|
||||
// Constructors
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
|
@ -369,6 +372,8 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
return;
|
||||
}
|
||||
|
||||
startDate = new Date();
|
||||
|
||||
state = SERVER_STATE.STARTING;
|
||||
|
||||
if (haPolicy == null) {
|
||||
|
@ -410,7 +415,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
backupActivationThread.start();
|
||||
}
|
||||
else {
|
||||
ActiveMQServerLogger.LOGGER.serverStarted(getVersion().getFullVersion(), nodeManager.getNodeId(), identity != null ? identity : "");
|
||||
ActiveMQServerLogger.LOGGER.serverStarted(getVersion().getFullVersion(), configuration.getName(), nodeManager.getNodeId(), identity != null ? identity : "" );
|
||||
}
|
||||
// start connector service
|
||||
connectorsService = new ConnectorsService(configuration, storageManager, scheduledPool, postOffice, serviceRegistry);
|
||||
|
@ -771,10 +776,10 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
scaledDownNodeIDs.clear();
|
||||
|
||||
if (identity != null) {
|
||||
ActiveMQServerLogger.LOGGER.serverStopped("identity=" + identity + ",version=" + getVersion().getFullVersion(), tempNodeID);
|
||||
ActiveMQServerLogger.LOGGER.serverStopped("identity=" + identity + ",version=" + getVersion().getFullVersion(), tempNodeID, getUptime());
|
||||
}
|
||||
else {
|
||||
ActiveMQServerLogger.LOGGER.serverStopped(getVersion().getFullVersion(), tempNodeID);
|
||||
ActiveMQServerLogger.LOGGER.serverStopped(getVersion().getFullVersion(), tempNodeID, getUptime());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2075,4 +2080,22 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getUptime() {
|
||||
long delta = getUptimeMillis();
|
||||
|
||||
if (delta == 0) {
|
||||
return "not started";
|
||||
}
|
||||
|
||||
return TimeUtils.printDuration(delta);
|
||||
}
|
||||
|
||||
public long getUptimeMillis() {
|
||||
if (startDate == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return new Date().getTime() - startDate.getTime();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* 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 obtain a copy of the License at
|
||||
* <p>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p>
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.activemq.artemis.utils;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Time utils.
|
||||
*
|
||||
* @version
|
||||
*/
|
||||
public final class TimeUtils {
|
||||
|
||||
private TimeUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the duration in a human readable format as X days Y hours Z minutes etc.
|
||||
*
|
||||
* @param uptime the uptime in millis
|
||||
* @return the time used for displaying on screen or in logs
|
||||
*/
|
||||
public static String printDuration(double uptime) {
|
||||
// Code taken from Karaf
|
||||
// https://svn.apache.org/repos/asf/karaf/trunk/shell/commands/src/main/java/org/apache/karaf/shell/commands/impl/InfoAction.java
|
||||
|
||||
NumberFormat fmtI = new DecimalFormat("###,###", new DecimalFormatSymbols(Locale.ENGLISH));
|
||||
NumberFormat fmtD = new DecimalFormat("###,##0.000", new DecimalFormatSymbols(Locale.ENGLISH));
|
||||
|
||||
uptime /= 1000;
|
||||
if (uptime < 60) {
|
||||
return fmtD.format(uptime) + " seconds";
|
||||
}
|
||||
uptime /= 60;
|
||||
if (uptime < 60) {
|
||||
long minutes = (long) uptime;
|
||||
String s = fmtI.format(minutes) + (minutes > 1 ? " minutes" : " minute");
|
||||
return s;
|
||||
}
|
||||
uptime /= 60;
|
||||
if (uptime < 24) {
|
||||
long hours = (long) uptime;
|
||||
long minutes = (long) ((uptime - hours) * 60);
|
||||
String s = fmtI.format(hours) + (hours > 1 ? " hours" : " hour");
|
||||
if (minutes != 0) {
|
||||
s += " " + fmtI.format(minutes) + (minutes > 1 ? " minutes" : " minute");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
uptime /= 24;
|
||||
long days = (long) uptime;
|
||||
long hours = (long) ((uptime - days) * 24);
|
||||
String s = fmtI.format(days) + (days > 1 ? " days" : " day");
|
||||
if (hours != 0) {
|
||||
s += " " + fmtI.format(hours) + (hours > 1 ? " hours" : " hour");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
}
|
|
@ -32,6 +32,12 @@
|
|||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jboss.logging</groupId>
|
||||
<artifactId>jboss-logging-processor</artifactId>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>artemis-dto</artifactId>
|
||||
|
@ -64,7 +70,13 @@
|
|||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!--
|
||||
JBoss Logging
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.jboss.logging</groupId>
|
||||
<artifactId>jboss-logging</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* 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 obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.activemq.artemis;
|
||||
|
||||
import org.jboss.logging.BasicLogger;
|
||||
import org.jboss.logging.Logger;
|
||||
import org.jboss.logging.annotations.LogMessage;
|
||||
import org.jboss.logging.annotations.Message;
|
||||
import org.jboss.logging.annotations.MessageLogger;
|
||||
|
||||
/**
|
||||
* Logger Code 24
|
||||
*
|
||||
* each message id must be 6 digits long starting with 18, the 3rd digit donates the level so
|
||||
*
|
||||
* INF0 1
|
||||
* WARN 2
|
||||
* DEBUG 3
|
||||
* ERROR 4
|
||||
* TRACE 5
|
||||
* FATAL 6
|
||||
*
|
||||
* so an INFO message would be 181000 to 181999
|
||||
*/
|
||||
@MessageLogger(projectCode = "AMQ")
|
||||
public interface ActiveMQWebLogger extends BasicLogger {
|
||||
|
||||
/**
|
||||
* The aerogear logger.
|
||||
*/
|
||||
ActiveMQWebLogger LOGGER = Logger.getMessageLogger(ActiveMQWebLogger.class, ActiveMQWebLogger.class.getPackage().getName());
|
||||
|
||||
@LogMessage(level = Logger.Level.INFO)
|
||||
@Message(id = 241001, value = "HTTP Server started at {0}", format = Message.Format.MESSAGE_FORMAT)
|
||||
void webserverStarted(String bind);
|
||||
|
||||
@LogMessage(level = Logger.Level.INFO)
|
||||
@Message(id = 241002, value = "Artemis Jolokia REST API available at {0}", format = Message.Format.MESSAGE_FORMAT)
|
||||
void jolokiaAvailable(String bind);
|
||||
|
||||
}
|
|
@ -18,6 +18,7 @@ package org.apache.activemq.artemis.component;
|
|||
|
||||
import java.net.URI;
|
||||
|
||||
import org.apache.activemq.artemis.ActiveMQWebLogger;
|
||||
import org.apache.activemq.artemis.components.ExternalComponent;
|
||||
import org.apache.activemq.artemis.dto.AppDTO;
|
||||
import org.apache.activemq.artemis.dto.ComponentDTO;
|
||||
|
@ -35,12 +36,14 @@ public class WebServerComponent implements ExternalComponent {
|
|||
private Server server;
|
||||
private HandlerList handlers;
|
||||
private WebServerDTO webServerConfig;
|
||||
private URI uri;
|
||||
private String jolokiaUrl;
|
||||
|
||||
@Override
|
||||
public void configure(ComponentDTO config, String artemisInstance, String artemisHome) throws Exception {
|
||||
webServerConfig = (WebServerDTO) config;
|
||||
String path = webServerConfig.path.startsWith("/") ? webServerConfig.path : "/" + webServerConfig.path;
|
||||
URI uri = new URI(webServerConfig.bind);
|
||||
uri = new URI(webServerConfig.bind);
|
||||
server = new Server();
|
||||
ServerConnector connector = new ServerConnector(server);
|
||||
connector.setPort(uri.getPort());
|
||||
|
@ -53,6 +56,9 @@ public class WebServerComponent implements ExternalComponent {
|
|||
if (webServerConfig.apps != null) {
|
||||
for (AppDTO app : webServerConfig.apps) {
|
||||
deployWar(app.url, app.war, artemisHome, path);
|
||||
if (app.war.startsWith("jolokia")) {
|
||||
jolokiaUrl = webServerConfig.bind + "/" + app.url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,8 +83,10 @@ public class WebServerComponent implements ExternalComponent {
|
|||
@Override
|
||||
public void start() throws Exception {
|
||||
server.start();
|
||||
|
||||
System.out.println("HTTP Server started at " + webServerConfig.bind);
|
||||
ActiveMQWebLogger.LOGGER.webserverStarted(webServerConfig.bind);
|
||||
if (jolokiaUrl != null) {
|
||||
ActiveMQWebLogger.LOGGER.jolokiaAvailable(jolokiaUrl);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
20
pom.xml
20
pom.xml
|
@ -776,6 +776,26 @@
|
|||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
<version>1.4.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>enforce-maven</id>
|
||||
<goals>
|
||||
<goal>enforce</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<rules>
|
||||
<requireMavenVersion>
|
||||
<version>3.1</version>
|
||||
</requireMavenVersion>
|
||||
</rules>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>javacc-maven-plugin</artifactId>
|
||||
|
|
Loading…
Reference in New Issue