This closes #261 initial access broker config
This commit is contained in:
commit
9b7aa517d3
|
@ -0,0 +1,102 @@
|
||||||
|
/**
|
||||||
|
* 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.cli.commands;
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public abstract class ActionAbstract implements Action
|
||||||
|
{
|
||||||
|
|
||||||
|
protected ActionContext context;
|
||||||
|
|
||||||
|
private Scanner scanner;
|
||||||
|
|
||||||
|
private boolean noInput = false;
|
||||||
|
|
||||||
|
protected void disableInputs()
|
||||||
|
{
|
||||||
|
noInput = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String input(String propertyName, String prompt, String silentDefault)
|
||||||
|
{
|
||||||
|
if (noInput)
|
||||||
|
{
|
||||||
|
return silentDefault;
|
||||||
|
}
|
||||||
|
String inputStr;
|
||||||
|
boolean valid = false;
|
||||||
|
System.out.println();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
context.out.println(propertyName + ": is mandatory with this configuration:");
|
||||||
|
context.out.println(prompt);
|
||||||
|
inputStr = scanner.nextLine();
|
||||||
|
if (inputStr.trim().equals(""))
|
||||||
|
{
|
||||||
|
System.out.println("Invalid Entry!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
valid = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (!valid);
|
||||||
|
|
||||||
|
return inputStr.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String inputPassword(String propertyName, String prompt, String silentDefault)
|
||||||
|
{
|
||||||
|
if (noInput)
|
||||||
|
{
|
||||||
|
return silentDefault;
|
||||||
|
}
|
||||||
|
String inputStr;
|
||||||
|
boolean valid = false;
|
||||||
|
System.out.println();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
context.out.println(propertyName + ": is mandatory with this configuration:");
|
||||||
|
context.out.println(prompt);
|
||||||
|
inputStr = new String(System.console().readPassword());
|
||||||
|
|
||||||
|
if (inputStr.trim().equals(""))
|
||||||
|
{
|
||||||
|
System.out.println("Invalid Entry!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
valid = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (!valid);
|
||||||
|
|
||||||
|
return inputStr.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object execute(ActionContext context) throws Exception
|
||||||
|
{
|
||||||
|
this.context = context;
|
||||||
|
|
||||||
|
scanner = new Scanner(context.in);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -36,7 +36,7 @@ import org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration;
|
||||||
/**
|
/**
|
||||||
* Abstract class where we can replace the configuration in various places *
|
* Abstract class where we can replace the configuration in various places *
|
||||||
*/
|
*/
|
||||||
public abstract class Configurable
|
public abstract class Configurable extends ActionAbstract
|
||||||
{
|
{
|
||||||
@Arguments(description = "Broker Configuration URI, default 'xml:${ARTEMIS_INSTANCE}/etc/bootstrap.xml'")
|
@Arguments(description = "Broker Configuration URI, default 'xml:${ARTEMIS_INSTANCE}/etc/bootstrap.xml'")
|
||||||
String configuration;
|
String configuration;
|
||||||
|
|
|
@ -30,13 +30,13 @@ import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Scanner;
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import io.airlift.airline.Arguments;
|
import io.airlift.airline.Arguments;
|
||||||
import io.airlift.airline.Command;
|
import io.airlift.airline.Command;
|
||||||
import io.airlift.airline.Option;
|
import io.airlift.airline.Option;
|
||||||
|
import org.apache.activemq.artemis.core.asyncio.impl.AsynchronousFileImpl;
|
||||||
|
|
||||||
import static java.nio.file.attribute.PosixFilePermission.GROUP_EXECUTE;
|
import static java.nio.file.attribute.PosixFilePermission.GROUP_EXECUTE;
|
||||||
import static java.nio.file.attribute.PosixFilePermission.GROUP_READ;
|
import static java.nio.file.attribute.PosixFilePermission.GROUP_READ;
|
||||||
|
@ -51,7 +51,7 @@ import static java.nio.file.attribute.PosixFilePermission.OWNER_WRITE;
|
||||||
* CLI action that creates a broker instance directory.
|
* CLI action that creates a broker instance directory.
|
||||||
*/
|
*/
|
||||||
@Command(name = "create", description = "creates a new broker instance")
|
@Command(name = "create", description = "creates a new broker instance")
|
||||||
public class Create implements Action
|
public class Create extends ActionAbstract
|
||||||
{
|
{
|
||||||
private static final Integer DEFAULT_PORT = 61616;
|
private static final Integer DEFAULT_PORT = 61616;
|
||||||
|
|
||||||
|
@ -75,11 +75,16 @@ public class Create implements Action
|
||||||
public static final String ETC_BROKER_XML = "etc/broker.xml";
|
public static final String ETC_BROKER_XML = "etc/broker.xml";
|
||||||
public static final String ETC_ARTEMIS_ROLES_PROPERTIES = "etc/artemis-roles.properties";
|
public static final String ETC_ARTEMIS_ROLES_PROPERTIES = "etc/artemis-roles.properties";
|
||||||
public static final String ETC_ARTEMIS_USERS_PROPERTIES = "etc/artemis-users.properties";
|
public static final String ETC_ARTEMIS_USERS_PROPERTIES = "etc/artemis-users.properties";
|
||||||
|
public static final String ETC_REPLICATED_SETTINGS_TXT = "etc/replicated-settings.txt";
|
||||||
|
public static final String ETC_SHARED_STORE_SETTINGS_TXT = "etc/shared-store-settings.txt";
|
||||||
|
public static final String ETC_CLUSTER_SECURITY_SETTINGS_TXT = "etc/cluster-security-settings.txt";
|
||||||
|
public static final String ETC_CLUSTER_SETTINGS_TXT = "etc/cluster-settings.txt";
|
||||||
|
public static final String ETC_CONNECTOR_SETTINGS_TXT = "etc/connector-settings.txt";
|
||||||
|
|
||||||
@Arguments(description = "The instance directory to hold the broker's configuration and data", required = true)
|
@Arguments(description = "The instance directory to hold the broker's configuration and data", required = true)
|
||||||
File directory;
|
File directory;
|
||||||
|
|
||||||
@Option(name = "--host", description = "The host name of the broker")
|
@Option(name = "--host", description = "The host name of the broker (Default: 0.0.0.0 or input if clustered)")
|
||||||
String host;
|
String host;
|
||||||
|
|
||||||
@Option(name = "--port-offset", description = "Off sets the default ports")
|
@Option(name = "--port-offset", description = "Off sets the default ports")
|
||||||
|
@ -91,6 +96,9 @@ public class Create implements Action
|
||||||
@Option(name = "--home", description = "Directory where ActiveMQ Artemis is installed")
|
@Option(name = "--home", description = "Directory where ActiveMQ Artemis is installed")
|
||||||
File home;
|
File home;
|
||||||
|
|
||||||
|
@Option(name = "--data", description = "Directory where ActiveMQ Data is used. Path are relative to artemis.instance/bin")
|
||||||
|
String data = "../data";
|
||||||
|
|
||||||
@Option(name = "--clustered", description = "Enable clustering")
|
@Option(name = "--clustered", description = "Enable clustering")
|
||||||
boolean clustered = false;
|
boolean clustered = false;
|
||||||
|
|
||||||
|
@ -100,10 +108,10 @@ public class Create implements Action
|
||||||
@Option(name = "--shared-store", description = "Enable broker shared store")
|
@Option(name = "--shared-store", description = "Enable broker shared store")
|
||||||
boolean sharedStore = false;
|
boolean sharedStore = false;
|
||||||
|
|
||||||
@Option(name = "--cluster-user", description = "The cluster user to use for clustering")
|
@Option(name = "--cluster-user", description = "The cluster user to use for clustering. (Default: input)")
|
||||||
String clusterUser = null;
|
String clusterUser = null;
|
||||||
|
|
||||||
@Option(name = "--cluster-password", description = "The cluster password to use for clustering")
|
@Option(name = "--cluster-password", description = "The cluster password to use for clustering. (Default: input)")
|
||||||
String clusterPassword = null;
|
String clusterPassword = null;
|
||||||
|
|
||||||
@Option(name = "--encoding", description = "The encoding that text files should use")
|
@Option(name = "--encoding", description = "The encoding that text files should use")
|
||||||
|
@ -112,9 +120,20 @@ public class Create implements Action
|
||||||
@Option(name = "--java-options", description = "Extra java options to be passed to the profile")
|
@Option(name = "--java-options", description = "Extra java options to be passed to the profile")
|
||||||
String javaOptions = "";
|
String javaOptions = "";
|
||||||
|
|
||||||
ActionContext context;
|
@Option(name = "--allow-anonymous", description = "Enables anonymous configuration on security (Default: input)")
|
||||||
|
Boolean allowAnonymous = null;
|
||||||
|
|
||||||
private Scanner scanner;
|
@Option(name = "--user", description = "The username (Default: input)")
|
||||||
|
String user;
|
||||||
|
|
||||||
|
@Option(name = "--password", description = "The user's password (Default: input)")
|
||||||
|
String password;
|
||||||
|
|
||||||
|
@Option(name = "--role", description = "The name for the role created (Default: amq)")
|
||||||
|
String role;
|
||||||
|
|
||||||
|
@Option(name = "--silent-input", description = "It will disable all the inputs, and it would make a best guess for any required input")
|
||||||
|
boolean silentInput;
|
||||||
|
|
||||||
boolean IS_WINDOWS;
|
boolean IS_WINDOWS;
|
||||||
|
|
||||||
|
@ -152,6 +171,20 @@ public class Create implements Action
|
||||||
|
|
||||||
public String getHost()
|
public String getHost()
|
||||||
{
|
{
|
||||||
|
if (host == null)
|
||||||
|
{
|
||||||
|
host = "0.0.0.0";
|
||||||
|
}
|
||||||
|
return host;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHostForClustered()
|
||||||
|
{
|
||||||
|
if (getHost().equals("0.0.0.0"))
|
||||||
|
{
|
||||||
|
host = input("--host", "Host " + host + " is not valid for clustering, please provide a valid IP or hostname", "localhost");
|
||||||
|
}
|
||||||
|
|
||||||
return host;
|
return host;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,9 +257,113 @@ public class Create implements Action
|
||||||
this.encoding = encoding;
|
this.encoding = encoding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getData()
|
||||||
|
{
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(String data)
|
||||||
|
{
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClusterUser()
|
||||||
|
{
|
||||||
|
if (clusterUser == null)
|
||||||
|
{
|
||||||
|
clusterUser = input("--cluster-user", "Please provide the username:", "cluster-admin");
|
||||||
|
}
|
||||||
|
return clusterUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClusterUser(String clusterUser)
|
||||||
|
{
|
||||||
|
this.clusterUser = clusterUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClusterPassword()
|
||||||
|
{
|
||||||
|
if (clusterPassword == null)
|
||||||
|
{
|
||||||
|
clusterPassword = inputPassword("--cluster-password", "Please enter the password:", "password-admin");
|
||||||
|
}
|
||||||
|
return clusterPassword;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClusterPassword(String clusterPassword)
|
||||||
|
{
|
||||||
|
this.clusterPassword = clusterPassword;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAllowAnonymous()
|
||||||
|
{
|
||||||
|
if (allowAnonymous == null)
|
||||||
|
{
|
||||||
|
String value = input("--allow-anonymous", "Allow anonymous access? (Y/N):", "Y");
|
||||||
|
allowAnonymous = Boolean.valueOf(value.toLowerCase().equals("y"));
|
||||||
|
}
|
||||||
|
return allowAnonymous.booleanValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllowAnonymous(boolean allowGuest)
|
||||||
|
{
|
||||||
|
this.allowAnonymous = Boolean.valueOf(allowGuest);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword()
|
||||||
|
{
|
||||||
|
|
||||||
|
if (password == null)
|
||||||
|
{
|
||||||
|
this.password = inputPassword("--password", "Please provide the default password:", "admin");
|
||||||
|
}
|
||||||
|
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password)
|
||||||
|
{
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUser()
|
||||||
|
{
|
||||||
|
if (user == null)
|
||||||
|
{
|
||||||
|
user = input("--user", "Please provide the default username:", "admin");
|
||||||
|
}
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser(String user)
|
||||||
|
{
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRole()
|
||||||
|
{
|
||||||
|
if (role == null)
|
||||||
|
{
|
||||||
|
role = "amq";
|
||||||
|
}
|
||||||
|
return role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRole(String role)
|
||||||
|
{
|
||||||
|
this.role = role;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ActionContext context) throws Exception
|
public Object execute(ActionContext context) throws Exception
|
||||||
{
|
{
|
||||||
|
super.execute(context);
|
||||||
|
|
||||||
|
if (silentInput)
|
||||||
|
{
|
||||||
|
this.disableInputs();
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return run(context);
|
return run(context);
|
||||||
|
@ -248,77 +385,77 @@ public class Create implements Action
|
||||||
|
|
||||||
public Object run(ActionContext context) throws Exception
|
public Object run(ActionContext context) throws Exception
|
||||||
{
|
{
|
||||||
this.context = context;
|
|
||||||
scanner = new Scanner(System.in);
|
|
||||||
IS_WINDOWS = System.getProperty("os.name").toLowerCase().trim().startsWith("win");
|
IS_WINDOWS = System.getProperty("os.name").toLowerCase().trim().startsWith("win");
|
||||||
IS_CYGWIN = IS_WINDOWS && "cygwin".equals(System.getenv("OSTYPE"));
|
IS_CYGWIN = IS_WINDOWS && "cygwin".equals(System.getenv("OSTYPE"));
|
||||||
|
|
||||||
context.out.println(String.format("Creating ActiveMQ Artemis instance at: %s", directory.getCanonicalPath()));
|
context.out.println(String.format("Creating ActiveMQ Artemis instance at: %s", directory.getCanonicalPath()));
|
||||||
if (host == null)
|
|
||||||
{
|
|
||||||
host = "localhost";
|
|
||||||
}
|
|
||||||
|
|
||||||
HashMap<String, String> filters = new HashMap<String, String>();
|
HashMap<String, String> filters = new HashMap<String, String>();
|
||||||
String replicatedSettings = "";
|
|
||||||
if (replicated)
|
if (replicated)
|
||||||
{
|
{
|
||||||
clustered = true;
|
clustered = true;
|
||||||
replicatedSettings = readTextFile("etc/replicated-settings.txt");
|
filters.put("${replicated.settings}", readTextFile(ETC_REPLICATED_SETTINGS_TXT));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filters.put("${replicated.settings}", "");
|
||||||
}
|
}
|
||||||
filters.put("${replicated.settings}", replicatedSettings);
|
|
||||||
|
|
||||||
String sharedStoreSettings = "";
|
|
||||||
if (sharedStore)
|
if (sharedStore)
|
||||||
{
|
{
|
||||||
clustered = true;
|
clustered = true;
|
||||||
sharedStoreSettings = readTextFile("etc/shared-store-settings.txt");
|
filters.put("${shared-store.settings}", readTextFile(ETC_SHARED_STORE_SETTINGS_TXT));
|
||||||
}
|
}
|
||||||
filters.put("${shared-store.settings}", sharedStoreSettings);
|
else
|
||||||
|
|
||||||
String clusterSettings = "";
|
|
||||||
String clusterSecuritySettings = "";
|
|
||||||
String clusterUserSettings = "";
|
|
||||||
String clusterPasswordSettings = "";
|
|
||||||
if (clustered)
|
|
||||||
{
|
{
|
||||||
clusterSettings = readTextFile("etc/cluster-settings.txt");
|
filters.put("${shared-store.settings}", "");
|
||||||
|
|
||||||
if (clusterUser == null)
|
|
||||||
{
|
|
||||||
clusterUser = input("Please provide a user name for clustering (leave empty for default)");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clusterUser != null && clusterUser.length() > 0)
|
|
||||||
{
|
|
||||||
clusterUserSettings = clusterUser;
|
|
||||||
clusterSecuritySettings = readTextFile("etc/cluster-security-settings.txt");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clusterPassword == null)
|
|
||||||
{
|
|
||||||
clusterPassword = input("Please provide a password for clustering (leave empty for default)");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clusterPassword != null && clusterPassword.length() > 0)
|
|
||||||
{
|
|
||||||
clusterPasswordSettings = clusterPassword;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
filters.put("${cluster-security.settings}", clusterSecuritySettings);
|
|
||||||
filters.put("${cluster.settings}", clusterSettings);
|
|
||||||
filters.put("${cluster-user}", clusterUserSettings);
|
|
||||||
filters.put("${cluster-password}", clusterPasswordSettings);
|
|
||||||
|
|
||||||
|
if (IS_WINDOWS || !AsynchronousFileImpl.isLoaded())
|
||||||
|
{
|
||||||
|
filters.put("${journal.settings}", "NIO");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filters.put("${journal.settings}", "AIO");
|
||||||
|
}
|
||||||
|
|
||||||
filters.put("${user}", System.getProperty("user.name", ""));
|
filters.put("${user}", System.getProperty("user.name", ""));
|
||||||
filters.put("${host}", host);
|
|
||||||
filters.put("${default.port}", String.valueOf(DEFAULT_PORT + portOffset));
|
filters.put("${default.port}", String.valueOf(DEFAULT_PORT + portOffset));
|
||||||
filters.put("${amqp.port}", String.valueOf(AMQP_PORT + portOffset));
|
filters.put("${amqp.port}", String.valueOf(AMQP_PORT + portOffset));
|
||||||
filters.put("${stomp.port}", String.valueOf(STOMP_PORT + portOffset));
|
filters.put("${stomp.port}", String.valueOf(STOMP_PORT + portOffset));
|
||||||
filters.put("${hq.port}", String.valueOf(HQ_PORT + portOffset));
|
filters.put("${hq.port}", String.valueOf(HQ_PORT + portOffset));
|
||||||
filters.put("${http.port}", String.valueOf(HTTP_PORT + portOffset));
|
filters.put("${http.port}", String.valueOf(HTTP_PORT + portOffset));
|
||||||
|
filters.put("${data.dir}", data);
|
||||||
|
|
||||||
|
filters.put("${user}", getUser());
|
||||||
|
filters.put("${password}", getPassword());
|
||||||
|
filters.put("${role}", getRole());
|
||||||
|
|
||||||
|
|
||||||
|
if (clustered)
|
||||||
|
{
|
||||||
|
filters.put("${host}", getHostForClustered());
|
||||||
|
String connectorSettings = readTextFile(ETC_CONNECTOR_SETTINGS_TXT);
|
||||||
|
connectorSettings = applyFilters(connectorSettings, filters);
|
||||||
|
|
||||||
|
filters.put("${connector-config.settings}", connectorSettings);
|
||||||
|
filters.put("${cluster-security.settings}", readTextFile(ETC_CLUSTER_SECURITY_SETTINGS_TXT));
|
||||||
|
filters.put("${cluster.settings}", readTextFile(ETC_CLUSTER_SETTINGS_TXT));
|
||||||
|
filters.put("${cluster-user}", getClusterUser());
|
||||||
|
filters.put("${cluster-password}", getClusterPassword());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filters.put("${host}", getHost());
|
||||||
|
filters.put("${connector-config.settings}", "");
|
||||||
|
filters.put("${cluster-security.settings}", "");
|
||||||
|
filters.put("${cluster.settings}", "");
|
||||||
|
filters.put("${cluster-user}", "");
|
||||||
|
filters.put("${cluster-password}", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (home != null)
|
if (home != null)
|
||||||
{
|
{
|
||||||
|
@ -361,10 +498,20 @@ public class Create implements Action
|
||||||
}
|
}
|
||||||
|
|
||||||
write(ETC_LOGGING_PROPERTIES, null, false);
|
write(ETC_LOGGING_PROPERTIES, null, false);
|
||||||
|
|
||||||
|
if (isAllowAnonymous())
|
||||||
|
{
|
||||||
|
filters.put("${bootstrap.guest}", "default-user=\"" + getUser() + "\"");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filters.put("${bootstrap.guest}", "");
|
||||||
|
}
|
||||||
|
|
||||||
write(ETC_BOOTSTRAP_XML, filters, false);
|
write(ETC_BOOTSTRAP_XML, filters, false);
|
||||||
write(ETC_BROKER_XML, filters, false);
|
write(ETC_BROKER_XML, filters, false);
|
||||||
write(ETC_ARTEMIS_ROLES_PROPERTIES, null, false);
|
write(ETC_ARTEMIS_ROLES_PROPERTIES, filters, false);
|
||||||
write(ETC_ARTEMIS_USERS_PROPERTIES, null, false);
|
write(ETC_ARTEMIS_USERS_PROPERTIES, filters, false);
|
||||||
|
|
||||||
context.out.println("");
|
context.out.println("");
|
||||||
context.out.println("You can now start the broker by executing: ");
|
context.out.println("You can now start the broker by executing: ");
|
||||||
|
@ -415,12 +562,6 @@ public class Create implements Action
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String input(String prompt)
|
|
||||||
{
|
|
||||||
context.out.println(prompt);
|
|
||||||
return scanner.nextLine();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void makeExec(String path) throws IOException
|
private void makeExec(String path) throws IOException
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -447,8 +588,6 @@ public class Create implements Action
|
||||||
{
|
{
|
||||||
if (unixPaths && IS_CYGWIN)
|
if (unixPaths && IS_CYGWIN)
|
||||||
{
|
{
|
||||||
// import scala.sys.process._
|
|
||||||
// Seq("cygpath", value.getCanonicalPath).!!.trim
|
|
||||||
return value.getCanonicalPath();
|
return value.getCanonicalPath();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -469,15 +608,7 @@ public class Create implements Action
|
||||||
throw new RuntimeException(String.format("The file '%s' already exists. Use --force to overwrite.", target));
|
throw new RuntimeException(String.format("The file '%s' already exists. Use --force to overwrite.", target));
|
||||||
}
|
}
|
||||||
|
|
||||||
String content = readTextFile(source);
|
String content = applyFilters(readTextFile(source), filters);
|
||||||
|
|
||||||
if (filters != null)
|
|
||||||
{
|
|
||||||
for (Map.Entry<String, String> entry : filters.entrySet())
|
|
||||||
{
|
|
||||||
content = replace(content, entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// and then writing out in the new target encoding.. Let's also replace \n with the values
|
// and then writing out in the new target encoding.. Let's also replace \n with the values
|
||||||
// that is correct for the current platform.
|
// that is correct for the current platform.
|
||||||
|
@ -491,6 +622,19 @@ public class Create implements Action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String applyFilters(String content, HashMap<String, String> filters) throws IOException
|
||||||
|
{
|
||||||
|
|
||||||
|
if (filters != null)
|
||||||
|
{
|
||||||
|
for (Map.Entry<String, String> entry : filters.entrySet())
|
||||||
|
{
|
||||||
|
content = replace(content, entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
private String readTextFile(String source) throws IOException
|
private String readTextFile(String source) throws IOException
|
||||||
{
|
{
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
|
@ -517,56 +661,11 @@ public class Create implements Action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean canLoad(String name)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.getClass().getClassLoader().loadClass(name);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch (Throwable e)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String replace(String content, String key, String value)
|
private String replace(String content, String key, String value)
|
||||||
{
|
{
|
||||||
return content.replaceAll(Pattern.quote(key), Matcher.quoteReplacement(value));
|
return content.replaceAll(Pattern.quote(key), Matcher.quoteReplacement(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
private int system(File wd, String... command) throws IOException, InterruptedException
|
|
||||||
{
|
|
||||||
Process process = Runtime.getRuntime().exec(command, null, wd);
|
|
||||||
process.getOutputStream().close();
|
|
||||||
drain(command[0], process.getInputStream(), context.out);
|
|
||||||
drain(command[0], process.getErrorStream(), context.err);
|
|
||||||
process.waitFor();
|
|
||||||
return process.exitValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void drain(String threadName, final InputStream is, final OutputStream os)
|
|
||||||
{
|
|
||||||
new Thread(threadName)
|
|
||||||
{
|
|
||||||
{
|
|
||||||
setDaemon(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
copy(is, os);
|
|
||||||
}
|
|
||||||
catch (Throwable e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void copy(InputStream is, OutputStream os) throws IOException
|
private void copy(InputStream is, OutputStream os) throws IOException
|
||||||
{
|
{
|
||||||
byte[] buffer = new byte[1024 * 4];
|
byte[] buffer = new byte[1024 * 4];
|
||||||
|
|
|
@ -22,12 +22,14 @@ import io.airlift.airline.Command;
|
||||||
import org.apache.activemq.artemis.dto.BrokerDTO;
|
import org.apache.activemq.artemis.dto.BrokerDTO;
|
||||||
|
|
||||||
@Command(name = "kill", description = "Kills a broker instance started with --allow-kill")
|
@Command(name = "kill", description = "Kills a broker instance started with --allow-kill")
|
||||||
public class Kill extends Configurable implements Action
|
public class Kill extends Configurable
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ActionContext context) throws Exception
|
public Object execute(ActionContext context) throws Exception
|
||||||
|
|
||||||
{
|
{
|
||||||
|
super.execute(context);
|
||||||
|
|
||||||
BrokerDTO broker = getBrokerDTO();
|
BrokerDTO broker = getBrokerDTO();
|
||||||
|
|
||||||
File file = broker.server.getConfigurationFile().getParentFile();
|
File file = broker.server.getConfigurationFile().getParentFile();
|
||||||
|
|
|
@ -36,7 +36,7 @@ import org.apache.activemq.artemis.integration.bootstrap.ActiveMQBootstrapLogger
|
||||||
import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
|
import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
|
||||||
|
|
||||||
@Command(name = "run", description = "runs the broker instance")
|
@Command(name = "run", description = "runs the broker instance")
|
||||||
public class Run extends Configurable implements Action
|
public class Run extends Configurable
|
||||||
{
|
{
|
||||||
@Option(name = "--allow-kill", description = "This will allow the server to kill itself. Useful for tests (failover tests for instance)")
|
@Option(name = "--allow-kill", description = "This will allow the server to kill itself. Useful for tests (failover tests for instance)")
|
||||||
boolean allowKill;
|
boolean allowKill;
|
||||||
|
@ -48,6 +48,7 @@ public class Run extends Configurable implements Action
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ActionContext context) throws Exception
|
public Object execute(ActionContext context) throws Exception
|
||||||
{
|
{
|
||||||
|
super.execute(context);
|
||||||
|
|
||||||
Artemis.printBanner();
|
Artemis.printBanner();
|
||||||
|
|
||||||
|
|
|
@ -22,12 +22,12 @@ import io.airlift.airline.Command;
|
||||||
import org.apache.activemq.artemis.dto.BrokerDTO;
|
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 implements Action
|
public class Stop extends Configurable
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ActionContext context) throws Exception
|
public Object execute(ActionContext context) throws Exception
|
||||||
|
|
||||||
{
|
{
|
||||||
|
super.execute(context);
|
||||||
BrokerDTO broker = getBrokerDTO();
|
BrokerDTO broker = getBrokerDTO();
|
||||||
|
|
||||||
File file = broker.server.getConfigurationFile().getParentFile();
|
File file = broker.server.getConfigurationFile().getParentFile();
|
||||||
|
|
|
@ -59,6 +59,7 @@ public class DecodeJournal extends Configurable implements Action
|
||||||
|
|
||||||
public Object execute(ActionContext context) throws Exception
|
public Object execute(ActionContext context) throws Exception
|
||||||
{
|
{
|
||||||
|
super.execute(context);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (directory == null)
|
if (directory == null)
|
||||||
|
|
|
@ -53,6 +53,7 @@ public class EncodeJournal extends Configurable implements Action
|
||||||
|
|
||||||
public Object execute(ActionContext context) throws Exception
|
public Object execute(ActionContext context) throws Exception
|
||||||
{
|
{
|
||||||
|
super.execute(context);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (directory == null)
|
if (directory == null)
|
||||||
|
|
|
@ -62,6 +62,7 @@ public class PrintData extends DataAbstract implements Action
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ActionContext context) throws Exception
|
public Object execute(ActionContext context) throws Exception
|
||||||
{
|
{
|
||||||
|
super.execute(context);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
printData(getBinding(), getJournal(), getPaging());
|
printData(getBinding(), getJournal(), getPaging());
|
||||||
|
|
|
@ -126,6 +126,8 @@ public final class XmlDataExporter extends DataAbstract implements Action
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ActionContext context) throws Exception
|
public Object execute(ActionContext context) throws Exception
|
||||||
{
|
{
|
||||||
|
super.execute(context);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
process(System.out, getBinding(), getJournal(), getPaging(), getLargeMessages());
|
process(System.out, getBinding(), getJournal(), getPaging(), getLargeMessages());
|
||||||
|
|
|
@ -14,4 +14,4 @@
|
||||||
## 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.
|
||||||
## ---------------------------------------------------------------------------
|
## ---------------------------------------------------------------------------
|
||||||
guest=guest
|
${user}=${role}
|
|
@ -14,4 +14,4 @@
|
||||||
## 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.
|
||||||
## ---------------------------------------------------------------------------
|
## ---------------------------------------------------------------------------
|
||||||
guest=guest
|
${user}=${password}
|
|
@ -21,11 +21,11 @@
|
||||||
<basic-security
|
<basic-security
|
||||||
users="file:${artemis.instance}/etc/artemis-users.properties"
|
users="file:${artemis.instance}/etc/artemis-users.properties"
|
||||||
roles="file:${artemis.instance}/etc/artemis-roles.properties"
|
roles="file:${artemis.instance}/etc/artemis-roles.properties"
|
||||||
default-user="guest"
|
${bootstrap.guest}/>
|
||||||
/>
|
|
||||||
|
|
||||||
<server configuration="file:${artemis.instance}/etc/broker.xml"/>
|
<server configuration="file:${artemis.instance}/etc/broker.xml"/>
|
||||||
|
|
||||||
|
<!-- The web server is only bound to loalhost by default -->
|
||||||
<web bind="http://localhost:${http.port}" path="web">
|
<web bind="http://localhost:${http.port}" path="web">
|
||||||
<app url="jolokia" war="jolokia-war-1.2.3.war"/>
|
<app url="jolokia" war="jolokia-war-1.2.3.war"/>
|
||||||
</web>
|
</web>
|
||||||
|
|
|
@ -21,48 +21,50 @@ under the License.
|
||||||
<configuration xmlns="urn:activemq"
|
<configuration xmlns="urn:activemq"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">
|
xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">
|
||||||
|
|
||||||
<jms xmlns="urn:activemq:jms">
|
<jms xmlns="urn:activemq:jms">
|
||||||
<queue name="DLQ"/>
|
<queue name="DLQ"/>
|
||||||
<queue name="ExpiryQueue"/>
|
<queue name="ExpiryQueue"/>
|
||||||
</jms>
|
</jms>
|
||||||
|
|
||||||
<core xmlns="urn:activemq:core">
|
<core xmlns="urn:activemq:core">
|
||||||
<paging-directory>${data.dir:../data}/paging</paging-directory>
|
|
||||||
|
|
||||||
<bindings-directory>${data.dir:../data}/bindings</bindings-directory>
|
<!-- this could be AIO or NIO
|
||||||
|
-->
|
||||||
|
<journal-type>${journal.settings}</journal-type>
|
||||||
|
|
||||||
<journal-directory>${data.dir:../data}/journal</journal-directory>
|
<paging-directory>${data.dir}/paging</paging-directory>
|
||||||
|
|
||||||
|
<bindings-directory>${data.dir}/bindings</bindings-directory>
|
||||||
|
|
||||||
|
<journal-directory>${data.dir}/journal</journal-directory>
|
||||||
|
|
||||||
|
<large-messages-directory>${data.dir}/large-messages</large-messages-directory>
|
||||||
|
|
||||||
<journal-min-files>10</journal-min-files>
|
<journal-min-files>10</journal-min-files>
|
||||||
|
${connector-config.settings}
|
||||||
<large-messages-directory>${data.dir:../data}/large-messages</large-messages-directory>
|
|
||||||
|
|
||||||
<connectors>
|
|
||||||
<!-- Default Connector. Returned to clients during broadcast and distributed around cluster. See broadcast and discovery-groups -->
|
|
||||||
<connector name="artemis">tcp://${activemq.remoting.default.host:${host}}:${activemq.remoting.default.port:${default.port}}</connector>
|
|
||||||
</connectors>
|
|
||||||
|
|
||||||
<acceptors>
|
<acceptors>
|
||||||
<!-- Default ActiveMQ Artemis Acceptor. Multi-protocol adapter. Currently supports Core, OpenWire, Stomp and AMQP. -->
|
<!-- Default ActiveMQ Artemis Acceptor. Multi-protocol adapter. Currently supports Core, OpenWire, Stomp and AMQP. -->
|
||||||
<acceptor name="artemis">tcp://${activemq.remoting.default.host:${host}}:${activemq.remoting.default.port:${default.port}}</acceptor>
|
<acceptor name="artemis">tcp://${host}:${default.port}</acceptor>
|
||||||
|
|
||||||
<!-- AMQP Acceptor. Listens on default AMQP port for AMQP traffic.-->
|
<!-- AMQP Acceptor. Listens on default AMQP port for AMQP traffic.-->
|
||||||
<acceptor name="amqp">tcp://${activemq.remoting.amqp.host:${host}}:${activemq.remoting.amqp.port:${amqp.port}}?protocols=AMQP</acceptor>
|
<acceptor name="amqp">tcp://${host}:${amqp.port}?protocols=AMQP</acceptor>
|
||||||
|
|
||||||
<!-- STOMP Acceptor. -->
|
<!-- STOMP Acceptor. -->
|
||||||
<acceptor name="stomp">tcp://${activemq.remoting.stomp.host:${host}}:${activemq.remoting.stomp.port:${stomp.port}}?protocols=STOMP</acceptor>
|
<acceptor name="stomp">tcp://${host}:${stomp.port}?protocols=STOMP</acceptor>
|
||||||
|
|
||||||
<!-- HornetQ Compatibility Acceptor. Enables ActiveMQ Artemis Core and STOMP for legacy HornetQ clients. -->
|
<!-- HornetQ Compatibility Acceptor. Enables ActiveMQ Artemis Core and STOMP for legacy HornetQ clients. -->
|
||||||
<acceptor name="hornetq">tcp://${activemq.remoting.hornetq.host:${host}}:${activemq.remoting.hornetq.port:${hq.port}}?protocols=HORNETQ,STOMP</acceptor>
|
<acceptor name="hornetq">tcp://${host}:${hq.port}?protocols=HORNETQ,STOMP</acceptor>
|
||||||
</acceptors>
|
</acceptors>
|
||||||
|
${cluster-security.settings}${cluster.settings}${replicated.settings}${shared-store.settings}
|
||||||
${cluster-security.settings}${cluster.settings}${replicated.settings}${shared-store.settings}
|
|
||||||
|
|
||||||
<security-settings>
|
<security-settings>
|
||||||
<security-setting match="#">
|
<security-setting match="#">
|
||||||
<permission type="createNonDurableQueue" roles="guest"/>
|
<permission type="createNonDurableQueue" roles="${role}"/>
|
||||||
<permission type="deleteNonDurableQueue" roles="guest"/>
|
<permission type="deleteNonDurableQueue" roles="${role}"/>
|
||||||
<permission type="consume" roles="guest"/>
|
<permission type="createDurableQueue" roles="${role}"/>
|
||||||
<permission type="send" roles="guest"/>
|
<permission type="deleteDurableQueue" roles="${role}"/>
|
||||||
|
<permission type="consume" roles="${role}"/>
|
||||||
|
<permission type="send" roles="${role}"/>
|
||||||
</security-setting>
|
</security-setting>
|
||||||
</security-settings>
|
</security-settings>
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
<cluster-user>${cluster-user}</cluster-user>
|
<cluster-user>${cluster-user}</cluster-user>
|
||||||
<cluster-password>${cluster-password}</cluster-password>
|
|
||||||
|
<cluster-password>${cluster-password}</cluster-password>
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
<connectors>
|
||||||
|
<!-- Connector used to be announced through cluster connections and notifications -->
|
||||||
|
<connector name="artemis">tcp://${host}:${default.port}</connector>
|
||||||
|
</connectors>
|
||||||
|
|
|
@ -42,6 +42,12 @@ public class StreamClassPathTest
|
||||||
openStream(Create.ETC_BROKER_XML);
|
openStream(Create.ETC_BROKER_XML);
|
||||||
openStream(Create.ETC_ARTEMIS_ROLES_PROPERTIES);
|
openStream(Create.ETC_ARTEMIS_ROLES_PROPERTIES);
|
||||||
openStream(Create.ETC_ARTEMIS_USERS_PROPERTIES);
|
openStream(Create.ETC_ARTEMIS_USERS_PROPERTIES);
|
||||||
|
openStream(Create.ETC_REPLICATED_SETTINGS_TXT);
|
||||||
|
openStream(Create.ETC_REPLICATED_SETTINGS_TXT);
|
||||||
|
openStream(Create.ETC_SHARED_STORE_SETTINGS_TXT);
|
||||||
|
openStream(Create.ETC_CLUSTER_SECURITY_SETTINGS_TXT);
|
||||||
|
openStream(Create.ETC_CLUSTER_SETTINGS_TXT);
|
||||||
|
openStream(Create.ETC_CONNECTOR_SETTINGS_TXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
<!-- Exclude all docs except user manual -->
|
<!-- Exclude all docs except user manual -->
|
||||||
<exclude>docs/design-guide/</exclude>
|
<exclude>docs/design-guide/</exclude>
|
||||||
<exclude>docs/diagrams/</exclude>
|
<exclude>docs/diagrams/</exclude>
|
||||||
<exclude>docs/quickstart-guide/</exclude>
|
|
||||||
|
|
||||||
<!-- Exclude Release and Dev files -->
|
<!-- Exclude Release and Dev files -->
|
||||||
<exclude>RELEASING.md</exclude>
|
<exclude>RELEASING.md</exclude>
|
||||||
|
|
|
@ -23,6 +23,9 @@ under the License.
|
||||||
<meta content="text/html; charset=ISO-8859-1"
|
<meta content="text/html; charset=ISO-8859-1"
|
||||||
http-equiv="content-type">
|
http-equiv="content-type">
|
||||||
<title>Apache ActiveMQ Artemis README</title>
|
<title>Apache ActiveMQ Artemis README</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="./examples/jms/common/common.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="./examples/jms/common/prettify.css" />
|
||||||
|
<script type="text/javascript" src="./examples/jms/common/prettify.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
@ -38,6 +41,42 @@ To create a broker, navigate to the distribution 'bin/' directory and run: </br>
|
||||||
|
|
||||||
$ ./artemis create $directory </br></br>Where $directory is the folder that you'd like the broker to be created.
|
$ ./artemis create $directory </br></br>Where $directory is the folder that you'd like the broker to be created.
|
||||||
|
|
||||||
|
The create process will input for any required property not specified. Example:
|
||||||
|
|
||||||
|
<PRE>
|
||||||
|
--user: is mandatory at the current context:
|
||||||
|
Please provide the default username:
|
||||||
|
admin
|
||||||
|
|
||||||
|
--password: is mandatory at the current context:
|
||||||
|
Please provide the default password:
|
||||||
|
|
||||||
|
|
||||||
|
--allow-anonymous: is mandatory at the current context:
|
||||||
|
Allow anonymous access? (Y/N):
|
||||||
|
Y
|
||||||
|
</PRE>
|
||||||
|
|
||||||
|
For a full list of availble options for the create process you may use:
|
||||||
|
|
||||||
|
$ ./artemis help create
|
||||||
|
|
||||||
|
<PRE>
|
||||||
|
NAME
|
||||||
|
artemis create - creates a new broker instance
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
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-input] [--user <user>] [--]
|
||||||
|
<directory>
|
||||||
|
...
|
||||||
|
</PRE>
|
||||||
|
|
||||||
|
|
||||||
<h2>Starting the Broker</h2>
|
<h2>Starting the Broker</h2>
|
||||||
|
|
||||||
Once the broker has been created, use the artemis (or artemis.cmd on windows) script of the under the bin directory of the newly created broker to manage the life cycle of the broker.
|
Once the broker has been created, use the artemis (or artemis.cmd on windows) script of the under the bin directory of the newly created broker to manage the life cycle of the broker.
|
||||||
|
|
|
@ -16,13 +16,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.artemis.core.config.impl;
|
package org.apache.activemq.artemis.core.config.impl;
|
||||||
|
|
||||||
import org.apache.activemq.artemis.utils.PasswordMaskingUtil;
|
|
||||||
import org.apache.activemq.artemis.utils.SensitiveDataCodec;
|
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
|
||||||
|
import org.apache.activemq.artemis.utils.PasswordMaskingUtil;
|
||||||
|
import org.apache.activemq.artemis.utils.SensitiveDataCodec;
|
||||||
|
|
||||||
public class FileSecurityConfiguration extends SecurityConfiguration
|
public class FileSecurityConfiguration extends SecurityConfiguration
|
||||||
{
|
{
|
||||||
private final String usersUrl;
|
private final String usersUrl;
|
||||||
|
@ -111,10 +112,17 @@ public class FileSecurityConfiguration extends SecurityConfiguration
|
||||||
for (String username : keys)
|
for (String username : keys)
|
||||||
{
|
{
|
||||||
String roles = roleProps.getProperty(username);
|
String roles = roleProps.getProperty(username);
|
||||||
String[] split = roles.split(",");
|
if (roles == null)
|
||||||
for (String role : split)
|
|
||||||
{
|
{
|
||||||
addRole(username, role.trim());
|
ActiveMQServerLogger.LOGGER.cannotFindRoleForUser(username);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
String[] split = roles.split(",");
|
||||||
|
for (String role : split)
|
||||||
|
{
|
||||||
|
addRole(username, role.trim());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1104,6 +1104,13 @@ public interface ActiveMQServerLogger extends BasicLogger
|
||||||
format = Message.Format.MESSAGE_FORMAT)
|
format = Message.Format.MESSAGE_FORMAT)
|
||||||
void disallowedProtocol(String protocol);
|
void disallowedProtocol(String protocol);
|
||||||
|
|
||||||
|
@LogMessage(level = Logger.Level.WARN)
|
||||||
|
@Message(id = 222191,
|
||||||
|
value = "Could not find any configured role for user {0}.",
|
||||||
|
format = Message.Format.MESSAGE_FORMAT)
|
||||||
|
void cannotFindRoleForUser(String user);
|
||||||
|
|
||||||
|
|
||||||
@LogMessage(level = Logger.Level.ERROR)
|
@LogMessage(level = Logger.Level.ERROR)
|
||||||
@Message(id = 224000, value = "Failure in initialisation", format = Message.Format.MESSAGE_FORMAT)
|
@Message(id = 224000, value = "Failure in initialisation", format = Message.Format.MESSAGE_FORMAT)
|
||||||
void initializationError(@Cause Throwable e);
|
void initializationError(@Cause Throwable e);
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
package org.apache.activemq.artemis.core.server.impl;
|
package org.apache.activemq.artemis.core.server.impl;
|
||||||
|
|
||||||
import javax.management.MBeanServer;
|
import javax.management.MBeanServer;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FilenameFilter;
|
import java.io.FilenameFilter;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
@ -88,12 +87,12 @@ import org.apache.activemq.artemis.core.security.Role;
|
||||||
import org.apache.activemq.artemis.core.security.SecurityStore;
|
import org.apache.activemq.artemis.core.security.SecurityStore;
|
||||||
import org.apache.activemq.artemis.core.security.impl.SecurityStoreImpl;
|
import org.apache.activemq.artemis.core.security.impl.SecurityStoreImpl;
|
||||||
import org.apache.activemq.artemis.core.server.ActivateCallback;
|
import org.apache.activemq.artemis.core.server.ActivateCallback;
|
||||||
import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
|
|
||||||
import org.apache.activemq.artemis.core.server.Bindable;
|
|
||||||
import org.apache.activemq.artemis.core.server.Divert;
|
|
||||||
import org.apache.activemq.artemis.core.server.ActiveMQComponent;
|
import org.apache.activemq.artemis.core.server.ActiveMQComponent;
|
||||||
import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
|
import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
|
||||||
import org.apache.activemq.artemis.core.server.ActiveMQServer;
|
import org.apache.activemq.artemis.core.server.ActiveMQServer;
|
||||||
|
import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
|
||||||
|
import org.apache.activemq.artemis.core.server.Bindable;
|
||||||
|
import org.apache.activemq.artemis.core.server.Divert;
|
||||||
import org.apache.activemq.artemis.core.server.JournalType;
|
import org.apache.activemq.artemis.core.server.JournalType;
|
||||||
import org.apache.activemq.artemis.core.server.LargeServerMessage;
|
import org.apache.activemq.artemis.core.server.LargeServerMessage;
|
||||||
import org.apache.activemq.artemis.core.server.MemoryManager;
|
import org.apache.activemq.artemis.core.server.MemoryManager;
|
||||||
|
@ -116,18 +115,18 @@ import org.apache.activemq.artemis.core.server.management.impl.ManagementService
|
||||||
import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
|
import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
|
||||||
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
|
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
|
||||||
import org.apache.activemq.artemis.core.settings.impl.HierarchicalObjectRepository;
|
import org.apache.activemq.artemis.core.settings.impl.HierarchicalObjectRepository;
|
||||||
import org.apache.activemq.artemis.core.transaction.ResourceManager;
|
|
||||||
import org.apache.activemq.artemis.core.settings.impl.ResourceLimitSettings;
|
import org.apache.activemq.artemis.core.settings.impl.ResourceLimitSettings;
|
||||||
|
import org.apache.activemq.artemis.core.transaction.ResourceManager;
|
||||||
import org.apache.activemq.artemis.core.transaction.impl.ResourceManagerImpl;
|
import org.apache.activemq.artemis.core.transaction.impl.ResourceManagerImpl;
|
||||||
import org.apache.activemq.artemis.core.version.Version;
|
import org.apache.activemq.artemis.core.version.Version;
|
||||||
import org.apache.activemq.artemis.spi.core.protocol.ProtocolManagerFactory;
|
import org.apache.activemq.artemis.spi.core.protocol.ProtocolManagerFactory;
|
||||||
import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
|
import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
|
||||||
import org.apache.activemq.artemis.spi.core.protocol.SessionCallback;
|
import org.apache.activemq.artemis.spi.core.protocol.SessionCallback;
|
||||||
import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
|
import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
|
||||||
|
import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
|
||||||
import org.apache.activemq.artemis.utils.ClassloadingUtil;
|
import org.apache.activemq.artemis.utils.ClassloadingUtil;
|
||||||
import org.apache.activemq.artemis.utils.ConcurrentHashSet;
|
import org.apache.activemq.artemis.utils.ConcurrentHashSet;
|
||||||
import org.apache.activemq.artemis.utils.ExecutorFactory;
|
import org.apache.activemq.artemis.utils.ExecutorFactory;
|
||||||
import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
|
|
||||||
import org.apache.activemq.artemis.utils.OrderedExecutorFactory;
|
import org.apache.activemq.artemis.utils.OrderedExecutorFactory;
|
||||||
import org.apache.activemq.artemis.utils.ReusableLatch;
|
import org.apache.activemq.artemis.utils.ReusableLatch;
|
||||||
import org.apache.activemq.artemis.utils.SecurityFormatter;
|
import org.apache.activemq.artemis.utils.SecurityFormatter;
|
||||||
|
@ -1736,7 +1735,9 @@ public class ActiveMQServerImpl implements ActiveMQServer
|
||||||
|
|
||||||
storageManager = createStorageManager();
|
storageManager = createStorageManager();
|
||||||
|
|
||||||
if (ActiveMQDefaultConfiguration.getDefaultClusterUser().equals(configuration.getClusterUser()) && ActiveMQDefaultConfiguration.getDefaultClusterPassword().equals(configuration.getClusterPassword()))
|
|
||||||
|
if (configuration.getClusterConfigurations().size() > 0 &&
|
||||||
|
ActiveMQDefaultConfiguration.getDefaultClusterUser().equals(configuration.getClusterUser()) && ActiveMQDefaultConfiguration.getDefaultClusterPassword().equals(configuration.getClusterPassword()))
|
||||||
{
|
{
|
||||||
ActiveMQServerLogger.LOGGER.clusterSecurityRisk();
|
ActiveMQServerLogger.LOGGER.clusterSecurityRisk();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
ActiveMQ Artemis Quick Start Manual
|
|
||||||
====================
|
|
||||||
|
|
||||||
How to get started with ActiveMQ
|
|
|
@ -1,7 +0,0 @@
|
||||||
* [Legal Notice](notice.md)
|
|
||||||
* [Introduction](introduction.md)
|
|
||||||
* [About](about.md)
|
|
||||||
* [Download](download.md)
|
|
||||||
* [Installation](installation.md)
|
|
||||||
* [Running](running.md)
|
|
||||||
* [Examples](examples.md)
|
|
|
@ -1,49 +0,0 @@
|
||||||
About ActiveMQ
|
|
||||||
==============
|
|
||||||
|
|
||||||
What is ActiveMQ?
|
|
||||||
|
|
||||||
- ActiveMQ Artemis is an open source project to build a multi-protocol,
|
|
||||||
embeddable, very high performance, clustered, asynchronous messaging
|
|
||||||
system.
|
|
||||||
|
|
||||||
- For answers to more questions about what ActiveMQ Artemis is and what it
|
|
||||||
isn't please visit the [FAQs wiki
|
|
||||||
page](http://www.jboss.org/community/wiki/ActiveMQGeneralFAQs).
|
|
||||||
|
|
||||||
Why use ActiveMQ Artemis? Here are just a few of the reasons:
|
|
||||||
|
|
||||||
- 100% open source software. ActiveMQ Artemis is licenced using the Apache
|
|
||||||
Software License v2.0 to minimise barriers to adoption.
|
|
||||||
|
|
||||||
- ActiveMQ Artemis is designed with usability in mind.
|
|
||||||
|
|
||||||
- Written in Java. Runs on any platform with a Java 7+ runtime, that's
|
|
||||||
everything from Windows desktops to IBM mainframes.
|
|
||||||
|
|
||||||
- Amazing performance. Our class beating high performance journal
|
|
||||||
provides persistent messaging performance at rates normally seen for
|
|
||||||
non persistent messaging, our non persistent messaging performance
|
|
||||||
rocks the boat too.
|
|
||||||
|
|
||||||
- Full feature set. All the features you'd expect in any serious
|
|
||||||
messaging system, and others you won't find anywhere else.
|
|
||||||
|
|
||||||
- Elegant, clean-cut design with minimal third party dependencies. Run
|
|
||||||
ActiveMQ Artemis stand-alone, run it in integrated in your favourite JEE
|
|
||||||
application server, or run it embedded inside your own product. It's
|
|
||||||
up to you.
|
|
||||||
|
|
||||||
- Seamless high availability. We provide a HA solution with automatic
|
|
||||||
client failover so you can guarantee zero message loss or
|
|
||||||
duplication in event of server failure.
|
|
||||||
|
|
||||||
- Hugely flexible clustering. Create clusters of servers that know how
|
|
||||||
to load balance messages. Link geographically distributed clusters
|
|
||||||
over unreliable connections to form a global network. Configure
|
|
||||||
routing of messages in a highly flexible way.
|
|
||||||
|
|
||||||
- For a full list of features, please see the [features wiki
|
|
||||||
page](http://www.jboss.org/community/wiki/ActiveMQFeatures) .
|
|
||||||
|
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
Download
|
|
||||||
========
|
|
||||||
|
|
||||||
The official ActiveMQ Artemis project page is <http://activemq.org/artemis>.
|
|
||||||
|
|
||||||
Software Download
|
|
||||||
=================
|
|
||||||
|
|
||||||
The software can be download from the Download
|
|
||||||
page:<http://activemq.org/artemis/downloads.html>
|
|
||||||
|
|
||||||
Project Information
|
|
||||||
===================
|
|
||||||
|
|
||||||
- ActiveMQ Artemis Git repository is <https://github.com/apache/activemq-artemis>
|
|
||||||
|
|
|
@ -1,314 +0,0 @@
|
||||||
Running the Examples
|
|
||||||
====================
|
|
||||||
|
|
||||||
In the directory `examples` there are 2 sets of examples, these are
|
|
||||||
|
|
||||||
- JMS Examples - these demonstrate functionality while sending and
|
|
||||||
consumng JMS messages.
|
|
||||||
|
|
||||||
- Java EE Examples - these demonstrate application server integration,
|
|
||||||
e.g. MDBs, EJBs, Servlets, etc.
|
|
||||||
|
|
||||||
The JMS examples
|
|
||||||
================
|
|
||||||
|
|
||||||
The JMS Examples all follow the same format. Each examples is contained
|
|
||||||
in its own directory which contains the following.
|
|
||||||
|
|
||||||
- `pom.xml`
|
|
||||||
|
|
||||||
This is the Maven build file used to run the example
|
|
||||||
|
|
||||||
- `src` directory
|
|
||||||
|
|
||||||
This contains the source code for the example
|
|
||||||
|
|
||||||
- `resources/activemq/server0` configuration directory
|
|
||||||
|
|
||||||
This contains the configuration files needed to run the server for
|
|
||||||
the example. There may be multiple configuration directories
|
|
||||||
`server0`, `server1` etc for clustered examples etc.
|
|
||||||
|
|
||||||
Each example will start one or more stand-alone servers and stop them
|
|
||||||
after the example has completed.
|
|
||||||
|
|
||||||
As a quick start we'll run the queue example. For all other examples
|
|
||||||
refer to the main user manual.
|
|
||||||
|
|
||||||
Firstly open a Shell or a Command prompt and navigate to the
|
|
||||||
`examples/jms/queue` directory.
|
|
||||||
|
|
||||||
Type the command `mvn verify` and you should see the following output:
|
|
||||||
|
|
||||||
|
|
||||||
[INFO] Scanning for projects...
|
|
||||||
[INFO]
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
[INFO] Building ActiveMQ Artemis JMS Queue Example 1.0.0
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ activemq-jms-queue-example ---
|
|
||||||
[INFO] Using 'UTF-8' encoding to copy filtered resources.
|
|
||||||
[INFO] Copying 3 resources
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ activemq-jms-queue-example ---
|
|
||||||
[INFO] Nothing to compile - all classes are up to date
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ activemq-jms-queue-example ---
|
|
||||||
[INFO] Using 'UTF-8' encoding to copy filtered resources.
|
|
||||||
[INFO] skip non existing resourceDirectory /home/andy/projects/activemq-master/examples/jms/queue/src/test/resources
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ activemq-jms-queue-example ---
|
|
||||||
[INFO] No sources to compile
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- maven-surefire-plugin:2.13:test (default-test) @ activemq-jms-queue-example ---
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ activemq-jms-queue-example ---
|
|
||||||
[INFO] Building jar: /home/andy/projects/activemq-master/examples/jms/queue/target/activemq-jms-queue-example-1.0.0.jar
|
|
||||||
[INFO]
|
|
||||||
[INFO] >>> maven-source-plugin:2.2.1:jar (attach-sources) @ activemq-jms-queue-example >>>
|
|
||||||
[INFO]
|
|
||||||
[INFO] <<< maven-source-plugin:2.2.1:jar (attach-sources) @ activemq-jms-queue-example <<<
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- maven-source-plugin:2.2.1:jar (attach-sources) @ activemq-jms-queue-example ---
|
|
||||||
[INFO] Building jar: /home/andy/projects/activemq-master/examples/jms/queue/target/activemq-jms-queue-example-1.0.0-sources.jar
|
|
||||||
[INFO]
|
|
||||||
[INFO] >>> maven-source-plugin:2.2.1:jar (default) @ activemq-jms-queue-example >>>
|
|
||||||
[INFO]
|
|
||||||
[INFO] <<< maven-source-plugin:2.2.1:jar (default) @ activemq-jms-queue-example <<<
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- maven-source-plugin:2.2.1:jar (default) @ activemq-jms-queue-example ---
|
|
||||||
[WARNING] Artifact org.apache.activemq.examples.jms:activemq-jms-queue-example:java-source:sources:1.0.0 already attached to project, ignoring duplicate
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- activemq-maven-plugin:1.1.1-SNAPSHOT:start (start) @ activemq-jms-queue-example ---
|
|
||||||
[file:/home/andy/projects/activemq-master/examples/jms/queue/target/classes/activemq/server0/]
|
|
||||||
Apr 17, 2013 10:51:01 AM org.apache.activemq.core.deployers.impl.FileConfigurationParser parseMainConfig
|
|
||||||
WARN: AMQ222018: AIO was not located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal
|
|
||||||
Apr 17, 2013 10:51:01 AM org.apache.activemq.core.server.impl.ActiveMQServerImpl start
|
|
||||||
INFO: AMQ221000: live server is starting with configuration ActiveMQ Artemis Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=/home/andy/projects/activemq-master/examples/jms/queue/target//server0/data/messaging/journal,bindingsDirectory=/home/andy/projects/activemq-master/examples/jms/queue/target//server0/data/messaging/bindings,largeMessagesDirectory=/home/andy/projects/activemq-master/examples/jms/queue/target//server0/data/messaging/largemessages,pagingDirectory=/home/andy/projects/activemq-master/examples/jms/queue/target//server0/data/messaging/paging)
|
|
||||||
Apr 17, 2013 10:51:01 AM org.apache.activemq.core.server.impl.ActiveMQServerImpl$SharedStoreLiveActivation run
|
|
||||||
INFO: AMQ221006: Waiting to obtain live lock
|
|
||||||
Apr 17, 2013 10:51:01 AM org.apache.activemq.core.persistence.impl.journal.JournalStorageManager <init>
|
|
||||||
INFO: AMQ221013: Using NIO Journal
|
|
||||||
Apr 17, 2013 10:51:01 AM org.apache.activemq.core.server.impl.ActiveMQServerImpl initialisePart1
|
|
||||||
WARN: AMQ222007: Security risk! ActiveMQ Artemis is running with the default cluster admin user and default password. Please see the ActiveMQ Artemis user guide, cluster chapter, for instructions on how to change this.
|
|
||||||
Apr 17, 2013 10:51:01 AM org.apache.activemq.core.server.impl.FileLockNodeManager startLiveNode
|
|
||||||
INFO: AMQ221034: Waiting to obtain live lock
|
|
||||||
Apr 17, 2013 10:51:01 AM org.apache.activemq.core.server.impl.FileLockNodeManager startLiveNode
|
|
||||||
INFO: AMQ221035: Live Server Obtained live lock
|
|
||||||
Apr 17, 2013 10:51:02 AM org.apache.activemq.core.server.impl.ActiveMQServerImpl deployQueue
|
|
||||||
INFO: AMQ221003: trying to deploy queue jms.queue.exampleQueue
|
|
||||||
Apr 17, 2013 10:51:02 AM org.apache.activemq.core.remoting.impl.netty.NettyAcceptor start
|
|
||||||
INFO: AMQ221020: Started Netty Acceptor version 3.6.2.Final-c0d783c localhost:61616 for CORE protocol
|
|
||||||
Apr 17, 2013 10:51:02 AM org.apache.activemq.core.server.impl.ActiveMQServerImpl$SharedStoreLiveActivation run
|
|
||||||
INFO: AMQ221007: Server is now live
|
|
||||||
Apr 17, 2013 10:51:02 AM org.apache.activemq.core.server.impl.ActiveMQServerImpl start
|
|
||||||
INFO: AMQ221001: ActiveMQ Artemis Server version 1.0.0 (black'n'yellow, 123) [a57893ff-7783-11e2-9787-07ca142fc9f7]
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- activemq-maven-plugin:1.1.1-SNAPSHOT:runClient (runClient) @ activemq-jms-queue-example ---
|
|
||||||
Apr 17, 2013 10:51:02 AM org.apache.activemq.common.example.ActiveMQExample getContext
|
|
||||||
INFO: using jnp://localhost:1099 for jndi
|
|
||||||
Sent message: This is a text message
|
|
||||||
Received message: This is a text message
|
|
||||||
example complete
|
|
||||||
|
|
||||||
#####################
|
|
||||||
### SUCCESS! ###
|
|
||||||
#####################
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- activemq-maven-plugin:1.1.1-SNAPSHOT:stop (stop) @ activemq-jms-queue-example ---
|
|
||||||
Apr 17, 2013 10:51:03 AM org.apache.activemq.core.server.management.impl.ManagementServiceImpl stop
|
|
||||||
WARN: AMQ222113: On ManagementService stop, there are 1 unexpected registered MBeans: [core.acceptor.netty-acceptor]
|
|
||||||
Apr 17, 2013 10:51:03 AM org.apache.activemq.core.server.impl.ActiveMQServerImpl stop
|
|
||||||
INFO: AMQ221002: ActiveMQ Artemis Server version 1.0.0 (black'n'yellow, 123) [a57893ff-7783-11e2-9787-07ca142fc9f7] stopped
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
[INFO] BUILD SUCCESS
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
[INFO] Total time: 4.428s
|
|
||||||
[INFO] Finished at: Wed Apr 17 10:51:03 BST 2013
|
|
||||||
[INFO] Final Memory: 11M/456M
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Congratulations! You have successfully run your first ActiveMQ Artemis example.
|
|
||||||
Try some of the others.
|
|
||||||
|
|
||||||
The Java EE Examples
|
|
||||||
====================
|
|
||||||
|
|
||||||
The Java EE Examples are examples that require a JEE application server
|
|
||||||
to run. They include MDB, Servlet, EJB examples etc. For this you will
|
|
||||||
need the JBoss Application Server 7.1.x installed and uses Arquillian to
|
|
||||||
run the example. How to do this is explained in the previous chapters.
|
|
||||||
|
|
||||||
We'll use the MDB example for the purposes of this guide. For the other
|
|
||||||
examples refer to the user guide. Before going any further ensure that
|
|
||||||
the JBoss Application Server is running.
|
|
||||||
|
|
||||||
The first thing we need to do is set the `JBOSS_HOME` environment
|
|
||||||
property to the location of the JBoss Application Server, in a Linux
|
|
||||||
shell this would be something like:
|
|
||||||
|
|
||||||
export JBOSS_HOME=/home/jbossas7.1/build/output/jboss-7.1.0
|
|
||||||
|
|
||||||
Yoy can then run the example via maven by running `mvn test`
|
|
||||||
|
|
||||||
In the shell window you should see something like the following output:
|
|
||||||
|
|
||||||
[INFO] Scanning for projects...
|
|
||||||
[INFO]
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
[INFO] Building ActiveMQ Artemis JEE MDB Example 1.0.0
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ activemq-jee-mdb-bmt-example ---
|
|
||||||
[INFO] Using 'UTF-8' encoding to copy filtered resources.
|
|
||||||
[INFO] skip non existing resourceDirectory /home/andy/projects/activemq-master/examples/javaee/mdb-bmt/src/main/resources
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ activemq-jee-mdb-bmt-example ---
|
|
||||||
[INFO] Nothing to compile - all classes are up to date
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- maven-resources-plugin:2.6:copy-resources (as-node-0) @ activemq-jee-mdb-bmt-example ---
|
|
||||||
[INFO] Using 'UTF-8' encoding to copy filtered resources.
|
|
||||||
[INFO] Copying 1112 resources
|
|
||||||
[INFO] Copying 5 resources
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ activemq-jee-mdb-bmt-example ---
|
|
||||||
[INFO] Using 'UTF-8' encoding to copy filtered resources.
|
|
||||||
[INFO] Copying 1 resource
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ activemq-jee-mdb-bmt-example ---
|
|
||||||
[INFO] Changes detected - recompiling the module!
|
|
||||||
[INFO] Compiling 1 source file to /home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/test-classes
|
|
||||||
[INFO]
|
|
||||||
[INFO] --- maven-surefire-plugin:2.12:test (default-test) @ activemq-jee-mdb-bmt-example ---
|
|
||||||
[INFO] Surefire report directory: /home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/surefire-reports
|
|
||||||
|
|
||||||
-------------------------------------------------------
|
|
||||||
T E S T S
|
|
||||||
-------------------------------------------------------
|
|
||||||
Running org.apache.activemq.javaee.example.server.ExampleRunnerTest
|
|
||||||
log4j:WARN No appenders could be found for logger (org.jboss.logging).
|
|
||||||
log4j:WARN Please initialize the log4j system properly.
|
|
||||||
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
|
|
||||||
Apr 17, 2013 10:58:04 AM org.jboss.arquillian.container.impl.MapObject populate
|
|
||||||
WARNING: Configuration contain properties not supported by the backing object org.jboss.as.arquillian.container.managed.ManagedContainerConfiguration
|
|
||||||
Unused property entries: {waitForPortsTimeoutInSeconds=8, waitForPorts=8787 9999}
|
|
||||||
Supported property names: [jbossHome, outputToConsole, enableAssertions, password, managementPort, javaHome, javaVmArguments, username, serverConfig, allowConnectingToRunningServer, managementAddress, startupTimeoutInSeconds, modulePath]
|
|
||||||
Apr 17, 2013 10:58:04 AM org.jboss.as.arquillian.container.managed.ManagedDeployableContainer startInternal
|
|
||||||
INFO: Starting container with: [/home/andy/devtools/jdk1.6.0_25//bin/java, -Djboss.inst=/home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0, -ea, -Djboss.home.dir=/home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0, -Dorg.jboss.boot.log.file=/home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/standalone/log/boot.log, -Dlogging.configuration=file:/home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/standalone/configuration/logging.properties, -Djboss.modules.dir=/home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/modules, -Djboss.bundles.dir=/home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/bundles, -jar, /home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/jboss-modules.jar, -mp, /home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/modules, -jaxpmodule, javax.xml.jaxp-provider, org.jboss.as.standalone, -server-config, standalone-example.xml]
|
|
||||||
10:58:04,525 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA
|
|
||||||
10:58:04,664 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA
|
|
||||||
10:58:04,703 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
|
|
||||||
10:58:05,492 INFO [org.xnio] XNIO Version 3.0.3.GA
|
|
||||||
10:58:05,494 INFO [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
|
|
||||||
10:58:05,502 INFO [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
|
|
||||||
10:58:05,509 INFO [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
|
|
||||||
10:58:05,527 INFO [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
|
|
||||||
10:58:05,530 INFO [org.jboss.as.configadmin] (ServerService Thread Pool -- 32) JBAS016200: Activating ConfigAdmin Subsystem
|
|
||||||
10:58:05,560 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 37) JBAS010280: Activating Infinispan subsystem.
|
|
||||||
10:58:05,562 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 33) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
|
|
||||||
10:58:05,573 INFO [org.jboss.as.jacorb] (ServerService Thread Pool -- 38) JBAS016300: Activating JacORB Subsystem
|
|
||||||
10:58:05,595 INFO [org.jboss.as.connector] (MSC service thread 1-12) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
|
|
||||||
10:58:05,612 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 48) JBAS011800: Activating Naming Subsystem
|
|
||||||
10:58:05,625 INFO [org.jboss.as.osgi] (ServerService Thread Pool -- 49) JBAS011940: Activating OSGi Subsystem
|
|
||||||
10:58:05,649 INFO [org.jboss.as.security] (ServerService Thread Pool -- 54) JBAS013101: Activating Security Subsystem
|
|
||||||
10:58:05,657 INFO [org.jboss.as.naming] (MSC service thread 1-8) JBAS011802: Starting Naming Service
|
|
||||||
10:58:05,663 INFO [org.jboss.as.mail.extension] (MSC service thread 1-16) JBAS015400: Bound mail session [java:jboss/mail/Default]
|
|
||||||
10:58:05,675 INFO [org.jboss.as.security] (MSC service thread 1-14) JBAS013100: Current PicketBox version=4.0.7.Final
|
|
||||||
10:58:05,683 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 58) JBAS015537: Activating WebServices Extension
|
|
||||||
10:58:05,705 INFO [org.jboss.jaxr] (MSC service thread 1-8) JBAS014000: Started JAXR subsystem, binding JAXR connection factory into JNDI as: java:jboss/jaxr/ConnectionFactory
|
|
||||||
10:58:05,831 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-4) JBoss Web Services - Stack CXF Server 4.0.2.GA
|
|
||||||
10:58:05,943 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-6) Starting Coyote HTTP/1.1 on http-localhost.localdomain-127.0.0.1-8080
|
|
||||||
10:58:05,966 INFO [org.jboss.as.jacorb] (MSC service thread 1-2) JBAS016330: CORBA ORB Service started
|
|
||||||
10:58:05,988 INFO [org.apache.activemq.core.server.impl.ActiveMQServerImpl] (MSC service thread 1-11) live server is starting with configuration ActiveMQ Artemis Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=/home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/standalone/data/messagingjournal,bindingsDirectory=/home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/standalone/data/messagingbindings,largeMessagesDirectory=/home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/standalone/data/messaginglargemessages,pagingDirectory=/home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/standalone/data/messagingpaging)
|
|
||||||
10:58:05,996 INFO [org.apache.activemq.core.server.impl.ActiveMQServerImpl] (MSC service thread 1-11) Waiting to obtain live lock
|
|
||||||
10:58:06,037 INFO [org.apache.activemq.core.persistence.impl.journal.JournalStorageManager] (MSC service thread 1-11) Using AIO Journal
|
|
||||||
10:58:06,122 INFO [org.jboss.as.jacorb] (MSC service thread 1-14) JBAS016328: CORBA Naming Service started
|
|
||||||
10:58:06,184 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
|
|
||||||
10:58:06,204 INFO [org.apache.activemq.core.server.impl.AIOFileLockNodeManager] (MSC service thread 1-11) Waiting to obtain live lock
|
|
||||||
10:58:06,205 INFO [org.apache.activemq.core.server.impl.AIOFileLockNodeManager] (MSC service thread 1-11) Live Server Obtained live lock
|
|
||||||
10:58:06,434 INFO [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on localhost.localdomain/127.0.0.1:4447
|
|
||||||
10:58:06,434 INFO [org.jboss.as.remoting] (MSC service thread 1-15) JBAS017100: Listening on /127.0.0.1:9999
|
|
||||||
10:58:06,436 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-16) JBAS015012: Started FileSystemDeploymentService for directory /home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/standalone/deployments
|
|
||||||
10:58:08,790 INFO [org.apache.activemq.core.remoting.impl.netty.NettyAcceptor] (MSC service thread 1-11) Started Netty Acceptor version 3.2.5.Final-a96d88c localhost.localdomain:61616 for CORE protocol
|
|
||||||
10:58:08,793 INFO [org.apache.activemq.core.remoting.impl.netty.NettyAcceptor] (MSC service thread 1-11) Started Netty Acceptor version 3.2.5.Final-a96d88c localhost.localdomain:5455 for CORE protocol
|
|
||||||
10:58:08,795 INFO [org.apache.activemq.core.server.impl.ActiveMQServerImpl] (MSC service thread 1-11) Server is now live
|
|
||||||
10:58:08,797 INFO [org.apache.activemq.core.server.impl.ActiveMQServerImpl] (MSC service thread 1-11) ActiveMQ Artemis Server version 2.2.13.Final (AMQ_2_2_13_FINAL_AS7, 122) [5c499e88-9c63-11e2-bfa3-fe5400591699]) started
|
|
||||||
10:58:08,822 INFO [org.jboss.as.messaging] (MSC service thread 1-4) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
|
|
||||||
10:58:08,824 INFO [org.jboss.as.messaging] (MSC service thread 1-4) JBAS011601: Bound messaging object to jndi name java:/RemoteConnectionFactory
|
|
||||||
10:58:08,825 INFO [org.jboss.as.messaging] (MSC service thread 1-10) JBAS011601: Bound messaging object to jndi name java:/ConnectionFactory
|
|
||||||
10:58:08,830 INFO [org.apache.activemq.core.server.impl.ActiveMQServerImpl] (MSC service thread 1-3) trying to deploy queue jms.queue.testQueue
|
|
||||||
10:58:08,836 INFO [org.jboss.as.messaging] (MSC service thread 1-3) JBAS011601: Bound messaging object to jndi name java:/queue/test
|
|
||||||
10:58:08,840 INFO [org.jboss.as.messaging] (MSC service thread 1-3) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/queues/testQueue
|
|
||||||
10:58:08,859 INFO [org.jboss.as.deployment.connector] (MSC service thread 1-9) JBAS010406: Registered connection factory java:/JmsXA
|
|
||||||
10:58:08,866 INFO [org.apache.activemq.ra.ActiveMQResourceAdapter] (MSC service thread 1-9) ActiveMQ Artemis resource adaptor started
|
|
||||||
10:58:08,867 INFO [org.jboss.as.connector.services.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-9) IJ020002: Deployed: file://RaActivatoractivemq-ra
|
|
||||||
10:58:08,870 INFO [org.jboss.as.deployment.connector] (MSC service thread 1-5) JBAS010401: Bound JCA ConnectionFactory [java:/JmsXA]
|
|
||||||
10:58:08,898 INFO [org.jboss.as.server.deployment] (MSC service thread 1-10) JBAS015876: Starting deployment of "ONT001-1.0.war"
|
|
||||||
10:58:09,146 INFO [org.jboss.wsf.stack.cxf.metadata.MetadataBuilder] (MSC service thread 1-1) Add Service
|
|
||||||
id=com.hpm.webservices.BasicWSImpl
|
|
||||||
address=http://localhost:8080/hpm/BasicWService
|
|
||||||
implementor=com.hpm.webservices.BasicWSImpl
|
|
||||||
invoker=org.jboss.wsf.stack.cxf.JBossWSInvoker
|
|
||||||
serviceName={http://ont001-hpm.rhcloud.com/BasicWS}BasicWService
|
|
||||||
portName={http://ont001-hpm.rhcloud.com/BasicWS}BasicWS
|
|
||||||
wsdlLocation=null
|
|
||||||
mtomEnabled=false
|
|
||||||
10:58:09,361 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-1) Creating Service {http://ont001-hpm.rhcloud.com/BasicWS}BasicWService from WSDL: WEB-INF/wsdl/BasicWService.wsdl
|
|
||||||
10:58:09,517 INFO [org.jboss.wsf.stack.cxf.transport.AddressRewritingEndpointInfo] (MSC service thread 1-1) Setting new service endpoint address in wsdl: http://ONT001-HPM.rhcloud.com:80/BasicWService
|
|
||||||
10:58:09,656 INFO [org.jboss.wsf.stack.cxf.transport.AddressRewritingEndpointInfo] (MSC service thread 1-1) Setting new service endpoint address in wsdl: http://localhost:8080/hpm/BasicWService
|
|
||||||
10:58:09,688 INFO [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-1) Setting the server's publish address to be http://localhost:8080/hpm/BasicWService
|
|
||||||
10:58:09,729 INFO [org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher] (MSC service thread 1-1) WSDL published to: file:/home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/standalone/data/wsdl/ONT001-1.0.war/BasicWService.wsdl
|
|
||||||
10:58:09,735 INFO [org.jboss.as.webservices] (MSC service thread 1-11) JBAS015539: Starting service jboss.ws.port-component-link
|
|
||||||
10:58:09,748 INFO [org.jboss.as.webservices] (MSC service thread 1-10) JBAS015539: Starting service jboss.ws.endpoint."ONT001-1.0.war"."com.hpm.webservices.BasicWSImpl"
|
|
||||||
10:58:09,753 INFO [org.jboss.ws.common.management.DefaultEndpointRegistry] (MSC service thread 1-10) register: jboss.ws:context=hpm,endpoint=com.hpm.webservices.BasicWSImpl
|
|
||||||
10:58:09,829 INFO [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context: /hpm
|
|
||||||
10:58:09,834 INFO [org.jboss.as] (MSC service thread 1-7) JBAS015951: Admin console listening on http://127.0.0.1:9990
|
|
||||||
10:58:09,835 INFO [org.jboss.as] (MSC service thread 1-7) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 5506ms - Started 216 of 296 services (79 services are passive or on-demand)
|
|
||||||
10:58:09,979 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "ONT001-1.0.war"
|
|
||||||
mdb.jar:
|
|
||||||
/org/
|
|
||||||
/org.apache.activemq/
|
|
||||||
/org.apache.activemq/javaee/
|
|
||||||
/org.apache.activemq/javaee/example/
|
|
||||||
/org.apache.activemq/javaee/example/server/
|
|
||||||
/org.apache.activemq/javaee/example/server/MDB_BMTExample.class
|
|
||||||
10:58:11,612 INFO [org.jboss.as.repository] (management-handler-thread - 2) JBAS014900: Content added at location /home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/standalone/data/content/f0/e2d589ab9490193e109c8bc833f725c87defae/content
|
|
||||||
10:58:11,620 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "arquillian-service"
|
|
||||||
10:58:11,811 WARN [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.as.jmx:main") which may be changed or removed in future versions without notice.
|
|
||||||
10:58:11,812 WARN [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.as.server:main") which may be changed or removed in future versions without notice.
|
|
||||||
10:58:11,813 WARN [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.as.osgi:main") which may be changed or removed in future versions without notice.
|
|
||||||
10:58:11,815 WARN [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.jandex:main") which may be changed or removed in future versions without notice.
|
|
||||||
10:58:11,817 WARN [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.osgi.framework:main") which may be changed or removed in future versions without notice.
|
|
||||||
10:58:11,953 INFO [org.jboss.as.server] (management-handler-thread - 2) JBAS018559: Deployed "arquillian-service"
|
|
||||||
10:58:12,328 INFO [org.jboss.as.repository] (management-handler-thread - 3) JBAS014900: Content added at location /home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/standalone/data/content/59/7dcdb0f420ed57aea638b2599f7a86eecf6c85/content
|
|
||||||
10:58:12,333 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of "mdb.jar"
|
|
||||||
10:58:12,401 INFO [org.jboss.as.arquillian] (MSC service thread 1-14) Arquillian deployment detected: ArquillianConfig[service=jboss.arquillian.config."mdb.jar",unit=mdb.jar,tests=[org.apache.activemq.javaee.example.server.ExampleRunnerTest]]
|
|
||||||
10:58:12,418 INFO [org.jboss.as.ejb3] (MSC service thread 1-15) JBAS014142: Started message driven bean 'MDB_BMTExample' with 'activemq-ra' resource adapter
|
|
||||||
10:58:12,562 INFO [org.jboss.as.server] (management-handler-thread - 3) JBAS018559: Deployed "mdb.jar"
|
|
||||||
Sent message: This is a text message
|
|
||||||
10:58:13,229 INFO [org.jboss.as.naming] (Remoting "localhost" task-3) JBAS011806: Channel end notification received, closing channel Channel ID 57be4578 (inbound) of Remoting connection 3ac552d5 to /127.0.0.1:58571
|
|
||||||
10:58:13,255 INFO [stdout] (Thread-0 (ActiveMQ-client-global-threads-1402019528)) message This is a text message received
|
|
||||||
10:58:13,257 INFO [stdout] (Thread-0 (ActiveMQ-client-global-threads-1402019528)) we're in the middle of a transaction: org.jboss.tm.usertx.client.ServerVMClientUserTransaction@6b04d3c8
|
|
||||||
10:58:14,292 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015877: Stopped deployment mdb.jar in 33ms
|
|
||||||
10:58:14,413 INFO [org.jboss.as.repository] (management-handler-thread - 1) JBAS014901: Content removed from location /home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/standalone/data/content/59/7dcdb0f420ed57aea638b2599f7a86eecf6c85/content
|
|
||||||
10:58:14,415 INFO [org.jboss.as.server] (management-handler-thread - 1) JBAS018558: Undeployed "mdb.jar"
|
|
||||||
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.609 sec
|
|
||||||
10:58:14,436 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015877: Stopped deployment arquillian-service in 6ms
|
|
||||||
10:58:14,530 INFO [org.jboss.as.repository] (management-handler-thread - 2) JBAS014901: Content removed from location /home/andy/projects/activemq-master/examples/javaee/mdb-bmt/target/jbossas-node0/standalone/data/content/f0/e2d589ab9490193e109c8bc833f725c87defae/content
|
|
||||||
10:58:14,532 INFO [org.jboss.as.server] (management-handler-thread - 2) JBAS018558: Undeployed "arquillian-service"
|
|
||||||
|
|
||||||
Results :
|
|
||||||
|
|
||||||
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
|
|
||||||
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
[INFO] BUILD SUCCESS
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
[INFO] Total time: 23.441s
|
|
||||||
[INFO] Finished at: Wed Apr 17 10:58:16 BST 2013
|
|
||||||
[INFO] Final Memory: 19M/361M
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Congratulations! you have successfully deployed and run a Java EE
|
|
||||||
example.
|
|
|
@ -1,73 +0,0 @@
|
||||||
Installation
|
|
||||||
============
|
|
||||||
|
|
||||||
This section describes how to install ActiveMQ Artemis.
|
|
||||||
|
|
||||||
Prerequisites
|
|
||||||
=============
|
|
||||||
|
|
||||||
> **Note**
|
|
||||||
>
|
|
||||||
> ActiveMQ Artemis only runs on Java 7 or later.
|
|
||||||
|
|
||||||
By default, ActiveMQ Artemis server runs with 1GiB of memory. If your computer
|
|
||||||
has less memory, or you want to run it with more available RAM, modify
|
|
||||||
the value in `bin/run.sh` accordingly.
|
|
||||||
|
|
||||||
For persistence, ActiveMQ Artemis uses its own fast journal, which you can
|
|
||||||
configure to use libaio (which is the default when running on Linux) or
|
|
||||||
Java NIO. In order to use the libaio module on Linux, you'll need to
|
|
||||||
install libaio, if it's not already installed.
|
|
||||||
|
|
||||||
If you're not running on Linux then you don't need to worry about this.
|
|
||||||
|
|
||||||
You can install libaio using the following steps as the root user:
|
|
||||||
|
|
||||||
Using yum, (e.g. on Fedora or Red Hat Enterprise Linux):
|
|
||||||
|
|
||||||
yum install libaio
|
|
||||||
|
|
||||||
Using aptitude, (e.g. on Ubuntu or Debian system):
|
|
||||||
|
|
||||||
apt-get install libaio
|
|
||||||
|
|
||||||
Installing the Standalone Distribution
|
|
||||||
======================================
|
|
||||||
|
|
||||||
After downloading the distribution, unzip it into your chosen directory.
|
|
||||||
At this point it should be possible to [run straight out of the
|
|
||||||
box](#running.standalone), the following describes the directory
|
|
||||||
structure:
|
|
||||||
|
|
||||||
|___ bin
|
|
||||||
|
|
|
||||||
|___ docs
|
|
||||||
| |___ api
|
|
||||||
| |___ quickstart-guide
|
|
||||||
| |___ user-manual
|
|
||||||
|
|
|
||||||
|___ examples
|
|
||||||
| |___ core
|
|
||||||
| |___ javaee
|
|
||||||
| |___ jms
|
|
||||||
|
|
|
||||||
|___ lib
|
|
||||||
|
|
|
||||||
|___ licenses
|
|
||||||
|
|
|
||||||
|___ schemas
|
|
||||||
|
|
||||||
|
|
||||||
- `bin` -- binaries and scripts needed to run ActiveMQ Artemis.
|
|
||||||
|
|
||||||
- `docs` -- guides and javadocs for ActiveMQ
|
|
||||||
|
|
||||||
- `examples` -- JMS and Java EE examples. Please refer to the 'running
|
|
||||||
examples' chapter for details on how to run them.
|
|
||||||
|
|
||||||
- `lib` -- jars and libraries needed to run ActiveMQ
|
|
||||||
|
|
||||||
- `licenses` -- licenses for ActiveMQ
|
|
||||||
|
|
||||||
- `schemas` -- XML Schemas used to validate ActiveMQ Artemis configuration
|
|
||||||
files
|
|
|
@ -1,13 +0,0 @@
|
||||||
Getting Started
|
|
||||||
===============
|
|
||||||
|
|
||||||
This short guide explains how to download, install and quickly get
|
|
||||||
started with ActiveMQ Artemis.
|
|
||||||
|
|
||||||
After downloading and installing we highly recommend you run the
|
|
||||||
examples to get acquainted with ActiveMQ Artemis. We ship with over 70 examples
|
|
||||||
demonstrating most of the features.
|
|
||||||
|
|
||||||
This guide is not intended to be a replacement for the user manual. The
|
|
||||||
user manual goes into much more depth, so please consult that for
|
|
||||||
further information.
|
|
|
@ -1,22 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# 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.
|
|
||||||
for i in `find . -name "*.xml"`; do
|
|
||||||
newFile=`echo $i | sed 's/xml/md/'`
|
|
||||||
echo creating $newFile
|
|
||||||
pandoc -f docbook -t markdown $i -o $newFile
|
|
||||||
done
|
|
|
@ -1,17 +0,0 @@
|
||||||
Legal Notice
|
|
||||||
============
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,53 +0,0 @@
|
||||||
Creating a Broker Instance
|
|
||||||
==========================
|
|
||||||
|
|
||||||
|
|
||||||
A broker instance is the directory containing all the configuration and runtime
|
|
||||||
data, such as logs and data files, associated with a broker process. It is recommended that
|
|
||||||
you do *not* create the instance directory under `${ARTEMIS_HOME}`. This separation is
|
|
||||||
encouraged so that you can more easily upgrade when the next version of ActiveMQ Artemis is released.
|
|
||||||
|
|
||||||
On Unix systems, it is a common convention to store this kind of runtime data under
|
|
||||||
the `/var/lib` directory. For example, to create an instance at '/var/lib/mybroker', run
|
|
||||||
the following commands in your command line shell:
|
|
||||||
|
|
||||||
cd /var/lib
|
|
||||||
${ARTEMIS_HOME}/bin/activemq create mybroker
|
|
||||||
|
|
||||||
A broker instance directory will contain the following sub directories:
|
|
||||||
|
|
||||||
* `bin`: holds execution scripts associated with this instance.
|
|
||||||
* `etc`: hold the instance configuration files
|
|
||||||
* `data`: holds the data files used for storing persistent messages
|
|
||||||
* `log`: holds rotating log files
|
|
||||||
* `tmp`: holds temporary files that are safe to delete between broker runs
|
|
||||||
|
|
||||||
At this point you may want to adjust the default configuration located in
|
|
||||||
the `etc` directory.
|
|
||||||
|
|
||||||
Environment variables are used to provide ease of changing ports, hosts and
|
|
||||||
data directories used and can be found in `etc/activemq.profile` on linux and
|
|
||||||
`etc\activemq.profile.cmd` on Windows.
|
|
||||||
|
|
||||||
Starting and Stopping a Broker Instance
|
|
||||||
=======================================
|
|
||||||
|
|
||||||
Assuming you created the broker instance under `/var/lib/mybroker` all you need
|
|
||||||
to do start running the broker instance is execute:
|
|
||||||
|
|
||||||
/var/lib/mybroker/bin/activemq run
|
|
||||||
|
|
||||||
Now that the broker is running, you can optionally run some of the included
|
|
||||||
examples to verify the the broker is running properly.
|
|
||||||
|
|
||||||
To stop the Apache ActiveMQ Artemis instance you will use the same `activemq` script, but with
|
|
||||||
the `stop argument`. Example:
|
|
||||||
|
|
||||||
/var/lib/mybroker/bin/activemq stop
|
|
||||||
|
|
||||||
By default the `etc/bootstrap.xml` configuration is
|
|
||||||
used. The configuration can be changed e.g. by running
|
|
||||||
`./activemq run -- xml:path/to/bootstrap.xml` or another
|
|
||||||
config of your choosing.
|
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
* [Legal Notice](notice.md)
|
* [Legal Notice](notice.md)
|
||||||
* [Preface](preface.md)
|
* [Preface](preface.md)
|
||||||
* [Project Info](project-info.md)
|
* [Project Info](project-info.md)
|
||||||
|
* [Running the Server](running-server.md)
|
||||||
* [Messaging Concepts](messaging-concepts.md)
|
* [Messaging Concepts](messaging-concepts.md)
|
||||||
* [Architecture](architecture.md)
|
* [Architecture](architecture.md)
|
||||||
* [Using the Server](using-server.md)
|
* [Using the Server](using-server.md)
|
||||||
|
|
|
@ -0,0 +1,246 @@
|
||||||
|
Prerequisites
|
||||||
|
=============
|
||||||
|
|
||||||
|
> **Note**
|
||||||
|
>
|
||||||
|
> ActiveMQ Artemis only runs on Java 7 or later.
|
||||||
|
|
||||||
|
By default, ActiveMQ Artemis server runs with 1GiB of memory. If your computer
|
||||||
|
has less memory, or you want to run it with more available RAM, modify
|
||||||
|
the value in `bin/run.sh` accordingly.
|
||||||
|
|
||||||
|
If you are on Linux you may want to enable libaio For persistence,
|
||||||
|
ActiveMQ Artemis uses its own fast journal, which you can
|
||||||
|
configure to use libaio (which is the default when running on Linux) or
|
||||||
|
Java NIO. In order to use the libaio module on Linux, you'll need to
|
||||||
|
install libaio, if it's not already installed.
|
||||||
|
|
||||||
|
If you're not running on Linux then you don't need to worry about this.
|
||||||
|
|
||||||
|
You can install libaio using the following steps as the root user:
|
||||||
|
|
||||||
|
Using yum, (e.g. on Fedora or Red Hat Enterprise Linux):
|
||||||
|
|
||||||
|
yum install libaio
|
||||||
|
|
||||||
|
Using aptitude, (e.g. on Ubuntu or Debian system):
|
||||||
|
|
||||||
|
apt-get install libaio
|
||||||
|
|
||||||
|
Installation
|
||||||
|
============
|
||||||
|
|
||||||
|
After downloading the distribution, the following highlights some important folders on the distribution:
|
||||||
|
|
||||||
|
|___ bin
|
||||||
|
|
|
||||||
|
|___ web
|
||||||
|
| |___ user-manual
|
||||||
|
| |___ api
|
||||||
|
|
|
||||||
|
|___ examples
|
||||||
|
| |___ core
|
||||||
|
| |___ javaee
|
||||||
|
| |___ jms
|
||||||
|
|
|
||||||
|
|___ lib
|
||||||
|
|
|
||||||
|
|___ schema
|
||||||
|
|
||||||
|
|
||||||
|
- `bin` -- binaries and scripts needed to run ActiveMQ Artemis.
|
||||||
|
|
||||||
|
- `web` -- The folder where the web context is loaded when ActiveMQ Artemis runs.
|
||||||
|
|
||||||
|
- `user-manual` -- The user manual is placed under the web folder.
|
||||||
|
|
||||||
|
- `api` -- The api documentation is placed under the web folder
|
||||||
|
|
||||||
|
- `examples` -- JMS and Java EE examples. Please refer to the 'running
|
||||||
|
examples' chapter for details on how to run them.
|
||||||
|
|
||||||
|
- `lib` -- jars and libraries needed to run ActiveMQ Artemis
|
||||||
|
|
||||||
|
- `licenses` -- licenses for ActiveMQ Artemis
|
||||||
|
|
||||||
|
- `schemas` -- XML Schemas used to validate ActiveMQ Artemis configuration
|
||||||
|
files
|
||||||
|
|
||||||
|
Creating a Broker Instance
|
||||||
|
==========================
|
||||||
|
|
||||||
|
|
||||||
|
A broker instance is the directory containing all the configuration and runtime
|
||||||
|
data, such as logs and data files, associated with a broker process. It is recommended that
|
||||||
|
you do *not* create the instance directory under `${ARTEMIS_HOME}`. This separation is
|
||||||
|
encouraged so that you can more easily upgrade when the next version of ActiveMQ Artemis is released.
|
||||||
|
|
||||||
|
On Unix systems, it is a common convention to store this kind of runtime data under
|
||||||
|
the `/var/lib` directory. For example, to create an instance at '/var/lib/mybroker', run
|
||||||
|
the following commands in your command line shell:
|
||||||
|
|
||||||
|
cd /var/lib
|
||||||
|
${ARTEMIS_HOME}/bin/activemq create mybroker
|
||||||
|
|
||||||
|
A broker instance directory will contain the following sub directories:
|
||||||
|
|
||||||
|
* `bin`: holds execution scripts associated with this instance.
|
||||||
|
* `etc`: hold the instance configuration files
|
||||||
|
* `data`: holds the data files used for storing persistent messages
|
||||||
|
* `log`: holds rotating log files
|
||||||
|
* `tmp`: holds temporary files that are safe to delete between broker runs
|
||||||
|
|
||||||
|
At this point you may want to adjust the default configuration located in
|
||||||
|
the `etc` directory.
|
||||||
|
|
||||||
|
Environment variables are used to provide ease of changing ports, hosts and
|
||||||
|
data directories used and can be found in `etc/activemq.profile` on linux and
|
||||||
|
`etc\activemq.profile.cmd` on Windows.
|
||||||
|
|
||||||
|
|
||||||
|
Options
|
||||||
|
=======
|
||||||
|
|
||||||
|
There are several options you can use when creating an instance.
|
||||||
|
|
||||||
|
For a full list of updated properties always use:
|
||||||
|
|
||||||
|
```
|
||||||
|
$./artemis help create
|
||||||
|
NAME
|
||||||
|
artemis create - creates a new broker instance
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
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-input] [--user <user>] [--]
|
||||||
|
<directory>
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
--allow-anonymous
|
||||||
|
Enables anonymous configuration on security (Default: input)
|
||||||
|
|
||||||
|
--cluster-password <clusterPassword>
|
||||||
|
The cluster password to use for clustering. (Default: input)
|
||||||
|
|
||||||
|
--cluster-user <clusterUser>
|
||||||
|
The cluster user to use for clustering. (Default: input)
|
||||||
|
|
||||||
|
--clustered
|
||||||
|
Enable clustering
|
||||||
|
|
||||||
|
--data <data>
|
||||||
|
Directory where ActiveMQ Data is used. Path are relative to
|
||||||
|
artemis.instance/bin
|
||||||
|
|
||||||
|
--encoding <encoding>
|
||||||
|
The encoding that text files should use
|
||||||
|
|
||||||
|
--force
|
||||||
|
Overwrite configuration at destination directory
|
||||||
|
|
||||||
|
--home <home>
|
||||||
|
Directory where ActiveMQ Artemis is installed
|
||||||
|
|
||||||
|
--host <host>
|
||||||
|
The host name of the broker (Default: 0.0.0.0 or input if clustered)
|
||||||
|
|
||||||
|
--java-options <javaOptions>
|
||||||
|
Extra java options to be passed to the profile
|
||||||
|
|
||||||
|
--password <password>
|
||||||
|
The user's password (Default: input)
|
||||||
|
|
||||||
|
--port-offset <portOffset>
|
||||||
|
Off sets the default ports
|
||||||
|
|
||||||
|
--replicated
|
||||||
|
Enable broker replication
|
||||||
|
|
||||||
|
--role <role>
|
||||||
|
The name for the role created (Default: amq)
|
||||||
|
|
||||||
|
--shared-store
|
||||||
|
Enable broker shared store
|
||||||
|
|
||||||
|
--silent-input
|
||||||
|
It will disable all the inputs, and it would make a best guess for
|
||||||
|
any required input
|
||||||
|
|
||||||
|
--user <user>
|
||||||
|
The username (Default: input)
|
||||||
|
|
||||||
|
--
|
||||||
|
This option can be used to separate command-line options from the
|
||||||
|
list of argument, (useful when arguments might be mistaken for
|
||||||
|
command-line options
|
||||||
|
|
||||||
|
<directory>
|
||||||
|
The instance directory to hold the broker's configuration and data
|
||||||
|
```
|
||||||
|
|
||||||
|
Some of these properties may be mandatory in certain configurations and the system may ask you for additional input.
|
||||||
|
|
||||||
|
```
|
||||||
|
./artemis create /usr/server
|
||||||
|
Creating ActiveMQ Artemis instance at: /user/server
|
||||||
|
|
||||||
|
--user: is mandatory with this configuration:
|
||||||
|
Please provide the default username:
|
||||||
|
admin
|
||||||
|
|
||||||
|
--password: is mandatory with this configuration:
|
||||||
|
Please provide the default password:
|
||||||
|
|
||||||
|
|
||||||
|
--allow-anonymous: is mandatory with this configuration:
|
||||||
|
Allow anonymous access? (Y/N):
|
||||||
|
y
|
||||||
|
|
||||||
|
You can now start the broker by executing:
|
||||||
|
|
||||||
|
"/user/server/bin/artemis" run
|
||||||
|
|
||||||
|
Or you can run the broker in the background using:
|
||||||
|
|
||||||
|
"/user/server/bin/artemis-service" start
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Starting and Stopping a Broker Instance
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
Assuming you created the broker instance under `/var/lib/mybroker` all you need
|
||||||
|
to do start running the broker instance is execute:
|
||||||
|
|
||||||
|
/var/lib/mybroker/bin/activemq run
|
||||||
|
|
||||||
|
Now that the broker is running, you can optionally run some of the included
|
||||||
|
examples to verify the the broker is running properly.
|
||||||
|
|
||||||
|
To stop the Apache ActiveMQ Artemis instance you will use the same `activemq` script, but with
|
||||||
|
the `stop argument`. Example:
|
||||||
|
|
||||||
|
/var/lib/mybroker/bin/activemq stop
|
||||||
|
|
||||||
|
By default the `etc/bootstrap.xml` configuration is
|
||||||
|
used. The configuration can be changed e.g. by running
|
||||||
|
`./activemq run -- xml:path/to/bootstrap.xml` or another
|
||||||
|
config of your choosing.
|
||||||
|
|
||||||
|
|
||||||
|
Windows Server
|
||||||
|
==============
|
||||||
|
|
||||||
|
On windows you will have the option to run ActiveMQ Artemis as a service.
|
||||||
|
Just use the following command to install it:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ ./artemis-service.exe install
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
The create process should give you a hint of the available commands available for the artemis-service.exe
|
Loading…
Reference in New Issue