ARTEMIS-178 Refactor examples to use CLI

This is changing the examples to run the real servers.
The maven plugin should be an automation of the CLI
Where we run real servers instead of any embedded framework

Going forward we will need to remove the common examples.
Failover examples will be able to use Process Builders
This commit is contained in:
Clebert Suconic 2015-05-12 17:59:02 -04:00 committed by jbertram
parent c8d053ede8
commit b3af4bb777
242 changed files with 2482 additions and 8739 deletions

View File

@ -19,6 +19,7 @@ package org.apache.activemq.artemis.cli;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import io.airlift.airline.Cli;
import org.apache.activemq.artemis.cli.commands.Action;
@ -70,6 +71,11 @@ public class Artemis
return execute(null, null, args);
}
public static Object execute(File artemisHome, File artemisInstance, List<String> args) throws Exception
{
return execute(artemisHome, artemisInstance, (String[]) args.toArray(new String[args.size()]));
}
public static Object execute(File artemisHome, File artemisInstance, String... args) throws Exception
{
Action action = builder(artemisInstance).build().parse(args);

View File

@ -118,6 +118,9 @@ public class Create extends InputAbstract
@Option(name = "--shared-store", description = "Enable broker shared store")
boolean sharedStore = false;
@Option(name = "--slave", description = "Valid for shared store or replication: this is a slave server?")
boolean slave;
@Option(name = "--cluster-user", description = "The cluster user to use for clustering. (Default: input)")
String clusterUser = null;
@ -411,6 +414,26 @@ public class Create extends InputAbstract
this.role = role;
}
public boolean isSlave()
{
return slave;
}
public void setSlave(boolean slave)
{
this.slave = slave;
}
public Boolean getAllowAnonymous()
{
return allowAnonymous;
}
public void setAllowAnonymous(Boolean allowAnonymous)
{
this.allowAnonymous = allowAnonymous;
}
@Override
public Object execute(ActionContext context) throws Exception
{
@ -469,10 +492,12 @@ public class Create extends InputAbstract
HashMap<String, String> filters = new HashMap<String, String>();
filters.put("${master-slave}", isSlave() ? "slave" : "master");
if (replicated)
{
clustered = true;
filters.put("${replicated.settings}", readTextFile(ETC_REPLICATED_SETTINGS_TXT));
filters.put("${replicated.settings}", applyFilters(readTextFile(ETC_REPLICATED_SETTINGS_TXT), filters));
}
else
{
@ -482,7 +507,7 @@ public class Create extends InputAbstract
if (sharedStore)
{
clustered = true;
filters.put("${shared-store.settings}", readTextFile(ETC_SHARED_STORE_SETTINGS_TXT));
filters.put("${shared-store.settings}", applyFilters(readTextFile(ETC_SHARED_STORE_SETTINGS_TXT), filters));
}
else
{

View File

@ -164,6 +164,8 @@ public class Run extends Configurable
}
finally
{
System.out.println("Server stopped!");
System.out.flush();
latchRunning.countDown();
if (!embedded)
{

View File

@ -0,0 +1,192 @@
/*
* 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.process;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import org.apache.activemq.artemis.utils.ConcurrentHashSet;
public class ProcessBuilder
{
static ConcurrentHashSet<Process> processes = new ConcurrentHashSet<>();
static
{
Runtime.getRuntime().addShutdownHook(new Thread()
{
public void run()
{
for (Process p : processes)
{
if (p.isAlive())
{
p.destroy();
}
}
}
});
}
/**
* it will lookup for process that are dead already, eliminating leaks.
*/
public static void cleanupProcess()
{
for (Process p: processes)
{
if (!p.isAlive())
{
processes.remove(p);
}
}
}
/**
* *
* @param logname the prefix for log output
* @param location The location where this command is being executed from
* @param hook it will finish the process upon shutdown of the VM
* @param args The arguments being passwed to the the CLI tool
* @return
* @throws Exception
*/
public static Process build(String logname, File location, boolean hook, String... args) throws Exception
{
boolean IS_WINDOWS = System.getProperty("os.name").toLowerCase().trim().startsWith("win");
String[] newArgs;
if (IS_WINDOWS)
{
newArgs = rebuildArgs(args, "cmd", "/c", "artemis.cmd");
}
else
{
newArgs = rebuildArgs(args, "./artemis");
}
java.lang.ProcessBuilder builder = new java.lang.ProcessBuilder(newArgs);
builder.directory(new File(location, "bin"));
Process process = builder.start();
ProcessLogger outputLogger = new ProcessLogger(true,
process.getInputStream(),
logname + "::Out",
false);
outputLogger.start();
// Adding a reader to System.err, so the VM won't hang on a System.err.println as identified on this forum thread:
ProcessLogger errorLogger = new ProcessLogger(true,
process.getErrorStream(),
logname + "::Err",
true);
errorLogger.start();
processes.add(process);
cleanupProcess();
return process;
}
public static String[] rebuildArgs(String[] args, String ... prefixArgs)
{
String[] resultArgs = new String[args.length + prefixArgs.length];
int i = 0;
for (String arg: prefixArgs)
{
resultArgs[i++] = arg;
}
for (String arg: args)
{
resultArgs[i++] = arg;
}
return resultArgs;
}
/**
* Redirect the input stream to a logger (as debug logs)
*/
static class ProcessLogger extends Thread
{
private final InputStream is;
private final String logName;
private final boolean print;
private final boolean sendToErr;
boolean failed = false;
ProcessLogger(final boolean print,
final InputStream is,
final String logName,
final boolean sendToErr) throws ClassNotFoundException
{
this.is = is;
this.print = print;
this.logName = logName;
this.sendToErr = sendToErr;
setDaemon(false);
}
@Override
public void run()
{
try
{
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
while ((line = br.readLine()) != null)
{
if (print)
{
if (sendToErr)
{
System.err.println(logName + " err:" + line);
}
else
{
System.out.println(logName + " out:" + line);
}
}
}
}
catch (IOException e)
{
// ok, stream closed
}
}
}
}

View File

@ -14,9 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.maven;
public interface ActiveMQClient
{
void run();
}
/** Contains useful classes for spawning process from client classes */
package org.apache.activemq.artemis.cli.process;

View File

@ -1,6 +1,6 @@
<ha-policy>
<replication>
<master/>
<${master-slave}/>
</replication>
</ha-policy>

View File

@ -1,6 +1,6 @@
<ha-policy>
<shared-store>
<master/>
<${master-slave}/>
</shared-store>
</ha-policy>

View File

@ -105,4 +105,4 @@ exec "$JAVACMD" $JAVA_ARGS $ARTEMIS_CLUSTER_PROPS \
-Dartemis.home="$ARTEMIS_HOME" \
-Djava.library.path="$ARTEMIS_HOME/bin/lib/linux-i686:$ARTEMIS_HOME/bin/lib/linux-x86_64" \
$DEBUG_ARGS \
org.apache.activemq.artemis.boot.Artemis $@
org.apache.activemq.artemis.boot.Artemis "$@"

View File

@ -42,6 +42,16 @@
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-api</artifactId>
<version>1.0.2.v20150114</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-util</artifactId>
<version>1.0.2.v20150114</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
@ -52,6 +62,16 @@
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-boot</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-cli</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>

View File

@ -16,30 +16,27 @@
*/
package org.apache.activemq.artemis.maven;
import java.lang.reflect.Method;
import java.util.Properties;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import java.lang.reflect.Method;
import java.util.Properties;
/**
* Allows a Java Client to be run which must hve a static main(String[] args) method
* Allows a Java Client to be run which must hve a static main(String[] args) method
*/
@Mojo(name = "runClient", defaultPhase = LifecyclePhase.VERIFY)
public class ActiveMQClientPlugin extends AbstractMojo
{
/**
* @parameter
*/
@Parameter
String clientClass;
/**
* @parameter
*/
@Parameter
String[] args;
/**
@ -61,7 +58,7 @@ public class ActiveMQClientPlugin extends AbstractMojo
}
catch (Exception e)
{
e.printStackTrace();
getLog().error(e);
throw new MojoFailureException(e.getMessage());
}
}

View File

@ -0,0 +1,331 @@
/**
* 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.maven;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.activemq.artemis.cli.Artemis;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactRequest;
import org.eclipse.aether.resolution.ArtifactResolutionException;
import org.eclipse.aether.resolution.ArtifactResult;
@Mojo(name = "create", defaultPhase = LifecyclePhase.VERIFY)
public class ActiveMQCreatePlugin extends AbstractMojo
{
@Parameter
String name;
/**
* The plugin descriptor
*/
private PluginDescriptor descriptor;
@Parameter(defaultValue = "${basedir}/target/classes/activemq/server0", required = true)
private File configuration;
@Parameter(defaultValue = "${activemq.basedir}", required = true)
private File home;
@Parameter(defaultValue = "${activemq.basedir}/artemis-distribution/target/apache-artemis-${project.version}-bin/apache-artemis-${project.version}/", required = true)
private File alternateHome;
@Parameter(defaultValue = "${basedir}/target/server0", required = true)
private File instance;
@Parameter(defaultValue = "true")
private boolean noWeb;
@Parameter(defaultValue = "guest")
private String user;
@Parameter(defaultValue = "guest")
private String password;
@Parameter(defaultValue = "guest")
private String role;
@Parameter(defaultValue = "")
private String javaOptions = "";
@Parameter(defaultValue = "0")
private int portOffset = 0;
@Parameter(defaultValue = "true")
private boolean allowAnonymous;
@Parameter(defaultValue = "false")
private boolean replicated;
@Parameter(defaultValue = "false")
private boolean sharedStore;
@Parameter(defaultValue = "true")
private boolean clustered;
@Parameter(defaultValue = "false")
private boolean slave;
@Parameter(defaultValue = "../data")
String dataFolder;
@Component
private RepositorySystem repositorySystem;
@Parameter(defaultValue = "${repositorySystemSession}")
private RepositorySystemSession repoSession;
@Parameter(defaultValue = "${project.remoteProjectRepositories}")
private List<RemoteRepository> remoteRepos;
@Parameter
private String[] libList;
@Parameter(defaultValue = "${localRepository}")
private org.apache.maven.artifact.repository.ArtifactRepository localRepository;
/**
* Validate if the directory is a artemis.home *
*
* @param path
* @return
*/
private boolean lookupHome(Path path)
{
if (path == null)
{
return false;
}
Path binFolder = path.resolve("bin");
if (binFolder == null && Files.exists(binFolder, LinkOption.NOFOLLOW_LINKS))
{
return false;
}
Path artemisScript = binFolder.resolve("artemis");
return artemisScript != null && Files.exists(artemisScript, LinkOption.NOFOLLOW_LINKS);
}
private void add(List<String> list, String ... str)
{
for (String s: str)
{
list.add(s);
}
}
public void execute() throws MojoExecutionException, MojoFailureException
{
getLog().info("Local " + localRepository);
MavenProject project = (MavenProject) getPluginContext().get("project");
if (!lookupHome(home.toPath()))
{
if (lookupHome(alternateHome.toPath()))
{
home = alternateHome;
}
else
{
getLog().error("********************************************************************************************");
getLog().error("Could not locate suitable Artemis.home on either " + home + " or " + alternateHome);
getLog().error("Use the binary distribution or build the distribution before running the examples");
getLog().error("********************************************************************************************");
throw new MojoExecutionException("Couldn't find artemis.home");
}
}
Map properties = getPluginContext();
Set<Map.Entry> entries = properties.entrySet();
getLog().info("Entries.size " + entries.size());
for (Map.Entry entry : entries)
{
getLog().info("... key=" + entry.getKey() + " = " + entry.getValue());
}
ArrayList<String> listCommands = new ArrayList<>();
add(listCommands, "create", "--allow-anonymous", "--silent-input", "--force", "--no-web", "--user", user, "--password", password,
"--role", role,
"--port-offset", "" + portOffset,
"--data", dataFolder);
if (allowAnonymous)
{
add(listCommands, "--allow-anonymous");
}
else
{
add(listCommands, "--require-login");
}
if (!javaOptions.isEmpty())
{
add(listCommands, "--java-options", javaOptions);
}
if (slave)
{
add(listCommands, "--slave");
}
if (replicated)
{
add(listCommands, "--replicated");
}
if (replicated)
{
add(listCommands, "--shared-store");
}
if (replicated)
{
add(listCommands, "--shared-store");
}
if (clustered)
{
add(listCommands, "--clustered");
}
add(listCommands, "--verbose");
add(listCommands, instance.getAbsolutePath());
getLog().info("************************************************");
getLog().info("Calling create server at " + instance + " home= " + home);
try
{
Artemis.execute(home, null, listCommands);
String[] list = configuration.list();
if (list != null)
{
getLog().debug("************************************************");
getLog().debug("Replacing configuration files:");
for (String file : configuration.list())
{
Path target = instance.toPath().resolve("etc").resolve(file);
getLog().debug("Replacing " + file + " into " + target);
Files.copy(configuration.toPath().resolve(file), target, StandardCopyOption.REPLACE_EXISTING);
}
}
File projectLib = project.getArtifact().getFile();
copyToLib(projectLib);
if (libList != null)
{
for (int i = 0; i < libList.length; i++)
{
String[] splitString = libList[i].split(":");
getLog().debug("********************" + splitString[0] + "/" + splitString[1] + "/" + splitString[2]);
Artifact artifact;
try
{
artifact = new DefaultArtifact( libList[i] );
}
catch ( IllegalArgumentException e )
{
throw new MojoFailureException( e.getMessage(), e );
}
ArtifactRequest request = new ArtifactRequest();
request.setArtifact( artifact );
request.setRepositories( remoteRepos );
getLog().debug("Resolving artifact " + artifact + " from " + remoteRepos);
ArtifactResult result;
try
{
result = repositorySystem.resolveArtifact( repoSession, request );
}
catch ( ArtifactResolutionException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
File artifactFile = result.getArtifact().getFile();
getLog().debug("Artifact:: " + artifact + " file = " + artifactFile);
copyToLib(artifactFile);
}
}
}
catch (Exception e)
{
getLog().error(e);
throw new MojoFailureException(e.getMessage());
}
}
private void copyToLib(File projectLib) throws IOException
{
Path target = instance.toPath().resolve("lib").resolve(projectLib.getName());
target.toFile().mkdirs();
getLog().debug("Copying " + projectLib.getName() + " as " + target.toFile().getAbsolutePath());
Files.copy(projectLib.toPath(), target, StandardCopyOption.REPLACE_EXISTING);
}
}

View File

@ -1,230 +0,0 @@
/*
* 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.maven;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import java.io.File;
import java.lang.management.ManagementFactory;
import java.util.Arrays;
import java.util.Properties;
import org.apache.activemq.artemis.server.ActiveMQBootstrap;
import org.apache.activemq.artemis.server.SpawnedActiveMQBootstrap;
import org.apache.activemq.artemis.server.SpawnedVMSupport;
import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.codehaus.classworlds.ClassRealm;
import org.codehaus.classworlds.ClassWorld;
@Mojo(name = "start", defaultPhase = LifecyclePhase.VERIFY)
public class ActiveMQStartPlugin extends AbstractMojo
{
static final String SKIPBROKERSTART = "skipBrokerStart";
/**
* The plugin descriptor
*/
private PluginDescriptor descriptor;
/**
* @parameter default-value=false
*/
private Boolean waitOnStart;
/**
* @parameter
*/
private String configurationDir;
/**
* @parameter
*/
private String nodeId;
/**
* @parameter default-value=false;
*/
private Boolean fork;
/**
* @parameter default-value=false
*/
private Boolean debug;
/**
* @parameter
*/
private Properties systemProperties;
/**
* @parameter default-value=STARTED::
*/
private String serverStartString;
/**
* @parameter
*/
private ActiveMQSecurityManager securityManager;
/**
* registers a TestClusterMBean for test clients to use.
*/
private boolean testClusterManager;
public void execute() throws MojoExecutionException, MojoFailureException
{
String property = System.getProperty(SKIPBROKERSTART);
if (property != null)
{
getLog().info("skipping Broker Start");
return;
}
if (testClusterManager)
{
try
{
createClusterManagerMBean();
}
catch (Exception e)
{
throw new MojoExecutionException("Failed to create cluster manager mbean", e);
}
}
if (systemProperties != null && !systemProperties.isEmpty())
{
System.getProperties()
.putAll(systemProperties);
}
String workingPath = new File(".").getAbsolutePath();
try
{
registerNode(nodeId, workingPath, configurationDir);
}
catch (Exception e1)
{
throw new MojoExecutionException("Failed to create cluster manager mbean", e1);
}
if (fork)
{
try
{
PluginDescriptor pd = (PluginDescriptor) getPluginContext().get("pluginDescriptor");
final Process p = SpawnedVMSupport.spawnVM(pd.getArtifacts(),
"ActiveMQServer_" + (nodeId != null ? nodeId : ""),
SpawnedActiveMQBootstrap.class.getName(),
systemProperties,
true,
serverStartString,
"FAILED::",
".",
configurationDir,
debug,
configurationDir,
"" + waitOnStart,
nodeId);
Runtime.getRuntime().addShutdownHook(new Thread()
{
@Override
public void run()
{
//just to be on the safe side
p.destroy();
}
});
if (waitOnStart)
{
p.waitFor();
}
}
catch (Throwable e)
{
e.printStackTrace();
throw new MojoExecutionException(e.getMessage());
}
}
else
{
ActiveMQBootstrap bootstrap = new ActiveMQBootstrap(configurationDir, waitOnStart, nodeId, securityManager);
if (configurationDir != null)
{
extendPluginClasspath(configurationDir);
}
try
{
bootstrap.execute();
}
catch (Exception e)
{
throw new MojoExecutionException(e.getMessage(), e);
}
}
}
private void registerNode(String nodeId, String workingPath,
String hornetqConfigurationDir) throws Exception
{
TestClusterManagerMBean control = PluginUtil.getTestClusterManager();
if (control != null)
{
control.registerNode(nodeId, workingPath, hornetqConfigurationDir);
}
}
private void createClusterManagerMBean() throws Exception
{
MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
ObjectName name = ObjectName.getInstance("hornetq:module=test,type=TestClusterManager");
mbeanServer.registerMBean(new TestClusterManager(), name);
}
public void extendPluginClasspath(String element) throws MojoExecutionException
{
ClassWorld world = new ClassWorld();
ClassRealm realm;
try
{
realm = world.newRealm(
"maven.plugin." + getClass().getSimpleName() + ((nodeId == null) ? "" : nodeId),
Thread.currentThread()
.getContextClassLoader()
);
File elementFile = new File(element);
getLog().debug("Adding element to plugin classpath" + elementFile.getPath());
realm.addConstituent(elementFile.toURI()
.toURL());
}
catch (Exception ex)
{
throw new MojoExecutionException(ex.toString(), ex);
}
System.out.println(Arrays.toString(realm.getConstituents()));
Thread.currentThread()
.setContextClassLoader(realm.getClassLoader());
}
}

View File

@ -1,76 +0,0 @@
/*
* 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.maven;
import java.io.File;
import java.io.IOException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
@Mojo(name = "stop", defaultPhase = LifecyclePhase.VERIFY)
public class ActiveMQStopPlugin extends AbstractMojo
{
/**
* @parameter
*/
private String configurationDir;
public void execute() throws MojoExecutionException, MojoFailureException
{
String property = System.getProperty(ActiveMQStartPlugin.SKIPBROKERSTART);
if (property != null)
{
return;
}
try
{
String dirName = configurationDir != null ? configurationDir : ".";
final File file = new File(dirName + "/" + "/STOP_ME");
file.createNewFile();
long time = System.currentTimeMillis();
while (System.currentTimeMillis() < time + 60000)
{
if (!file.exists())
{
break;
}
try
{
Thread.sleep(200);
}
catch (InterruptedException e)
{
//ignore
}
}
if (file.exists())
{
throw new MojoExecutionException("looks like the server hasn't been stopped");
}
}
catch (IOException e)
{
e.printStackTrace();
throw new MojoExecutionException(e.getMessage());
}
}
}

View File

@ -0,0 +1,172 @@
/**
* 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.maven;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;
import java.util.Map;
import org.apache.activemq.artemis.cli.Artemis;
import org.apache.activemq.artemis.cli.commands.Run;
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
@Mojo(name = "cli", defaultPhase = LifecyclePhase.VERIFY)
public class ArtemisCLIPlugin extends AbstractMojo
{
@Parameter
String name;
/**
* The plugin descriptor
*/
private PluginDescriptor descriptor;
@Parameter(defaultValue = "${activemq.basedir}", required = true)
private File home;
@Parameter(defaultValue = "${activemq.basedir}/artemis-distribution/target/apache-artemis-${project.version}-bin/apache-artemis-${project.version}/", required = true)
private File alternateHome;
@Parameter(defaultValue = "${basedir}/target/server0", required = true)
private File location;
@Parameter
private String[] args;
@Parameter
private boolean spawn = false;
@Parameter
private boolean testServer;
/**
* Validate if the directory is a artemis.home *
*
* @param path
* @return
*/
private boolean lookupHome(Path path)
{
if (path == null)
{
return false;
}
Path binFolder = path.resolve("bin");
if (binFolder == null && Files.exists(binFolder, LinkOption.NOFOLLOW_LINKS))
{
return false;
}
Path artemisScript = binFolder.resolve("artemis");
return artemisScript != null && Files.exists(artemisScript, LinkOption.NOFOLLOW_LINKS);
}
public void execute() throws MojoExecutionException, MojoFailureException
{
// This is to avoid the Run issuing a kill at any point
Run.setEmbedded(true);
MavenProject project = (MavenProject) getPluginContext().get("project");
if (!lookupHome(home.toPath()))
{
if (lookupHome(alternateHome.toPath()))
{
home = alternateHome;
}
else
{
getLog().error("********************************************************************************************");
getLog().error("Could not locate suitable Artemis.home on either " + home + " or " + alternateHome);
getLog().error("Use the binary distribution or build the distribution before running the examples");
getLog().error("********************************************************************************************");
throw new MojoExecutionException("Couldn't find artemis.home");
}
}
Map properties = getPluginContext();
try
{
if (spawn)
{
final Process process = org.apache.activemq.artemis.cli.process.ProcessBuilder.build("server", location, true, args);
Runtime.getRuntime().addShutdownHook(new Thread()
{
public void run()
{
process.destroy();
}
});
if (testServer)
{
for (int tryNr = 0; tryNr < 20; tryNr++)
{
try
{
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
cf.createConnection().close();
getLog().info("Server started");
}
catch (Exception e)
{
getLog().info("awaiting server to start");
Thread.sleep(500);
continue;
}
break;
}
}
}
else
{
Artemis.execute(home, location, args);
}
Thread.sleep(600);
org.apache.activemq.artemis.cli.process.ProcessBuilder.cleanupProcess();
}
catch (Exception e)
{
throw new MojoExecutionException(e.getMessage(), e);
}
}
}

View File

@ -1,75 +0,0 @@
/*
* 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.maven;
import javax.management.MBeanServer;
import java.io.File;
import org.apache.activemq.artemis.core.config.Configuration;
import org.apache.activemq.artemis.core.server.NodeManager;
import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
public final class InVMNodeManagerServer extends ActiveMQServerImpl
{
final NodeManager nodeManager;
public InVMNodeManagerServer(final NodeManager nodeManager)
{
super();
this.nodeManager = nodeManager;
}
public InVMNodeManagerServer(final Configuration configuration, final NodeManager nodeManager)
{
super(configuration);
this.nodeManager = nodeManager;
}
public InVMNodeManagerServer(final Configuration configuration,
final MBeanServer mbeanServer,
final NodeManager nodeManager)
{
super(configuration, mbeanServer);
this.nodeManager = nodeManager;
}
public InVMNodeManagerServer(final Configuration configuration,
final ActiveMQSecurityManager securityManager,
final NodeManager nodeManager)
{
super(configuration, securityManager);
this.nodeManager = nodeManager;
}
public InVMNodeManagerServer(final Configuration configuration,
final MBeanServer mbeanServer,
final ActiveMQSecurityManager securityManager,
final NodeManager nodeManager)
{
super(configuration, mbeanServer, securityManager);
this.nodeManager = nodeManager;
}
@Override
protected NodeManager createNodeManager(final File directory, boolean replicatingBackup)
{
return nodeManager;
}
}

View File

@ -0,0 +1,147 @@
/**
* 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.maven;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.List;
import java.util.Map;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactRequest;
import org.eclipse.aether.resolution.ArtifactResolutionException;
import org.eclipse.aether.resolution.ArtifactResult;
@Mojo(name = "lib-install", defaultPhase = LifecyclePhase.VERIFY)
public class LibInstallPlugin extends AbstractMojo
{
@Parameter
String name;
/**
* The plugin descriptor
*/
private PluginDescriptor descriptor;
@Parameter(defaultValue = "${basedir}/target/server0", required = true)
private File instance;
@Component
private RepositorySystem repositorySystem;
@Parameter(defaultValue = "${repositorySystemSession}")
private RepositorySystemSession repoSession;
@Parameter(defaultValue = "${project.remoteProjectRepositories}")
private List<RemoteRepository> remoteRepos;
@Parameter
private String[] libList;
@Parameter(defaultValue = "${localRepository}")
private org.apache.maven.artifact.repository.ArtifactRepository localRepository;
public void execute() throws MojoExecutionException, MojoFailureException
{
MavenProject project = (MavenProject) getPluginContext().get("project");
Map properties = getPluginContext();
try
{
File projectLib = project.getArtifact().getFile();
copyToLib(projectLib);
if (libList != null)
{
for (int i = 0; i < libList.length; i++)
{
String[] splitString = libList[i].split(":");
getLog().info("********************" + splitString[0] + "/" + splitString[1] + "/" + splitString[2]);
Artifact artifact;
try
{
artifact = new DefaultArtifact(libList[i]);
}
catch (IllegalArgumentException e)
{
throw new MojoFailureException(e.getMessage(), e);
}
ArtifactRequest request = new ArtifactRequest();
request.setArtifact(artifact);
request.setRepositories(remoteRepos);
getLog().info("Resolving artifact " + artifact + " from " + remoteRepos);
ArtifactResult result;
try
{
result = repositorySystem.resolveArtifact(repoSession, request);
}
catch (ArtifactResolutionException e)
{
throw new MojoExecutionException(e.getMessage(), e);
}
File artifactFile = result.getArtifact().getFile();
getLog().info("Artifact:: " + artifact + " file = " + artifactFile);
copyToLib(artifactFile);
}
}
}
catch (Exception e)
{
getLog().error(e);
throw new MojoFailureException(e.getMessage());
}
}
private void copyToLib(File projectLib) throws IOException
{
Path target = instance.toPath().resolve("lib").resolve(projectLib.getName());
target.toFile().mkdirs();
getLog().info("Copying " + projectLib.getName() + " as " + target.toFile().getAbsolutePath());
Files.copy(projectLib.toPath(), target, StandardCopyOption.REPLACE_EXISTING);
}
}

View File

@ -1,50 +0,0 @@
/*
* 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.maven;
import javax.management.MBeanServerConnection;
import javax.management.MBeanServerInvocationHandler;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import java.util.HashMap;
public class PluginUtil
{
public static TestClusterManagerMBean getTestClusterManager()
{
final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3000/jmxrmi";
try
{
JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, String>());
ObjectName name = ObjectName.getInstance("activemq:module=test,type=TestClusterManager");
MBeanServerConnection mbsc = connector.getMBeanServerConnection();
TestClusterManagerMBean clusterControl = MBeanServerInvocationHandler.newProxyInstance(mbsc,
name,
TestClusterManagerMBean.class,
false);
clusterControl.getNumNodes();//serves as a validation.
return clusterControl;
}
catch (Exception e)
{
return null;
}
}
}

View File

@ -1,52 +0,0 @@
/*
* 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.maven;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class TestClusterManager implements TestClusterManagerMBean
{
private final List<TestNode> testNodes = new ArrayList<TestNode>();
@Override
public int getNumNodes()
{
synchronized (testNodes)
{
return testNodes.size();
}
}
@Override
public void registerNode(String nodeId, String workingDir,
String hornetqConfigurationDir)
{
synchronized (testNodes)
{
testNodes.add(new TestNode(nodeId, workingDir, hornetqConfigurationDir));
}
}
@Override
public void killNode(int i) throws IOException
{
TestNode node = testNodes.get(i);
node.kill();
}
}

View File

@ -1,49 +0,0 @@
/*
* 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.maven;
import java.io.File;
import java.io.IOException;
public class TestNode
{
String nodeId;
String workingDir;
String configDir;
public TestNode(String nodeId, String workingDir,
String configDir)
{
this.nodeId = nodeId;
this.workingDir = workingDir;
this.configDir = configDir;
}
public void kill() throws IOException
{
File file = new File(configDir, "KILL_ME");
file.createNewFile();
try
{
Thread.sleep(3000);
}
catch (InterruptedException e)
{
}
}
}

View File

@ -1,270 +0,0 @@
/*
* 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.server;
import java.io.File;
import java.lang.management.ManagementFactory;
import java.util.HashMap;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import org.apache.activemq.artemis.core.config.Configuration;
import org.apache.activemq.artemis.core.config.FileDeploymentManager;
import org.apache.activemq.artemis.core.config.HAPolicyConfiguration;
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
import org.apache.activemq.artemis.core.config.impl.FileConfiguration;
import org.apache.activemq.artemis.core.config.impl.FileSecurityConfiguration;
import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.core.server.JournalType;
import org.apache.activemq.artemis.core.server.NodeManager;
import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
import org.apache.activemq.artemis.core.server.impl.InVMNodeManager;
import org.apache.activemq.artemis.jms.server.JMSServerManager;
import org.apache.activemq.artemis.jms.server.config.JMSConfiguration;
import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl;
import org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration;
import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
import org.apache.activemq.artemis.maven.InVMNodeManagerServer;
import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;
/**
* This will bootstrap the HornetQ Server and also the naming server if required
*/
public class ActiveMQBootstrap
{
private final String configurationDir;
private final Boolean waitOnStart;
private final String nodeId;
private static Map<String, NodeManager> managerMap = new HashMap<String, NodeManager>();
private boolean spawned = false;
private ActiveMQServer server;
private Configuration configuration;
private JMSConfiguration jmsFileConfiguration;
private SecurityConfiguration securityConfiguration;
private JMSServerManager manager;
private ActiveMQSecurityManager securityManager;
public ActiveMQBootstrap(String configurationDir, Boolean waitOnStart, String nodeId, ActiveMQSecurityManager securityManager)
{
this.configurationDir = configurationDir;
this.waitOnStart = waitOnStart;
this.nodeId = nodeId;
this.securityManager = securityManager;
}
public ActiveMQBootstrap(String[] args)
{
this.configurationDir = args[0];
this.waitOnStart = Boolean.valueOf(args[1]);
this.nodeId = args[2];
spawned = true;
}
public void execute() throws Exception
{
try
{
if (configurationDir != null)
{
//extendPluginClasspath(configurationDir);
configuration = new FileConfiguration();
File file = new File(new File(configurationDir), "broker.xml");
jmsFileConfiguration = new FileJMSConfiguration();
FileDeploymentManager deploymentManager = new FileDeploymentManager(file.toURI().toString());
deploymentManager.addDeployable((FileConfiguration)configuration);
deploymentManager.addDeployable((FileJMSConfiguration) jmsFileConfiguration);
securityConfiguration = new FileSecurityConfiguration(new File(configurationDir, "artemis-users.properties").toURI().toString(),
new File(configurationDir, "artemis-roles.properties").toURI().toString(),
"guest",
false,
null);
((FileSecurityConfiguration)securityConfiguration).start();
deploymentManager.readConfiguration();
}
else
{
configuration = new ConfigurationImpl();
configuration.setJournalType(JournalType.NIO);
jmsFileConfiguration = new JMSConfigurationImpl();
securityConfiguration = new SecurityConfiguration();
}
createServer(configuration, jmsFileConfiguration);
if (waitOnStart)
{
String dirName = System.getProperty("activemq.config.dir", ".");
final File file = new File(dirName + "/STOP_ME");
if (file.exists())
{
file.delete();
}
while (!file.exists())
{
Thread.sleep(500);
}
manager.stop();
file.delete();
}
else
{
String dirName = configurationDir != null ? configurationDir : ".";
final File stopFile = new File(dirName + "/STOP_ME");
if (stopFile.exists())
{
stopFile.delete();
}
final File killFile = new File(dirName + "/KILL_ME");
if (killFile.exists())
{
killFile.delete();
}
final File restartFile = new File(dirName + "/RESTART_ME");
if (restartFile.exists())
{
restartFile.delete();
}
final Timer timer = new Timer("ActiveMQ Artemis Server Shutdown Timer", false);
timer.scheduleAtFixedRate(new ServerStopTimerTask(stopFile, killFile, restartFile, timer), 500, 500);
}
}
catch (Exception e)
{
e.printStackTrace();
throw new Exception(e.getMessage());
}
}
private void createServer(Configuration configuration, JMSConfiguration jmsFileConfiguration) throws Exception
{
if (nodeId != null && !nodeId.equals("") && !nodeId.equals("null"))
{
InVMNodeManager nodeManager = (InVMNodeManager) managerMap.get(nodeId);
if (nodeManager == null)
{
boolean replicatedBackup = configuration.getHAPolicyConfiguration().getType() == HAPolicyConfiguration.TYPE.REPLICA;
nodeManager = new InVMNodeManager(replicatedBackup, configuration.getJournalLocation());
managerMap.put(nodeId, nodeManager);
}
server = new InVMNodeManagerServer(configuration, ManagementFactory.getPlatformMBeanServer(),
securityManager != null ? securityManager : new ActiveMQSecurityManagerImpl(securityConfiguration), nodeManager);
}
else
{
server = new ActiveMQServerImpl(configuration, ManagementFactory.getPlatformMBeanServer(),
securityManager != null ? securityManager : new ActiveMQSecurityManagerImpl(securityConfiguration));
}
manager = new JMSServerManagerImpl(server, jmsFileConfiguration);
manager.start();
}
private class ServerStopTimerTask extends TimerTask
{
private final File stopFile;
private final Timer timer;
private final File killFile;
private final File restartFile;
public ServerStopTimerTask(File stopFile, File killFile, File restartFile, Timer timer)
{
this.stopFile = stopFile;
this.killFile = killFile;
this.restartFile = restartFile;
this.timer = timer;
}
@Override
public void run()
{
if (stopFile.exists())
{
try
{
timer.cancel();
}
finally
{
try
{
if (manager != null)
{
manager.stop();
manager = null;
}
server = null;
stopFile.delete();
}
catch (Exception e)
{
e.printStackTrace();
}
}
if (spawned)
{
Runtime.getRuntime()
.halt(666);
}
}
else if (killFile.exists())
{
try
{
manager.getActiveMQServer()
.stop(true);
manager.stop();
manager = null;
server = null;
killFile.delete();
}
catch (Exception e)
{
e.printStackTrace();
}
}
else if (restartFile.exists())
{
try
{
createServer(configuration, jmsFileConfiguration);
restartFile.delete();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
}
}

View File

@ -1,38 +0,0 @@
/*
* 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.server;
/**
* This class will be spawned in a new vm and will call the bootstrap
*/
public class SpawnedActiveMQBootstrap
{
public static void main(final String[] args)
{
ActiveMQBootstrap bootstrap;
try
{
bootstrap = new ActiveMQBootstrap(args);
bootstrap.execute();
System.out.println("STARTED::");
}
catch (Throwable e)
{
System.out.println("FAILED::" + e.getMessage());
}
}
}

View File

@ -1,252 +0,0 @@
/*
* 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.server;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.apache.maven.artifact.Artifact;
public class SpawnedVMSupport
{
public static Process spawnVM(List<Artifact> arts,
final String logName,
final String className,
final Properties properties,
final boolean logOutput,
final String success,
final String failure,
final String workDir,
final String configDir,
boolean debug,
final String... args) throws Exception
{
StringBuffer sb = new StringBuffer();
sb.append("java")
.append(' ');
StringBuffer props = new StringBuffer();
if (properties != null)
{
for (Map.Entry<Object, Object> entry : properties.entrySet())
{
props.append("-D")
.append(entry.getKey())
.append("=")
.append(entry.getValue())
.append(" ");
}
}
String vmarg = props.toString();
String osName = System.getProperty("os.name");
osName = (osName != null) ? osName.toLowerCase() : "";
boolean isWindows = osName.contains("win");
if (isWindows)
{
vmarg = vmarg.replaceAll("/", "\\\\");
}
sb.append(vmarg)
.append(" ");
String pathSeparater = System.getProperty("path.separator");
StringBuilder classpath = new StringBuilder();
for (Artifact artifact : arts)
{
classpath.append(artifact.getFile()
.getAbsolutePath())
.append(pathSeparater);
}
classpath.append(configDir)
.append(pathSeparater);
if (isWindows)
{
sb.append("-cp")
.append(" \"")
.append(classpath.toString())
.append("\" ");
}
else
{
sb.append("-cp")
.append(" ")
.append(classpath.toString())
.append(" ");
}
// FIXME - not good to assume path separator
String libPath = "-Djava.library.path=" + System.getProperty("java.library.path", "./native/bin");
if (isWindows)
{
libPath = libPath.replaceAll("/", "\\\\");
libPath = "\"" + libPath + "\"";
}
sb.append("-Djava.library.path=")
.append(libPath)
.append(" ");
if (debug)
{
sb.append("-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 ");
}
sb.append(className)
.append(' ');
for (String arg : args)
{
sb.append(arg)
.append(' ');
}
String commandLine = sb.toString();
//SpawnedVMSupport.log.trace("command line: " + commandLine);
Process process = Runtime.getRuntime()
.exec(commandLine, null, new File(workDir));
//SpawnedVMSupport.log.trace("process: " + process);
CountDownLatch latch = new CountDownLatch(1);
ProcessLogger outputLogger = new ProcessLogger(logOutput,
process.getInputStream(),
logName,
false,
success,
failure,
latch);
outputLogger.start();
// Adding a reader to System.err, so the VM won't hang on a System.err.println as identified on this forum thread:
// http://www.jboss.org/index.html?module=bb&op=viewtopic&t=151815
ProcessLogger errorLogger = new ProcessLogger(true,
process.getErrorStream(),
logName,
true,
success,
failure,
latch);
errorLogger.start();
if (!latch.await(60, TimeUnit.SECONDS))
{
process.destroy();
throw new RuntimeException("Timed out waiting for server to start");
}
if (outputLogger.failed || errorLogger.failed)
{
try
{
process.destroy();
}
catch (Throwable e)
{
}
throw new RuntimeException("server failed to start");
}
return process;
}
/**
* Redirect the input stream to a logger (as debug logs)
*/
static class ProcessLogger extends Thread
{
private final InputStream is;
private final String logName;
private final boolean print;
private final boolean sendToErr;
private final String success;
private final String failure;
private final CountDownLatch latch;
boolean failed = false;
ProcessLogger(final boolean print,
final InputStream is,
final String logName,
final boolean sendToErr,
final String success,
final String failure,
final CountDownLatch latch) throws ClassNotFoundException
{
this.is = is;
this.print = print;
this.logName = logName;
this.sendToErr = sendToErr;
this.success = success;
this.failure = failure;
this.latch = latch;
setDaemon(false);
}
@Override
public void run()
{
try
{
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
while ((line = br.readLine()) != null)
{
if (line.startsWith(success))
{
failed = false;
latch.countDown();
}
else if (line.startsWith(failure))
{
failed = true;
latch.countDown();
}
if (print)
{
if (sendToErr)
{
System.err.println(logName + " err:" + line);
}
else
{
System.out.println(logName + " out:" + line);
}
}
}
}
catch (IOException e)
{
// ok, stream closed
}
}
}
}

View File

@ -31,6 +31,7 @@ under the License.
<endpoint />
<applicationid />
<mastersecret />
<mavenVersion>2.2.1</mavenVersion>
<activemq.basedir>${project.basedir}/../../..</activemq.basedir>
</properties>
@ -40,13 +41,46 @@ under the License.
<dependencies>
<dependency>
<groupId>org.apache.activemq.examples.jms</groupId>
<artifactId>common</artifactId>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-cli</artifactId>
<version>${project.version}</version>
</dependency>
<!-- maven -->
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact-manager</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata</artifactId>
<version>${mavenVersion}</version>
</dependency>
</dependencies>
@ -60,29 +94,39 @@ under the License.
<artifactId>artemis-maven-plugin</artifactId>
<executions>
<execution>
<id>start</id>
<id>create</id>
<goals>
<goal>start</goal>
<goal>create</goal>
<!-- todo add integration layer -->
</goals>
<configuration>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
<property>
<name>endpoint</name>
<value>${endpoint}</value>
</property>
<property>
<name>applicationid</name>
<value>${applicationid}</value>
</property>
<property>
<name>mastersecret</name>
<value>${mastersecret}</value>
</property>
</systemProperties>
<!-- this list was extracted from mvn dependency:tree on integration/aerogear -->
<libList>
<param>org.apache.activemq:artemis-aerogear-integration:${project.version}</param>
<param>org.jboss.aerogear:unifiedpush-java-client:1.0.0</param>
<param>net.iharder:base64:2.3.8</param>
<param>com.fasterxml.jackson.core:jackson-annotations:2.3.0</param>
<param>com.fasterxml.jackson.core:jackson-core:2.3.0</param>
<param>org.jboss.resteasy:resteasy-jackson-provider:2.3.2.Final</param>
<param>org.codehaus.jackson:jackson-core-asl:1.8.5</param>
<param>org.codehaus.jackson:jackson-mapper-asl:1.8.5</param>
<param>org.codehaus.jackson:jackson-jaxrs:1.8.5</param>
<param>org.codehaus.jackson:jackson-xc:1.8.5</param>
</libList>
</configuration>
</execution>
<execution>
<id>start</id>
<goals>
<goal>cli</goal>
</goals>
<configuration>
<spawn>true</spawn>
<testServer>true</testServer>
<!-- this list was extracted from mvn dependency:tree on integration/aerogear -->
<args>
<param>run</param>
</args>
</configuration>
</execution>
<execution>
@ -93,15 +137,20 @@ under the License.
<configuration>
<clientClass>org.apache.activemq.artemis.jms.example.AerogearExample</clientClass>
<args>
<param>tcp://localhost:61616</param>
<param>${basedir}/target/server0</param>
</args>
</configuration>
</execution>
<execution>
<id>stop</id>
<goals>
<goal>stop</goal>
<goal>cli</goal>
</goals>
<configuration>
<args>
<param>stop</param>
</args>
</configuration>
</execution>
</executions>
<dependencies>
@ -110,45 +159,7 @@ under the License.
<artifactId>artemis-jms-aerogear-example</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-aerogear-integration</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
</dependency>
</dependencies>
<configuration>
<waitOnStart>false</waitOnStart>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -19,27 +19,17 @@ package org.apache.activemq.artemis.jms.example;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.InitialContext;
import org.apache.activemq.artemis.common.example.ActiveMQExample;
/**
* A simple JMS Queue example that creates a producer and consumer on a queue and sends then receives a message.
*/
public class AerogearExample extends ActiveMQExample
public class AerogearExample
{
public static void main(final String[] args)
{
new AerogearExample().run(args);
}
@Override
public boolean runExample() throws Exception
public static void main(final String[] args) throws Exception
{
Connection connection = null;
InitialContext initialContext = null;
@ -75,8 +65,6 @@ public class AerogearExample extends ActiveMQExample
System.out.println("now check your mobile app and press enter");
System.in.read();
return true;
}
finally
{

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -29,13 +29,13 @@ under the License.
<core xmlns="urn:activemq:core">
<bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
<bindings-directory>${data.dir:../data}/bindings</bindings-directory>
<journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
<journal-directory>${data.dir:../data}/journal</journal-directory>
<large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
<large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
<paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
<paging-directory>${data.dir:../data}/paging</paging-directory>
<!-- Acceptors -->
<acceptors>
@ -52,7 +52,7 @@ under the License.
<connector-services>
<connector-service name="aerogear-connector">
<factory-class>org.apache.activemq.integration.aerogear.AeroGearConnectorServiceFactory</factory-class>
<factory-class>org.apache.activemq.artemis.integration.aerogear.AeroGearConnectorServiceFactory</factory-class>
<param key="endpoint" value="${endpoint}"/>
<param key="queue" value="jms.queue.exampleQueue"/>
<param key="application-id" value="${applicationid}"/>

View File

@ -57,23 +57,22 @@ under the License.
<artifactId>artemis-maven-plugin</artifactId>
<executions>
<execution>
<id>start0</id>
<id>create</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
<instance>${basedir}/target/server0</instance>
</configuration>
</execution>
<execution>
<id>start1</id>
<id>create2</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
<serverStartString>INFO: AMQ221001</serverStartString>
<fork>true</fork>
<instance>${basedir}/target/server1</instance>
<portOffset>1</portOffset>
</configuration>
</execution>
<execution>
@ -84,33 +83,9 @@ under the License.
<configuration>
<clientClass>org.apache.activemq.artemis.jms.example.ApplicationLayerFailoverExample</clientClass>
<args>
<param>tcp://localhost:61616</param>
<param>tcp://localhost:61617</param>
<param>${basedir}/target/server0</param>
<param>${basedir}/target/server1</param>
</args>
<systemProperties>
<property>
<name>exampleConfigDir</name>
<value>${basedir}/target/classes/activemq</value>
</property>
</systemProperties>
</configuration>
</execution>
<execution>
<id>stop0</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
</configuration>
</execution>
<execution>
<id>stop1</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
</configuration>
</execution>
</executions>
@ -120,41 +95,7 @@ under the License.
<artifactId>artemis-jms-application-layer-failover-example</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
<version>${geronimo.jms.2.spec.version}</version>
</dependency>
</dependencies>
<configuration>
<waitOnStart>false</waitOnStart>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -99,7 +99,11 @@ public class ApplicationLayerFailoverExample extends ActiveMQExample
System.out.println("Killing the server");
killServer(0, 1);
killServer(0);
// this utility method will wait for the server1 to be activated
waitForServerStart(1, 20000);
// Step 6. Wait for the client side to register the failure and reconnect

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,53 +0,0 @@
<?xml version='1.0'?>
<!--
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.
-->
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:activemq"
xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
<jms xmlns="urn:activemq:jms">
</jms>
<core xmlns="urn:activemq:core">
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
</acceptors>
<!-- Other config -->
<security-settings>
<!--security for example queue-->
<security-setting match="jms.queue.exampleQueue">
<permission type="createDurableQueue" roles="guest"/>
<permission type="deleteDurableQueue" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="send" roles="guest"/>
</security-setting>
</security-settings>
<journal-directory>target/data/journal</journal-directory>
<bindings-directory>target/data/bindings</bindings-directory>
<large-messages-directory>target/data/large-messages</large-messages-directory>
</core>
</configuration>

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,56 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
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.
-->
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:activemq"
xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
<jms xmlns="urn:activemq:jms">
<!--the queue used by the example-->
<queue name="exampleQueue"/>
</jms>
<core xmlns="urn:activemq:core">
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
</acceptors>
<!-- Other config -->
<security-settings>
<!--security for example queue-->
<security-setting match="jms.queue.exampleQueue">
<permission type="createDurableQueue" roles="guest"/>
<permission type="deleteDurableQueue" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="send" roles="guest"/>
</security-setting>
</security-settings>
<journal-directory>target/data/journal</journal-directory>
<bindings-directory>target/data/bindings</bindings-directory>
<large-messages-directory>target/data/large-messages</large-messages-directory>
</core>
</configuration>

View File

@ -62,59 +62,37 @@ under the License.
<artifactId>artemis-maven-plugin</artifactId>
<executions>
<execution>
<id>start0</id>
<id>create</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
<instance>${basedir}/target/server0</instance>
<configuration>${basedir}/target/classes/activemq/server0</configuration>
</configuration>
</execution>
<execution>
<id>start1</id>
<id>create2</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
<fork>true</fork>
<instance>${basedir}/target/server1</instance>
<configuration>${basedir}/target/classes/activemq/server1</configuration>
<portOffset>1</portOffset>
</configuration>
</execution>
<execution>
<id>runClient</id>
<goals>
<goal>runClient</goal>
<goal>client</goal>
</goals>
<configuration>
<clientClass>org.apache.activemq.artemis.jms.example.BridgeExample</clientClass>
<args>
<param>tcp://localhost:61616</param>
<param>tcp://localhost:61617</param>
<param>${basedir}/target/server0</param>
<param>${basedir}/target/server1</param>
</args>
<systemProperties>
<property>
<name>exampleConfigDir</name>
<value>${basedir}/target/classes/activemq</value>
</property>
</systemProperties>
</configuration>
</execution>
<execution>
<id>stop0</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
</configuration>
</execution>
<execution>
<id>stop1</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
</configuration>
</execution>
</executions>
@ -129,21 +107,11 @@ under the License.
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
@ -155,15 +123,6 @@ under the License.
<version>${geronimo.jms.2.spec.version}</version>
</dependency>
</dependencies>
<configuration>
<waitOnStart>false</waitOnStart>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -16,8 +16,6 @@
*/
package org.apache.activemq.artemis.jms.example;
import java.util.Hashtable;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Message;
@ -26,6 +24,7 @@ import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.naming.InitialContext;
import java.util.Hashtable;
import org.apache.activemq.artemis.common.example.ActiveMQExample;

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -57,9 +57,10 @@ under the License.
<artifactId>artemis-maven-plugin</artifactId>
<executions>
<execution>
<id>start</id>
<id>create</id>
<phase>verify</phase>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
</execution>
<execution>
@ -70,16 +71,10 @@ under the License.
<configuration>
<clientClass>org.apache.activemq.artemis.jms.example.QueueBrowserExample</clientClass>
<args>
<param>tcp://localhost:61616</param>
<param>${basedir}/target/server0</param>
</args>
</configuration>
</execution>
<execution>
<id>stop</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
@ -87,47 +82,7 @@ under the License.
<artifactId>artemis-jms-browser-example</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
<version>${geronimo.jms.2.spec.version}</version>
</dependency>
</dependencies>
<configuration>
<waitOnStart>false</waitOnStart>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -16,8 +16,6 @@
*/
package org.apache.activemq.artemis.jms.example;
import java.util.Enumeration;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.MessageConsumer;
@ -27,6 +25,7 @@ import javax.jms.QueueBrowser;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.InitialContext;
import java.util.Enumeration;
import org.apache.activemq.artemis.common.example.ActiveMQExample;

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,61 +0,0 @@
<?xml version='1.0'?>
<!--
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.
-->
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:activemq"
xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
<jms xmlns="urn:activemq:jms">
<!--the queue used by the example-->
<queue name="exampleQueue"/>
</jms>
<core xmlns="urn:activemq:core">
<bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
<journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
<large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
<paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
</acceptors>
<!-- Other config -->
<security-settings>
<!--security for example queue-->
<security-setting match="jms.queue.exampleQueue">
<permission type="createDurableQueue" roles="guest"/>
<permission type="deleteDurableQueue" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="send" roles="guest"/>
</security-setting>
</security-settings>
</core>
</configuration>

View File

@ -62,35 +62,13 @@ under the License.
<artifactId>artemis-maven-plugin</artifactId>
<executions>
<execution>
<id>start</id>
<id>create</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<!--we need to fork the server as we have system props that need set pre runtime-->
<fork>true</fork>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
<property>
<name>com.sun.management.jmxremote</name>
<value />
</property>
<property>
<name>com.sun.management.jmxremote.port</name>
<value>3000</value>
</property>
<property>
<name>com.sun.management.jmxremote.ssl</name>
<value>false</value>
</property>
<property>
<name>com.sun.management.jmxremote.authenticate</name>
<value>false</value>
</property>
</systemProperties>
<!-- options used for JMX on the example -->
<javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false</javaOptions>
</configuration>
</execution>
<execution>
@ -101,16 +79,10 @@ under the License.
<configuration>
<clientClass>org.apache.activemq.artemis.jms.example.ClientKickoffExample</clientClass>
<args>
<param>tcp://localhost:61616</param>
<param>${basedir}/target/server0</param>
</args>
</configuration>
</execution>
<execution>
<id>stop</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
@ -118,41 +90,7 @@ under the License.
<artifactId>artemis-jms-client-kickoff-example</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
<version>${geronimo.jms.2.spec.version}</version>
</dependency>
</dependencies>
<configuration>
<waitOnStart>false</waitOnStart>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -16,9 +16,6 @@
*/
package org.apache.activemq.artemis.jms.example;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicReference;
import javax.jms.ExceptionListener;
import javax.jms.JMSException;
import javax.jms.QueueConnection;
@ -30,6 +27,8 @@ import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import javax.naming.InitialContext;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -57,42 +57,28 @@ under the License.
<artifactId>artemis-maven-plugin</artifactId>
<executions>
<execution>
<id>start0</id>
<id>create</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
<property>
<name>udp-address</name>
<value>${udp-address}</value>
</property>
</systemProperties>
<instance>${basedir}/target/server0</instance>
<data>../../shared/</data>
<sharedStore>true</sharedStore>
<slave>false</slave>
</configuration>
</execution>
<execution>
<id>start1</id>
<id>create2</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
<fork>true</fork>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
<property>
<name>udp-address</name>
<value>${udp-address}</value>
</property>
</systemProperties>
<instance>${basedir}/target/server1</instance>
<data>../../shared/</data>
<sharedStore>true</sharedStore>
<slave>true</slave>
<portOffset>1</portOffset>
</configuration>
</execution>
@ -103,30 +89,10 @@ under the License.
</goals>
<configuration>
<clientClass>org.apache.activemq.artemis.jms.example.ClientSideFailoverListerExample</clientClass>
<systemProperties>
<property>
<name>exampleConfigDir</name>
<value>${basedir}/target/classes/activemq</value>
</property>
</systemProperties>
</configuration>
</execution>
<execution>
<id>stop0</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
</configuration>
</execution>
<execution>
<id>stop1</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
<args>
<param>${basedir}/target/server0</param>
<param>${basedir}/target/server1</param>
</args>
</configuration>
</execution>
</executions>
@ -136,46 +102,7 @@ under the License.
<artifactId>artemis-jms-client-side-fileoverlistener-example</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
<version>${geronimo.jms.2.spec.version}</version>
</dependency>
</dependencies>
<configuration>
<waitOnStart>false</waitOnStart>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -38,11 +38,23 @@ import org.apache.activemq.artemis.jms.client.ActiveMQConnection;
*/
public class ClientSideFailoverListerExample extends ActiveMQExample
{
public static void main(final String[] args)
public static void main(final String[] args) throws Exception
{
new ClientSideFailoverListerExample().run(args);
}
@Override
protected void startServers(String[] serversArgs) throws Exception
{
startServer(0, 5000);
// server 1 is a backup, it's not activated
startServer(1, 0);
Thread.sleep(1000);
}
@Override
public boolean runExample() throws Exception
{

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,92 +0,0 @@
<?xml version='1.0'?>
<!--
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.
-->
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:activemq"
xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
<jms xmlns="urn:activemq:jms">
<!--the queue used by the example-->
<queue name="exampleQueue"/>
</jms>
<core xmlns="urn:activemq:core">
<bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
<journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
<large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
<paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
<ha-policy>
<shared-store>
<master/>
</shared-store>
</ha-policy>
<!-- Connectors -->
<connectors>
<connector name="netty-connector">tcp://localhost:61616</connector>
</connectors>
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
</acceptors>
<broadcast-groups>
<broadcast-group name="bg-group1">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<broadcast-period>1000</broadcast-period>
<connector-ref>netty-connector</connector-ref>
</broadcast-group>
</broadcast-groups>
<discovery-groups>
<discovery-group name="dg-group1">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<refresh-timeout>60000</refresh-timeout>
</discovery-group>
</discovery-groups>
<cluster-connections>
<cluster-connection name="my-cluster">
<address>jms</address>
<connector-ref>netty-connector</connector-ref>
<discovery-group-ref discovery-group-name="dg-group1"/>
</cluster-connection>
</cluster-connections>
<security-settings>
<!--security for example queue-->
<security-setting match="jms.queue.exampleQueue">
<permission type="createDurableQueue" roles="guest"/>
<permission type="deleteDurableQueue" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="send" roles="guest"/>
</security-setting>
</security-settings>
</core>
</configuration>

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,93 +0,0 @@
<?xml version='1.0'?>
<!--
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.
-->
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:activemq"
xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
<jms xmlns="urn:activemq:jms">
<!--the queue used by the example-->
<queue name="exampleQueue"/>
</jms>
<core xmlns="urn:activemq:core">
<bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
<journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
<large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
<paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
<ha-policy>
<shared-store>
<slave/>
</shared-store>
</ha-policy>
<!-- Connectors -->
<connectors>
<connector name="netty-connector">tcp://localhost:61617</connector>
</connectors>
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
</acceptors>
<broadcast-groups>
<broadcast-group name="bg-group1">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<broadcast-period>1000</broadcast-period>
<connector-ref>netty-connector</connector-ref>
</broadcast-group>
</broadcast-groups>
<discovery-groups>
<discovery-group name="dg-group1">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<refresh-timeout>60000</refresh-timeout>
</discovery-group>
</discovery-groups>
<cluster-connections>
<cluster-connection name="my-cluster">
<address>jms</address>
<connector-ref>netty-connector</connector-ref>
<discovery-group-ref discovery-group-name="dg-group1"/>
</cluster-connection>
</cluster-connections>
<security-settings>
<!--security for example queue-->
<security-setting match="jms.queue.exampleQueue">
<permission type="createDurableQueue" roles="guest"/>
<permission type="deleteDurableQueue" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="send" roles="guest"/>
</security-setting>
</security-settings>
</core>
</configuration>

View File

@ -57,56 +57,41 @@ under the License.
<artifactId>artemis-maven-plugin</artifactId>
<executions>
<execution>
<id>start0</id>
<id>create</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
<instance>${basedir}/target/server0</instance>
<clustered>true</clustered>
<configuration>${basedir}/target/classes/activemq/server0</configuration>
</configuration>
</execution>
<execution>
<id>start1</id>
<id>create2</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
<fork>true</fork>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
<property>
<name>udp-address</name>
<value>${udp-address}</value>
</property>
</systemProperties>
<instance>${basedir}/target/server1</instance>
<clustered>true</clustered>
<configuration>${basedir}/target/classes/activemq/server1</configuration>
<portOffset>1</portOffset>
</configuration>
</execution>
<execution>
<id>start2</id>
<id>create3</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
<fork>true</fork>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
<instance>${basedir}/target/server2</instance>
<clustered>true</clustered>
<configuration>${basedir}/target/classes/activemq/server2</configuration>
<portOffset>2</portOffset>
</configuration>
</execution>
<execution>
<id>runClient</id>
<goals>
@ -114,39 +99,11 @@ under the License.
</goals>
<configuration>
<clientClass>org.apache.activemq.artemis.jms.example.ClientSideLoadBalancingExample</clientClass>
<systemProperties>
<property>
<name>exampleConfigDir</name>
<value>${basedir}/target/classes/activemq</value>
</property>
</systemProperties>
</configuration>
</execution>
<execution>
<id>stop0</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
</configuration>
</execution>
<execution>
<id>stop1</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
</configuration>
</execution>
<execution>
<id>stop2</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
<args>
<param>${basedir}/target/server0</param>
<param>${basedir}/target/server1</param>
<param>${basedir}/target/server2</param>
</args>
</configuration>
</execution>
</executions>
@ -156,46 +113,7 @@ under the License.
<artifactId>artemis-jms-client-side-load-balancing-example</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
<version>${geronimo.jms.2.spec.version}</version>
</dependency>
</dependencies>
<configuration>
<waitOnStart>false</waitOnStart>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,92 +0,0 @@
<?xml version='1.0'?>
<!--
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.
-->
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:activemq"
xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
<jms xmlns="urn:activemq:jms">
<!--the queue used by the example-->
<queue name="exampleQueue"/>
</jms>
<core xmlns="urn:activemq:core">
<bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
<journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
<large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
<paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
<!-- Connectors -->
<connectors>
<connector name="netty-connector">tcp://localhost:61616</connector>
</connectors>
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
</acceptors>
<!-- Clustering configuration -->
<broadcast-groups>
<broadcast-group name="my-broadcast-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<broadcast-period>100</broadcast-period>
<connector-ref>netty-connector</connector-ref>
</broadcast-group>
</broadcast-groups>
<discovery-groups>
<discovery-group name="my-discovery-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<refresh-timeout>10000</refresh-timeout>
</discovery-group>
</discovery-groups>
<cluster-connections>
<cluster-connection name="my-cluster">
<address>jms</address>
<connector-ref>netty-connector</connector-ref>
<max-hops>0</max-hops>
<discovery-group-ref discovery-group-name="my-discovery-group"/>
</cluster-connection>
</cluster-connections>
<!-- Other config -->
<security-settings>
<!--security for example queue-->
<security-setting match="jms.queue.exampleQueue">
<permission type="createDurableQueue" roles="guest"/>
<permission type="deleteDurableQueue" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="send" roles="guest"/>
</security-setting>
</security-settings>
</core>
</configuration>

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,89 +0,0 @@
<?xml version='1.0'?>
<!--
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.
-->
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:activemq"
xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
<jms xmlns="urn:activemq:jms">
<!--the queue used by the example-->
<queue name="exampleQueue"/>
</jms>
<core xmlns="urn:activemq:core">
<bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
<journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
<large-messages-directory>${data.dir}/server1/data/messaging/largemessages</large-messages-directory>
<paging-directory>${data.dir}/server1/data/messaging/paging</paging-directory>
<!-- Connectors -->
<connectors>
<connector name="netty-connector">tcp://localhost:61617</connector>
</connectors>
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
</acceptors>
<!-- Clustering configuration -->
<broadcast-groups>
<broadcast-group name="my-broadcast-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<broadcast-period>100</broadcast-period>
<connector-ref>netty-connector</connector-ref>
</broadcast-group>
</broadcast-groups>
<discovery-groups>
<discovery-group name="my-discovery-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<refresh-timeout>10000</refresh-timeout>
</discovery-group>
</discovery-groups>
<cluster-connections>
<cluster-connection name="my-cluster">
<address>jms</address>
<connector-ref>netty-connector</connector-ref>
<max-hops>0</max-hops>
<discovery-group-ref discovery-group-name="my-discovery-group"/>
</cluster-connection>
</cluster-connections>
<!-- Other config -->
<security-settings>
<!--security for example queue-->
<security-setting match="jms.queue.exampleQueue">
<permission type="createDurableQueue" roles="guest"/>
<permission type="deleteDurableQueue" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="send" roles="guest"/>
</security-setting>
</security-settings>
</core>
</configuration>

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,87 +0,0 @@
<?xml version='1.0'?>
<!--
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.
-->
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:activemq"
xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
<jms xmlns="urn:activemq:jms">
</jms>
<core xmlns="urn:activemq:core">
<bindings-directory>${data.dir}/server2/data/messaging/bindings</bindings-directory>
<journal-directory>${data.dir}/server2/data/messaging/journal</journal-directory>
<large-messages-directory>${data.dir}/server2/data/messaging/largemessages</large-messages-directory>
<paging-directory>${data.dir}/server2/data/messaging/paging</paging-directory>
<!-- Connectors -->
<connectors>
<connector name="netty-connector">tcp://localhost:61618</connector>
</connectors>
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
</acceptors>
<!-- Clustering configuration -->
<broadcast-groups>
<broadcast-group name="my-broadcast-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<broadcast-period>100</broadcast-period>
<connector-ref>netty-connector</connector-ref>
</broadcast-group>
</broadcast-groups>
<discovery-groups>
<discovery-group name="my-discovery-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<refresh-timeout>10000</refresh-timeout>
</discovery-group>
</discovery-groups>
<cluster-connections>
<cluster-connection name="my-cluster">
<address>jms</address>
<connector-ref>netty-connector</connector-ref>
<max-hops>0</max-hops>
<discovery-group-ref discovery-group-name="my-discovery-group"/>
</cluster-connection>
</cluster-connections>
<!-- Other config -->
<security-settings>
<!--security for example queue-->
<security-setting match="jms.queue.exampleQueue">
<permission type="createDurableQueue" roles="guest"/>
<permission type="deleteDurableQueue" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="send" roles="guest"/>
</security-setting>
</security-settings>
</core>
</configuration>

View File

@ -57,34 +57,24 @@ under the License.
<artifactId>artemis-maven-plugin</artifactId>
<executions>
<execution>
<id>start0</id>
<id>create</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
<instance>${basedir}/target/server0</instance>
<configuration>${basedir}/target/classes/activemq/server0</configuration>
</configuration>
</execution>
<execution>
<id>start1</id>
<id>create2</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
<fork>true</fork>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
<instance>${basedir}/target/server1</instance>
<configuration>${basedir}/target/classes/activemq/server1</configuration>
<portOffset>1</portOffset>
</configuration>
</execution>
<execution>
@ -95,33 +85,9 @@ under the License.
<configuration>
<clientClass>org.apache.activemq.artemis.jms.example.ClusteredDurableSubscriptionExample</clientClass>
<args>
<param>tcp://localhost:61616</param>
<param>tcp://localhost:61617</param>
<param>${basedir}/target/server0</param>
<param>${basedir}/target/server1</param>
</args>
<systemProperties>
<property>
<name>exampleConfigDir</name>
<value>${basedir}/target/classes/activemq</value>
</property>
</systemProperties>
</configuration>
</execution>
<execution>
<id>stop0</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
</configuration>
</execution>
<execution>
<id>stop1</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
</configuration>
</execution>
</executions>
@ -131,46 +97,7 @@ under the License.
<artifactId>artemis-jms-clustered-durable-subscription-example</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
<version>${geronimo.jms.2.spec.version}</version>
</dependency>
</dependencies>
<configuration>
<waitOnStart>false</waitOnStart>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -16,8 +16,6 @@
*/
package org.apache.activemq.artemis.jms.example;
import java.util.Hashtable;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.MessageConsumer;
@ -26,6 +24,7 @@ import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.naming.InitialContext;
import java.util.Hashtable;
import org.apache.activemq.artemis.common.example.ActiveMQExample;
@ -58,7 +57,7 @@ public class ClusteredDurableSubscriptionExample extends ActiveMQExample
// Step 1. Get an initial context for looking up JNDI from server 0
Hashtable<String, Object> properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
properties.put("connectionFactory.ConnectionFactory", args[0]);
properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616");
properties.put("topic.topic/exampleTopic", "exampleTopic");
ic0 = new InitialContext(properties);
@ -72,7 +71,7 @@ public class ClusteredDurableSubscriptionExample extends ActiveMQExample
properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
properties.put("connectionFactory.ConnectionFactory", args[1]);
properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
ic1 = new InitialContext(properties);
// Step 5. Look-up a JMS Connection Factory object from JNDI on server 1

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -57,62 +57,35 @@ under the License.
<artifactId>artemis-maven-plugin</artifactId>
<executions>
<execution>
<id>start0</id>
<id>create</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
<property>
<name>udp-address</name>
<value>${udp-address}</value>
</property>
</systemProperties>
<instance>${basedir}/target/server0</instance>
<configuration>${basedir}/target/classes/activemq/server0</configuration>
</configuration>
</execution>
<execution>
<id>start1</id>
<id>create2</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
<fork>true</fork>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
<property>
<name>udp-address</name>
<value>${udp-address}</value>
</property>
</systemProperties>
<instance>${basedir}/target/server1</instance>
<configuration>${basedir}/target/classes/activemq/server1</configuration>
<portOffset>1</portOffset>
</configuration>
</execution>
<execution>
<id>start2</id>
<id>create3</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
<fork>true</fork>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
<property>
<name>udp-address</name>
<value>${udp-address}</value>
</property>
</systemProperties>
<instance>${basedir}/target/server2</instance>
<configuration>${basedir}/target/classes/activemq/server2</configuration>
<portOffset>2</portOffset>
</configuration>
</execution>
<execution>
@ -123,43 +96,10 @@ under the License.
<configuration>
<clientClass>org.apache.activemq.artemis.jms.example.ClusteredGroupingExample</clientClass>
<args>
<param>tcp://localhost:61616</param>
<param>tcp://localhost:61617</param>
<param>tcp://localhost:61618</param>
<param>${basedir}/target/server0</param>
<param>${basedir}/target/server1</param>
<param>${basedir}/target/server2</param>
</args>
<systemProperties>
<property>
<name>exampleConfigDir</name>
<value>${basedir}/target/classes/activemq</value>
</property>
</systemProperties>
</configuration>
</execution>
<execution>
<id>stop0</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
</configuration>
</execution>
<execution>
<id>stop1</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
</configuration>
</execution>
<execution>
<id>stop2</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
</configuration>
</execution>
</executions>
@ -169,46 +109,7 @@ under the License.
<artifactId>artemis-jms-clustered-grouping-example</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
<version>${geronimo.jms.2.spec.version}</version>
</dependency>
</dependencies>
<configuration>
<waitOnStart>false</waitOnStart>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -16,8 +16,6 @@
*/
package org.apache.activemq.artemis.jms.example;
import java.util.Hashtable;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.MessageConsumer;
@ -26,6 +24,7 @@ import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.InitialContext;
import java.util.Hashtable;
import org.apache.activemq.artemis.common.example.ActiveMQExample;
@ -60,7 +59,7 @@ public class ClusteredGroupingExample extends ActiveMQExample
// Step 1. Get an initial context for looking up JNDI from server 0
Hashtable<String, Object> properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
properties.put("connectionFactory.ConnectionFactory", args[0]);
properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616");
properties.put("queue.queue/exampleQueue", "exampleQueue");
ic0 = new InitialContext(properties);
@ -73,7 +72,7 @@ public class ClusteredGroupingExample extends ActiveMQExample
// Step 4. Get an initial context for looking up JNDI from server 1
properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
properties.put("connectionFactory.ConnectionFactory", args[1]);
properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
ic1 = new InitialContext(properties);
// Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
@ -82,7 +81,7 @@ public class ClusteredGroupingExample extends ActiveMQExample
// Step 4. Get an initial context for looking up JNDI from server 2
properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
properties.put("connectionFactory.ConnectionFactory", args[2]);
properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61618");
ic2 = new InitialContext(properties);
// Step 5. Look-up a JMS Connection Factory object from JNDI on server 2

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -30,13 +30,14 @@ under the License.
<core xmlns="urn:activemq:core">
<bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
<bindings-directory>${data.dir:../data}/bindings</bindings-directory>
<journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
<journal-directory>${data.dir:../data}/journal</journal-directory>
<large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
<large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
<paging-directory>${data.dir:../data}/paging</paging-directory>
<paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
<!-- Connectors -->

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -30,13 +30,14 @@ under the License.
<core xmlns="urn:activemq:core">
<bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
<bindings-directory>${data.dir:../data}/bindings</bindings-directory>
<journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
<journal-directory>${data.dir:../data}/journal</journal-directory>
<large-messages-directory>${data.dir}/server1/data/messaging/largemessages</large-messages-directory>
<large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
<paging-directory>${data.dir:../data}/paging</paging-directory>
<paging-directory>${data.dir}/server1/data/messaging/paging</paging-directory>
<!-- Connectors -->
<connectors>

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -30,13 +30,14 @@ under the License.
<core xmlns="urn:activemq:core">
<bindings-directory>${data.dir}/server2/data/messaging/bindings</bindings-directory>
<bindings-directory>${data.dir:../data}/bindings</bindings-directory>
<journal-directory>${data.dir}/server2/data/messaging/journal</journal-directory>
<journal-directory>${data.dir:../data}/journal</journal-directory>
<large-messages-directory>${data.dir}/server2/data/messaging/largemessages</large-messages-directory>
<large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
<paging-directory>${data.dir:../data}/paging</paging-directory>
<paging-directory>${data.dir}/server2/data/messaging/paging</paging-directory>
<!-- Connectors -->
<connectors>

View File

@ -57,38 +57,32 @@ under the License.
<artifactId>artemis-maven-plugin</artifactId>
<executions>
<execution>
<id>start0</id>
<id>create</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
<systemProperties>
<!-- this is to make sure the example will run fine on any box.
you may tweak this to any property you like. More information on the JGroups docs -->
<property>
<name>jgroups.bind_addr</name>
<value>::1</value>
</property>
</systemProperties>
<libList>
<!-- You need to add jgroups.jar to the server's lib -->
<arg>org.jgroups:jgroups:3.6.0.Final</arg>
</libList>
<instance>${basedir}/target/server0</instance>
<configuration>${basedir}/target/classes/activemq/server0</configuration>
</configuration>
</execution>
<execution>
<id>start1</id>
<id>create2</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
<fork>true</fork>
<systemProperties>
<!-- this is to make sure the example will run fine on any box.
you may tweak this to any property you like. More information on the JGroups docs -->
<property>
<name>jgroups.bind_addr</name>
<value>::1</value>
</property>
</systemProperties>
<libList>
<!-- You need to add jgroups.jar to the server's lib -->
<arg>org.jgroups:jgroups:3.6.0.Final</arg>
</libList>
<instance>${basedir}/target/server1</instance>
<configuration>${basedir}/target/classes/activemq/server1</configuration>
<portOffset>1</portOffset>
</configuration>
</execution>
<execution>
@ -99,29 +93,11 @@ under the License.
<configuration>
<clientClass>org.apache.activemq.artemis.jms.example.ClusteredJgroupsExample</clientClass>
<args>
<param>tcp://localhost:61616</param>
<param>tcp://localhost:61617</param>
<param>${basedir}/target/server0</param>
<param>${basedir}/target/server1</param>
</args>
</configuration>
</execution>
<execution>
<id>stop0</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
</configuration>
</execution>
<execution>
<id>stop1</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
@ -129,40 +105,7 @@ under the License.
<artifactId>clustered-jgroups</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
<version>${geronimo.jms.2.spec.version}</version>
</dependency>
</dependencies>
<configuration>
<waitOnStart>false</waitOnStart>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -16,8 +16,6 @@
*/
package org.apache.activemq.artemis.jms.example;
import java.util.Hashtable;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.MessageConsumer;
@ -26,6 +24,7 @@ import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.InitialContext;
import java.util.Hashtable;
import org.apache.activemq.artemis.common.example.ActiveMQExample;
@ -55,7 +54,7 @@ public class ClusteredJgroupsExample extends ActiveMQExample
// Step 1. Get an initial context for looking up JNDI from server 0
Hashtable<String, Object> properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
properties.put("connectionFactory.ConnectionFactory", args[0]);
properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616");
properties.put("queue.queue/exampleQueue", "exampleQueue");
ic0 = new InitialContext(properties);
@ -68,7 +67,7 @@ public class ClusteredJgroupsExample extends ActiveMQExample
// Step 4. Get an initial context for looking up JNDI from server 1
properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
properties.put("connectionFactory.ConnectionFactory", args[1]);
properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
ic1 = new InitialContext(properties);
// Step 5. Look-up a JMS Connection Factory object from JNDI on server 1

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -47,7 +47,8 @@ under the License.
oob_thread_pool.queue_max_size="100"
oob_thread_pool.rejection_policy="run"/>
<FILE_PING location="../file.ping.dir"/>
<!-- a location that can be found by both server's running -->
<FILE_PING location="../../file.ping.dir"/>
<MERGE2 max_interval="30000"
min_interval="10000"/>
<FD_SOCK/>

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -1,17 +0,0 @@
## ---------------------------------------------------------------------------
## 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.
## ---------------------------------------------------------------------------
guest=guest

View File

@ -47,7 +47,8 @@ under the License.
oob_thread_pool.queue_max_size="100"
oob_thread_pool.rejection_policy="run"/>
<FILE_PING location="../file.ping.dir"/>
<!-- a location that can be found by both server's running -->
<FILE_PING location="../../file.ping.dir"/>
<MERGE2 max_interval="30000"
min_interval="10000"/>
<FD_SOCK/>

View File

@ -57,34 +57,24 @@ under the License.
<artifactId>artemis-maven-plugin</artifactId>
<executions>
<execution>
<id>start0</id>
<id>create</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
<systemProperties>
<property>
<name>udp-address</name>
<value>${udp-address}</value>
</property>
</systemProperties>
<instance>${basedir}/target/server0</instance>
<configuration>${basedir}/target/classes/activemq/server0</configuration>
</configuration>
</execution>
<execution>
<id>start1</id>
<id>create2</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
<fork>true</fork>
<systemProperties>
<property>
<name>udp-address</name>
<value>${udp-address}</value>
</property>
</systemProperties>
<instance>${basedir}/target/server1</instance>
<configuration>${basedir}/target/classes/activemq/server1</configuration>
<portOffset>1</portOffset>
</configuration>
</execution>
<execution>
@ -95,29 +85,11 @@ under the License.
<configuration>
<clientClass>org.apache.activemq.artemis.jms.example.ClusteredQueueExample</clientClass>
<args>
<param>tcp://localhost:61616</param>
<param>tcp://localhost:61617</param>
<param>${basedir}/target/server0</param>
<param>${basedir}/target/server1</param>
</args>
</configuration>
</execution>
<execution>
<id>stop0</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
</configuration>
</execution>
<execution>
<id>stop1</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
@ -125,40 +97,7 @@ under the License.
<artifactId>clustered-queue</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
<version>${geronimo.jms.2.spec.version}</version>
</dependency>
</dependencies>
<configuration>
<waitOnStart>false</waitOnStart>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -16,8 +16,6 @@
*/
package org.apache.activemq.artemis.jms.example;
import java.util.Hashtable;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.MessageConsumer;
@ -26,6 +24,7 @@ import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.InitialContext;
import java.util.Hashtable;
import org.apache.activemq.artemis.common.example.ActiveMQExample;
@ -56,7 +55,7 @@ public class ClusteredQueueExample extends ActiveMQExample
// Step 1. Get an initial context for looking up JNDI from server 0
Hashtable<String, Object> properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
properties.put("connectionFactory.ConnectionFactory", args[0]);
properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP1);
properties.put("queue.queue/exampleQueue", "exampleQueue");
ic0 = new InitialContext(properties);
@ -69,7 +68,7 @@ public class ClusteredQueueExample extends ActiveMQExample
// Step 4. Get an initial context for looking up JNDI from server 1
properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
properties.put("connectionFactory.ConnectionFactory", args[1]);
properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP2);
ic1 = new InitialContext(properties);
// Step 5. Look-up a JMS Connection Factory object from JNDI on server 1

View File

@ -57,50 +57,35 @@ under the License.
<artifactId>artemis-maven-plugin</artifactId>
<executions>
<execution>
<id>start0</id>
<id>create</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
<systemProperties>
<property>
<name>udp-address</name>
<value>${udp-address}</value>
</property>
</systemProperties>
<instance>${basedir}/target/server0</instance>
<configuration>${basedir}/target/classes/activemq/server0</configuration>
</configuration>
</execution>
<execution>
<id>start1</id>
<id>create2</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
<fork>true</fork>
<systemProperties>
<property>
<name>udp-address</name>
<value>${udp-address}</value>
</property>
</systemProperties>
<instance>${basedir}/target/server1</instance>
<configuration>${basedir}/target/classes/activemq/server1</configuration>
<portOffset>1</portOffset>
</configuration>
</execution>
<execution>
<id>start2</id>
<id>create3</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
<fork>true</fork>
<systemProperties>
<property>
<name>udp-address</name>
<value>${udp-address}</value>
</property>
</systemProperties>
<instance>${basedir}/target/server2</instance>
<configuration>${basedir}/target/classes/activemq/server2</configuration>
<portOffset>2</portOffset>
</configuration>
</execution>
<execution>
@ -111,43 +96,10 @@ under the License.
<configuration>
<clientClass>org.apache.activemq.artemis.jms.example.ClusteredStandaloneExample</clientClass>
<args>
<param>tcp://localhost:61616</param>
<param>tcp://localhost:61617</param>
<param>tcp://localhost:61618</param>
<param>${basedir}/target/server0</param>
<param>${basedir}/target/server1</param>
<param>${basedir}/target/server2</param>
</args>
<systemProperties>
<property>
<name>exampleConfigDir</name>
<value>${basedir}/target/classes/activemq</value>
</property>
</systemProperties>
</configuration>
</execution>
<execution>
<id>stop0</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
</configuration>
</execution>
<execution>
<id>stop1</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
</configuration>
</execution>
<execution>
<id>stop2</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
</configuration>
</execution>
</executions>
@ -157,36 +109,6 @@ under the License.
<artifactId>artemis-jms-clustered-standalone-example</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
<version>${geronimo.jms.2.spec.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>

View File

@ -16,8 +16,6 @@
*/
package org.apache.activemq.artemis.jms.example;
import java.util.Hashtable;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.MessageConsumer;
@ -26,6 +24,7 @@ import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.naming.InitialContext;
import java.util.Hashtable;
import org.apache.activemq.artemis.common.example.ActiveMQExample;
@ -53,18 +52,18 @@ public class ClusteredStandaloneExample extends ActiveMQExample
{
Hashtable<String, Object> properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
properties.put("connectionFactory.ConnectionFactory", args[0]);
properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP1);
properties.put("topic.topic/exampleTopic", "exampleTopic");
initialContext0 = new InitialContext(properties);
properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
properties.put("connectionFactory.ConnectionFactory", args[1]);
properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP2);
initialContext1 = new InitialContext(properties);
properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
properties.put("connectionFactory.ConnectionFactory", args[2]);
properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP3);
initialContext2 = new InitialContext(properties);
// First we demonstrate a distributed topic.
@ -147,7 +146,7 @@ public class ClusteredStandaloneExample extends ActiveMQExample
return false;
}
// System.out.println("Received message " + message2.getText());
System.out.println("Received message " + message2.getText());
}
producer.close();

View File

@ -57,42 +57,46 @@ under the License.
<artifactId>artemis-maven-plugin</artifactId>
<executions>
<execution>
<id>start0</id>
<id>create</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
<instance>${basedir}/target/server0</instance>
<configuration>${basedir}/target/classes/activemq/server0</configuration>
</configuration>
</execution>
<execution>
<id>start1</id>
<id>create2</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
<fork>true</fork>
<instance>${basedir}/target/server1</instance>
<configuration>${basedir}/target/classes/activemq/server1</configuration>
<portOffset>1</portOffset>
</configuration>
</execution>
<execution>
<id>start2</id>
<id>create3</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
<fork>true</fork>
<instance>${basedir}/target/server2</instance>
<configuration>${basedir}/target/classes/activemq/server2</configuration>
<portOffset>2</portOffset>
</configuration>
</execution>
<execution>
<id>start3</id>
<id>create4</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server3</configurationDir>
<fork>true</fork>
<instance>${basedir}/target/server3</instance>
<configuration>${basedir}/target/classes/activemq/server3</configuration>
<portOffset>3</portOffset>
</configuration>
</execution>
<execution>
@ -103,53 +107,11 @@ under the License.
<configuration>
<clientClass>org.apache.activemq.artemis.jms.example.StaticClusteredQueueExample</clientClass>
<args>
<param>tcp://localhost:61616</param>
<param>tcp://localhost:61617</param>
<param>tcp://localhost:61618</param>
<param>tcp://localhost:61619</param>
<param>${basedir}/target/server0</param>
<param>${basedir}/target/server1</param>
<param>${basedir}/target/server2</param>
<param>${basedir}/target/server3</param>
</args>
<systemProperties>
<property>
<name>exampleConfigDir</name>
<value>${basedir}/target/classes/activemq</value>
</property>
</systemProperties>
</configuration>
</execution>
<execution>
<id>stop0</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
</configuration>
</execution>
<execution>
<id>stop1</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
</configuration>
</execution>
<execution>
<id>stop2</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
</configuration>
</execution>
<execution>
<id>stop3</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server3</configurationDir>
</configuration>
</execution>
</executions>
@ -159,46 +121,7 @@ under the License.
<artifactId>artemis-jms-clustered-static-discovery-example</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
<version>${geronimo.jms.2.spec.version}</version>
</dependency>
</dependencies>
<configuration>
<waitOnStart>false</waitOnStart>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -16,8 +16,6 @@
*/
package org.apache.activemq.artemis.jms.example;
import java.util.Hashtable;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.MessageConsumer;
@ -26,6 +24,7 @@ import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.InitialContext;
import java.util.Hashtable;
import org.apache.activemq.artemis.common.example.ActiveMQExample;
@ -60,7 +59,7 @@ public class StaticClusteredQueueExample extends ActiveMQExample
// Step 1. Get an initial context for looking up JNDI from server 3
Hashtable<String, Object> properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
properties.put("connectionFactory.ConnectionFactory", args[3]);
properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP4);
properties.put("queue.queue/exampleQueue", "exampleQueue");
ic0 = new InitialContext(properties);

View File

@ -57,32 +57,33 @@ under the License.
<artifactId>artemis-maven-plugin</artifactId>
<executions>
<execution>
<id>start0</id>
<id>create</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
<instance>${basedir}/target/server0</instance>
<configuration>${basedir}/target/classes/activemq/server0</configuration>
</configuration>
</execution>
<execution>
<id>start1</id>
<id>create2</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
<fork>true</fork>
<instance>${basedir}/target/server1</instance>
<configuration>${basedir}/target/classes/activemq/server1</configuration>
</configuration>
</execution>
<execution>
<id>start2</id>
<id>create3</id>
<goals>
<goal>start</goal>
<goal>create</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
<fork>true</fork>
<instance>${basedir}/target/server2</instance>
<configuration>${basedir}/target/classes/activemq/server2</configuration>
</configuration>
</execution>
<execution>
@ -93,43 +94,10 @@ under the License.
<configuration>
<clientClass>org.apache.activemq.artemis.jms.example.ClusterStaticOnewayExample</clientClass>
<args>
<param>tcp://localhost:61616</param>
<param>tcp://localhost:61617</param>
<param>tcp://localhost:61618</param>
<param>${basedir}/target/server0</param>
<param>${basedir}/target/server1</param>
<param>${basedir}/target/server2</param>
</args>
<systemProperties>
<property>
<name>exampleConfigDir</name>
<value>${basedir}/target/classes/activemq</value>
</property>
</systemProperties>
</configuration>
</execution>
<execution>
<id>stop0</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
</configuration>
</execution>
<execution>
<id>stop1</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
</configuration>
</execution>
<execution>
<id>stop2</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
</configuration>
</execution>
</executions>
@ -139,46 +107,7 @@ under the License.
<artifactId>artemis-jms-clustered-static-oneway-example</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
<version>${geronimo.jms.2.spec.version}</version>
</dependency>
</dependencies>
<configuration>
<waitOnStart>false</waitOnStart>
<systemProperties>
<property>
<name>data.dir</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>

Some files were not shown because too many files have changed in this diff Show More