Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 32E3C1869B for ; Wed, 12 Aug 2015 03:46:58 +0000 (UTC) Received: (qmail 57336 invoked by uid 500); 12 Aug 2015 03:46:57 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 57253 invoked by uid 500); 12 Aug 2015 03:46:57 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 55352 invoked by uid 99); 12 Aug 2015 03:46:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Aug 2015 03:46:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6F6F9E188E; Wed, 12 Aug 2015 03:46:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: clebertsuconic@apache.org To: commits@activemq.apache.org Date: Wed, 12 Aug 2015 03:47:21 -0000 Message-Id: <12e5ca0ca49040669dee40b6aec39e2a@git.apache.org> In-Reply-To: <9f945b5dbf20413381634a841d402097@git.apache.org> References: <9f945b5dbf20413381634a841d402097@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [27/52] [abbrv] [partial] activemq-artemis git commit: This commit has improvements on the examples including: http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/embedded-remote/pom.xml ---------------------------------------------------------------------- diff --git a/examples/core/embedded-remote/pom.xml b/examples/core/embedded-remote/pom.xml deleted file mode 100644 index 7ba7d7a..0000000 --- a/examples/core/embedded-remote/pom.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq.examples.core - core-examples - 1.0.1-SNAPSHOT - - - artemis-core-embedded-remote-example - jar - ActiveMQ Artemis Core Embedded Remote Example - - - ${project.basedir}/../../.. - - - - - org.apache.activemq - artemis-core-client - ${project.version} - - - org.apache.activemq - artemis-commons - ${project.version} - - - org.apache.activemq - artemis-server - ${project.version} - - - io.netty - netty-all - - - org.apache.geronimo.specs - geronimo-jms_2.0_spec - - - - - - server - - - org.apache.activemq - artemis-server - ${project.version} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.1 - - - package - - java - - - - - org.apache.activemq.artemis.core.example.EmbeddedServer - - - - - - - client - - - org.apache.activemq - artemis-core-client - ${project.version} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.1 - - - package - - java - - - - - org.apache.activemq.artemis.core.example.EmbeddedRemoteExample - - - - - - - http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/embedded-remote/readme.html ---------------------------------------------------------------------- diff --git a/examples/core/embedded-remote/readme.html b/examples/core/embedded-remote/readme.html deleted file mode 100644 index 4e389ad..0000000 --- a/examples/core/embedded-remote/readme.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - ActiveMQ Artemis Embedded Example - - - - - -

Embedded Example

-

This example shows how to setup and run ActiveMQ Artemis embedded with remote clients connecting.

-

ActiveMQ Artemis was designed to use POJOs (Plain Old Java Objects), what makes embedding ActiveMQ Artemis as simple as instantiating a few objects.

- -

ActiveMQ Artemis Embedded could be used from very simple use cases with only InVM support to very complex cases with clustering, persistence and fail over.

- - -

Example step-by-step

-

To run the example, simply type mvn verify -Pserver from this directory to start the server and mvn verify -Pclient to run the client example

-

In this we don't use any configuration files. (Everything is embedded). We simply instantiate ConfigurationImpl, ActiveMQServer, start it and operate on JMS regularly

-
-
    -
  1. On EmbeddedServer: Create the Configuration, and set the properties accordingly
  2. -
    -           Configuration configuration = new ConfigurationImpl();
    -           configuration.setEnablePersistence(false);
    -           configuration.setSecurityEnabled(false);
    -        
    - -
  3. On EmbeddedServer: Create and start the server
  4. -
    -           ActiveMQServer server = ActiveMQ.newActiveMQServer(configuration);
    -           server.start();
    -        
    - -
  5. As we are not using a JNDI environment we instantiate the objects directly
  6. -
    -           ServerLocator serverLocator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName()));
    -           ClientSessionFactory sf = serverLocator.createSessionFactory();
    -        
    - -
  7. Create a Core Queue
  8. -
    -           ClientSession coreSession = sf.createSession(false, false, false);
    -           final String queueName = "queue.exampleQueue";
    -           coreSession.createQueue(queueName, queueName, true);
    -           coreSession.close();
    -        
    - -
  9. Create the session and producer
  10. -
    -           session = sf.createSession();
    -
    -           ClientProducer producer = session.createProducer(queueName);
    -        
    - -
  11. Create and send a Message
  12. -
    -           ClientMessage message = session.createMessage(false);
    -           message.putStringProperty(propName, "Hello sent at " + new Date());
    -           System.out.println("Sending the message.");
    -           producer.send(message);
    -        
    - -
  13. Create the message consumer and start the connection
  14. -
    -           ClientConsumer messageConsumer = session.createConsumer(queueName);
    -           session.start();
    -        
    - -
  15. Receive the message
  16. -
    -           ClientMessage messageReceived = messageConsumer.receive(1000);
    -           System.out.println("Received TextMessage:" + messageReceived.getProperty(propName));
    -        
    - -
  17. Be sure to close our resources!
  18. - -
    -           if (sf != null)
    -           {
    -              sf.close();
    -           }
    -        
    -
- - http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/embedded-remote/src/main/java/org/apache/activemq/artemis/core/example/EmbeddedRemoteExample.java ---------------------------------------------------------------------- diff --git a/examples/core/embedded-remote/src/main/java/org/apache/activemq/artemis/core/example/EmbeddedRemoteExample.java b/examples/core/embedded-remote/src/main/java/org/apache/activemq/artemis/core/example/EmbeddedRemoteExample.java deleted file mode 100644 index cec295a..0000000 --- a/examples/core/embedded-remote/src/main/java/org/apache/activemq/artemis/core/example/EmbeddedRemoteExample.java +++ /dev/null @@ -1,104 +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.core.example; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -import org.apache.activemq.artemis.api.core.TransportConfiguration; -import org.apache.activemq.artemis.api.core.client.ClientConsumer; -import org.apache.activemq.artemis.api.core.client.ClientMessage; -import org.apache.activemq.artemis.api.core.client.ClientProducer; -import org.apache.activemq.artemis.api.core.client.ClientSession; -import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; -import org.apache.activemq.artemis.api.core.client.ActiveMQClient; -import org.apache.activemq.artemis.api.core.client.ServerLocator; -import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory; - -/** - * This example shows how to run an ActiveMQ Artemis core client and server embedded in your - * own application - */ -public class EmbeddedRemoteExample { - - public static void main(final String[] args) { - try { - // Step 3. As we are not using a JNDI environment we instantiate the objects directly - - /** - * this map with configuration values is not necessary (it configures the default values). - * If you modify it to run the example in two different hosts, remember to also modify the - * server's Acceptor at {@link EmbeddedServer} - */ - Map map = new HashMap(); - map.put("host", "localhost"); - map.put("port", 61616); - // ------------------------------------------------------- - - ServerLocator serverLocator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName(), map)); - ClientSessionFactory sf = serverLocator.createSessionFactory(); - - // Step 4. Create a core queue - ClientSession coreSession = sf.createSession(false, false, false); - - final String queueName = "queue.exampleQueue"; - - coreSession.createQueue(queueName, queueName, true); - - coreSession.close(); - - ClientSession session = null; - - try { - - // Step 5. Create the session, and producer - session = sf.createSession(); - - ClientProducer producer = session.createProducer(queueName); - - // Step 6. Create and send a message - ClientMessage message = session.createMessage(false); - - final String propName = "myprop"; - - message.putStringProperty(propName, "Hello sent at " + new Date()); - - System.out.println("Sending the message."); - - producer.send(message); - - // Step 7. Create the message consumer and start the connection - ClientConsumer messageConsumer = session.createConsumer(queueName); - session.start(); - - // Step 8. Receive the message. - ClientMessage messageReceived = messageConsumer.receive(1000); - System.out.println("Received TextMessage:" + messageReceived.getStringProperty(propName)); - } - finally { - // Step 9. Be sure to close our resources! - if (sf != null) { - sf.close(); - } - } - } - catch (Exception e) { - e.printStackTrace(); - } - } -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/embedded-remote/src/main/java/org/apache/activemq/artemis/core/example/EmbeddedServer.java ---------------------------------------------------------------------- diff --git a/examples/core/embedded-remote/src/main/java/org/apache/activemq/artemis/core/example/EmbeddedServer.java b/examples/core/embedded-remote/src/main/java/org/apache/activemq/artemis/core/example/EmbeddedServer.java deleted file mode 100644 index 16993f7..0000000 --- a/examples/core/embedded-remote/src/main/java/org/apache/activemq/artemis/core/example/EmbeddedServer.java +++ /dev/null @@ -1,68 +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.core.example; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; - -import org.apache.activemq.artemis.api.core.TransportConfiguration; -import org.apache.activemq.artemis.core.config.Configuration; -import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; -import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory; -import org.apache.activemq.artemis.core.server.ActiveMQServer; -import org.apache.activemq.artemis.core.server.ActiveMQServers; - -/** - * An EmbeddedServer - */ -public class EmbeddedServer { - - public static void main(final String arg[]) throws Exception { - try { - // Step 1. Create the Configuration, and set the properties accordingly - Configuration configuration = new ConfigurationImpl(); - //we only need this for the server lock file - configuration.setJournalDirectory("target/data/journal"); - configuration.setPersistenceEnabled(false); - configuration.setSecurityEnabled(false); - /** - * this map with configuration values is not necessary (it configures the default values). - * If you want to modify it to run the example in two different hosts, remember to also - * modify the client's Connector at {@link EmbeddedRemoteExample}. - */ - Map map = new HashMap(); - map.put("host", "localhost"); - map.put("port", 61616); - - TransportConfiguration transpConf = new TransportConfiguration(NettyAcceptorFactory.class.getName(), map); - - HashSet setTransp = new HashSet(); - setTransp.add(transpConf); - - configuration.setAcceptorConfigurations(setTransp); - - // Step 2. Create and start the server - ActiveMQServer server = ActiveMQServers.newActiveMQServer(configuration); - server.start(); - } - catch (Exception e) { - e.printStackTrace(); - throw e; - } - } -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/embedded/pom.xml ---------------------------------------------------------------------- diff --git a/examples/core/embedded/pom.xml b/examples/core/embedded/pom.xml deleted file mode 100644 index ebe5254..0000000 --- a/examples/core/embedded/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq.examples.core - core-examples - 1.0.1-SNAPSHOT - - - artemis-core-embedded-example - jar - ActiveMQ Artemis Core Embedded Example - - - ${project.basedir}/../../.. - - - - - org.apache.activemq - artemis-server - ${project.version} - - - org.apache.activemq - artemis-core-client - ${project.version} - - - org.apache.activemq - artemis-commons - ${project.version} - - - io.netty - netty-all - - - org.apache.geronimo.specs - geronimo-jms_2.0_spec - - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.1 - - - package - - java - - - - - org.apache.activemq.artemis.core.example.EmbeddedExample - - - - - http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/embedded/readme.html ---------------------------------------------------------------------- diff --git a/examples/core/embedded/readme.html b/examples/core/embedded/readme.html deleted file mode 100644 index d65caa2..0000000 --- a/examples/core/embedded/readme.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - ActiveMQ Artemis Embedded Example - - - - - -

Embedded Example

- -

This example shows how to setup and run ActiveMQ Artemis embedded.

-

ActiveMQ Artemis was designed to use POJOs (Plain Old Java Objects), what makes embedding ActiveMQ Artemis as simple as instantiating a few objects.

-

In this example, we are using two jars:

-
    -
  • activemq-server.jar
  • -
  • netty.jar
  • -
- -

ActiveMQ Artemis Embedded could be used from very simple use cases with only InVM support to very complex cases with clustering, persistence and fail over.

- -

Example step-by-step

-

To run the example, simply type mvn verify from this directory

-

In this we don't use any configuration files. (Everything is embedded). We simply instantiate ConfigurationImpl, ActiveMQServer, start it and operate on JMS regularly

- -
    -
  1. Create the Configuration, and set the properties accordingly
  2. -
    -           Configuration configuration = new ConfigurationImpl();
    -           configuration.setEnablePersistence(false);
    -           configuration.setSecurityEnabled(false);
    -           configuration.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
    -        
    - -
  3. Create and start the server
  4. -
    -           ActiveMQServer server = ActiveMQ.newActiveMQServer(configuration);
    -           server.start();
    -        
    - -
  5. As we are not using a JNDI environment we instantiate the objects directly
  6. -
    -           ServerLocator serverLocator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getName()));
    -           ClientSessionFactory sf = serverLocator.createSessionFactory();
    -        
    - -
  7. Create a Core Queue
  8. -
    -           ClientSession coreSession = sf.createSession(false, false, false);
    -           final String queueName = "queue.exampleQueue";
    -           coreSession.createQueue(queueName, queueName, true);
    -           coreSession.close();
    -        
    - -
  9. Create the session and producer
  10. -
    -            session = sf.createSession();
    -
    -            ClientProducer producer = session.createProducer(queueName);
    -        
    - -
  11. Create and send a Message
  12. -
    -           ClientMessage message = session.createMessage(false);
    -           message.putStringProperty(propName, "Hello sent at " + new Date());
    -           System.out.println("Sending the message.");
    -           producer.send(message);
    -        
    - -
  13. Create the message consumer and start the connection
  14. -
    -           ClientConsumer messageConsumer = session.createConsumer(queueName);
    -           session.start();
    -        
    - -
  15. Receive the message
  16. -
    -           ClientMessage messageReceived = messageConsumer.receive(1000);
    -           System.out.println("Received TextMessage:" + messageReceived.getProperty(propName));
    -        
    - -
  17. Be sure to close our resources!
  18. - -
    -           if (sf != null)
    -           {
    -              sf.close();
    -           }
    -        
    - -
  19. Stop the server
  20. - -
    -           server.stop();
    -        
    -
- - http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/embedded/src/main/java/org/apache/activemq/artemis/core/example/EmbeddedExample.java ---------------------------------------------------------------------- diff --git a/examples/core/embedded/src/main/java/org/apache/activemq/artemis/core/example/EmbeddedExample.java b/examples/core/embedded/src/main/java/org/apache/activemq/artemis/core/example/EmbeddedExample.java deleted file mode 100644 index d3f8f86..0000000 --- a/examples/core/embedded/src/main/java/org/apache/activemq/artemis/core/example/EmbeddedExample.java +++ /dev/null @@ -1,112 +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.core.example; - -import java.util.Date; - -import org.apache.activemq.artemis.api.core.TransportConfiguration; -import org.apache.activemq.artemis.api.core.client.ClientConsumer; -import org.apache.activemq.artemis.api.core.client.ClientMessage; -import org.apache.activemq.artemis.api.core.client.ClientProducer; -import org.apache.activemq.artemis.api.core.client.ClientSession; -import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; -import org.apache.activemq.artemis.api.core.client.ActiveMQClient; -import org.apache.activemq.artemis.api.core.client.ServerLocator; -import org.apache.activemq.artemis.core.config.Configuration; -import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; -import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; -import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory; -import org.apache.activemq.artemis.core.server.ActiveMQServer; -import org.apache.activemq.artemis.core.server.ActiveMQServers; - -/** - * This example shows how to run an ActiveMQ Artemis core client and server embedded in your - * own application - */ -public class EmbeddedExample { - - public static void main(final String[] args) throws Exception { - try { - // Step 1. Create the Configuration, and set the properties accordingly - Configuration configuration = new ConfigurationImpl(); - //we only need this for the server lock file - configuration.setJournalDirectory("target/data/journal"); - configuration.setPersistenceEnabled(false); - configuration.setSecurityEnabled(false); - configuration.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName())); - - // Step 2. Create and start the server - ActiveMQServer server = ActiveMQServers.newActiveMQServer(configuration); - server.start(); - - // Step 3. As we are not using a JNDI environment we instantiate the objects directly - ServerLocator serverLocator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getName())); - ClientSessionFactory sf = serverLocator.createSessionFactory(); - - // Step 4. Create a core queue - ClientSession coreSession = sf.createSession(false, false, false); - - final String queueName = "queue.exampleQueue"; - - coreSession.createQueue(queueName, queueName, true); - - coreSession.close(); - - ClientSession session = null; - - try { - - // Step 5. Create the session, and producer - session = sf.createSession(); - - ClientProducer producer = session.createProducer(queueName); - - // Step 6. Create and send a message - ClientMessage message = session.createMessage(false); - - final String propName = "myprop"; - - message.putStringProperty(propName, "Hello sent at " + new Date()); - - System.out.println("Sending the message."); - - producer.send(message); - - // Step 7. Create the message consumer and start the connection - ClientConsumer messageConsumer = session.createConsumer(queueName); - session.start(); - - // Step 8. Receive the message. - ClientMessage messageReceived = messageConsumer.receive(1000); - System.out.println("Received TextMessage:" + messageReceived.getStringProperty(propName)); - } - finally { - // Step 9. Be sure to close our resources! - if (sf != null) { - sf.close(); - } - - // Step 10. Stop the server - server.stop(); - } - } - catch (Exception e) { - e.printStackTrace(); - throw e; - } - } -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/perf/perf.properties ---------------------------------------------------------------------- diff --git a/examples/core/perf/perf.properties b/examples/core/perf/perf.properties deleted file mode 100644 index 9a53c8b..0000000 --- a/examples/core/perf/perf.properties +++ /dev/null @@ -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. - -num-messages=100000 -num-warmup-messages=1000 -message-size=1024 -durable=false -transacted=false -batch-size=1048576 -drain-queue=false -throttle-rate=-1 -address=perfAddress -queue-name=perfQueue -host=localhost -port=61616 -tcp-buffer=2048576 -tcp-no-delay=false -confirmation-window=1048576 -producer-window=1048576 -consumer-window=1048576 -pre-ack=false -block-ack=false -block-persistent=false -use-send-acks=true http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/perf/pom.xml ---------------------------------------------------------------------- diff --git a/examples/core/perf/pom.xml b/examples/core/perf/pom.xml deleted file mode 100644 index 0681d2a..0000000 --- a/examples/core/perf/pom.xml +++ /dev/null @@ -1,163 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq.examples.core - core-examples - 1.0.1-SNAPSHOT - - - artemis-core-perf-example - jar - ActiveMQ Artemis Perf Example - - - ${project.basedir}/../../.. - - - - - org.apache.activemq - artemis-core-client - ${project.version} - - - org.apache.activemq - artemis-commons - ${project.version} - - - io.netty - netty-all - ${netty.version} - - - org.apache.geronimo.specs - geronimo-jms_2.0_spec - - - - - - server - - - - org.apache.activemq - artemis-maven-plugin - - - create0 - - create - - - ${basedir}/target/server0 - ${basedir}/target/classes/activemq/server0 - - - - - - org.apache.activemq.examples.core - artemis-core-perf-example - ${project.version} - - - org.apache.activemq - artemis-core-client - ${project.version} - - - org.apache.activemq - artemis-server - ${project.version} - - - org.apache.activemq - artemis-jms-client - ${project.version} - - - org.apache.activemq - artemis-jms-server - ${project.version} - - - io.netty - netty-all - ${netty.version} - - - - - - - - listener - - - - org.codehaus.mojo - exec-maven-plugin - 1.1 - - - package - - java - - - - - org.apache.activemq.artemis.core.example.PerfListener - - - - - - - sender - - - - org.codehaus.mojo - exec-maven-plugin - 1.1 - - - package - - java - - - - - org.apache.activemq.artemis.core.example.PerfSender - - - - - - - http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfBase.java ---------------------------------------------------------------------- diff --git a/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfBase.java b/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfBase.java deleted file mode 100644 index c1988c9..0000000 --- a/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfBase.java +++ /dev/null @@ -1,474 +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.core.example; - -import java.io.FileInputStream; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; -import java.util.Random; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.atomic.AtomicLong; -import java.util.logging.Logger; - -import org.apache.activemq.artemis.api.core.Message; -import org.apache.activemq.artemis.api.core.TransportConfiguration; -import org.apache.activemq.artemis.api.core.client.ClientConsumer; -import org.apache.activemq.artemis.api.core.client.ClientMessage; -import org.apache.activemq.artemis.api.core.client.ClientProducer; -import org.apache.activemq.artemis.api.core.client.ClientSession; -import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; -import org.apache.activemq.artemis.api.core.client.ActiveMQClient; -import org.apache.activemq.artemis.api.core.client.MessageHandler; -import org.apache.activemq.artemis.api.core.client.SendAcknowledgementHandler; -import org.apache.activemq.artemis.api.core.client.ServerLocator; -import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory; -import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; -import org.apache.activemq.artemis.utils.TokenBucketLimiter; -import org.apache.activemq.artemis.utils.TokenBucketLimiterImpl; - -/** - * A PerfBase - */ -public abstract class PerfBase { - - private static final Logger log = Logger.getLogger(PerfSender.class.getName()); - - private static final String DEFAULT_PERF_PROPERTIES_FILE_NAME = "perf.properties"; - - private static byte[] randomByteArray(final int length) { - byte[] bytes = new byte[length]; - - Random random = new Random(); - - for (int i = 0; i < length; i++) { - bytes[i] = Integer.valueOf(random.nextInt()).byteValue(); - } - - return bytes; - } - - protected static String getPerfFileName(final String[] args) { - String fileName; - - if (args.length > 0) { - fileName = args[0]; - } - else { - fileName = PerfBase.DEFAULT_PERF_PROPERTIES_FILE_NAME; - } - - PerfBase.log.info("Using file name " + fileName); - - return fileName; - } - - protected static PerfParams getParams(final String fileName) throws Exception { - Properties props = null; - - InputStream is = null; - - try { - is = new FileInputStream(fileName); - - props = new Properties(); - - props.load(is); - } - finally { - if (is != null) { - is.close(); - } - } - - int noOfMessages = Integer.valueOf(props.getProperty("num-messages")); - int noOfWarmupMessages = Integer.valueOf(props.getProperty("num-warmup-messages")); - int messageSize = Integer.valueOf(props.getProperty("message-size")); - boolean durable = Boolean.valueOf(props.getProperty("durable")); - boolean transacted = Boolean.valueOf(props.getProperty("transacted")); - int batchSize = Integer.valueOf(props.getProperty("batch-size")); - boolean drainQueue = Boolean.valueOf(props.getProperty("drain-queue")); - String queueName = props.getProperty("queue-name"); - String address = props.getProperty("address"); - int throttleRate = Integer.valueOf(props.getProperty("throttle-rate")); - String host = props.getProperty("host"); - int port = Integer.valueOf(props.getProperty("port")); - int tcpBufferSize = Integer.valueOf(props.getProperty("tcp-buffer")); - boolean tcpNoDelay = Boolean.valueOf(props.getProperty("tcp-no-delay")); - boolean preAck = Boolean.valueOf(props.getProperty("pre-ack")); - int confirmationWindowSize = Integer.valueOf(props.getProperty("confirmation-window")); - int producerWindowSize = Integer.valueOf(props.getProperty("producer-window")); - int consumerWindowSize = Integer.valueOf(props.getProperty("consumer-window")); - boolean blockOnACK = Boolean.valueOf(props.getProperty("block-ack", "false")); - boolean blockOnPersistent = Boolean.valueOf(props.getProperty("block-persistent", "false")); - boolean useSendAcks = Boolean.valueOf(props.getProperty("use-send-acks", "false")); - - PerfBase.log.info("num-messages: " + noOfMessages); - PerfBase.log.info("num-warmup-messages: " + noOfWarmupMessages); - PerfBase.log.info("message-size: " + messageSize); - PerfBase.log.info("durable: " + durable); - PerfBase.log.info("transacted: " + transacted); - PerfBase.log.info("batch-size: " + batchSize); - PerfBase.log.info("drain-queue: " + drainQueue); - PerfBase.log.info("address: " + address); - PerfBase.log.info("queue name: " + queueName); - PerfBase.log.info("throttle-rate: " + throttleRate); - PerfBase.log.info("host:" + host); - PerfBase.log.info("port: " + port); - PerfBase.log.info("tcp buffer: " + tcpBufferSize); - PerfBase.log.info("tcp no delay: " + tcpNoDelay); - PerfBase.log.info("pre-ack: " + preAck); - PerfBase.log.info("confirmation-window: " + confirmationWindowSize); - PerfBase.log.info("producer-window: " + producerWindowSize); - PerfBase.log.info("consumer-window: " + consumerWindowSize); - PerfBase.log.info("block-ack:" + blockOnACK); - PerfBase.log.info("block-persistent:" + blockOnPersistent); - PerfBase.log.info("use-send-acks:" + useSendAcks); - - if (useSendAcks && confirmationWindowSize < 1) { - throw new IllegalArgumentException("If you use send acks, then need to set confirmation-window-size to a positive integer"); - } - - PerfParams perfParams = new PerfParams(); - perfParams.setNoOfMessagesToSend(noOfMessages); - perfParams.setNoOfWarmupMessages(noOfWarmupMessages); - perfParams.setMessageSize(messageSize); - perfParams.setDurable(durable); - perfParams.setSessionTransacted(transacted); - perfParams.setBatchSize(batchSize); - perfParams.setDrainQueue(drainQueue); - perfParams.setQueueName(queueName); - perfParams.setAddress(address); - perfParams.setThrottleRate(throttleRate); - perfParams.setHost(host); - perfParams.setPort(port); - perfParams.setTcpBufferSize(tcpBufferSize); - perfParams.setTcpNoDelay(tcpNoDelay); - perfParams.setPreAck(preAck); - perfParams.setConfirmationWindow(confirmationWindowSize); - perfParams.setProducerWindow(producerWindowSize); - perfParams.setConsumerWindow(consumerWindowSize); - perfParams.setBlockOnACK(blockOnACK); - perfParams.setBlockOnPersistent(blockOnPersistent); - perfParams.setUseSendAcks(useSendAcks); - - return perfParams; - } - - private final PerfParams perfParams; - - protected PerfBase(final PerfParams perfParams) { - this.perfParams = perfParams; - } - - private ClientSessionFactory factory; - - private long start; - - private void init(final boolean transacted, final String queueName) throws Exception { - Map params = new HashMap(); - - params.put(TransportConstants.TCP_NODELAY_PROPNAME, perfParams.isTcpNoDelay()); - params.put(TransportConstants.TCP_SENDBUFFER_SIZE_PROPNAME, perfParams.getTcpBufferSize()); - params.put(TransportConstants.TCP_RECEIVEBUFFER_SIZE_PROPNAME, perfParams.getTcpBufferSize()); - - params.put(TransportConstants.HOST_PROP_NAME, perfParams.getHost()); - params.put(TransportConstants.PORT_PROP_NAME, perfParams.getPort()); - - ServerLocator serverLocator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName(), params)); - serverLocator.setPreAcknowledge(perfParams.isPreAck()); - serverLocator.setConfirmationWindowSize(perfParams.getConfirmationWindow()); - serverLocator.setProducerWindowSize(perfParams.getProducerWindow()); - serverLocator.setConsumerWindowSize(perfParams.getConsumerWindow()); - serverLocator.setAckBatchSize(perfParams.getBatchSize()); - - serverLocator.setBlockOnAcknowledge(perfParams.isBlockOnACK()); - serverLocator.setBlockOnDurableSend(perfParams.isBlockOnPersistent()); - factory = serverLocator.createSessionFactory(); - - } - - private void displayAverage(final long numberOfMessages, final long start, final long end) { - double duration = (1.0 * end - start) / 1000; // in seconds - double average = 1.0 * numberOfMessages / duration; - PerfBase.log.info(String.format("average: %.2f msg/s (%d messages in %2.2fs)", average, numberOfMessages, duration)); - } - - protected void runSender() { - try { - PerfBase.log.info("params = " + perfParams); - - init(perfParams.isSessionTransacted(), perfParams.getQueueName()); - - if (perfParams.isDrainQueue()) { - drainQueue(); - } - - start = System.currentTimeMillis(); - PerfBase.log.info("warming up by sending " + perfParams.getNoOfWarmupMessages() + " messages"); - sendMessages(perfParams.getNoOfWarmupMessages(), perfParams.getBatchSize(), perfParams.isDurable(), perfParams.isSessionTransacted(), false, perfParams.getThrottleRate(), perfParams.getMessageSize(), perfParams.isUseSendAcks()); - PerfBase.log.info("warmed up"); - start = System.currentTimeMillis(); - sendMessages(perfParams.getNoOfMessagesToSend(), perfParams.getBatchSize(), perfParams.isDurable(), perfParams.isSessionTransacted(), true, perfParams.getThrottleRate(), perfParams.getMessageSize(), perfParams.isUseSendAcks()); - long end = System.currentTimeMillis(); - displayAverage(perfParams.getNoOfMessagesToSend(), start, end); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - protected void runListener() { - ClientSession session = null; - - try { - init(perfParams.isSessionTransacted(), perfParams.getQueueName()); - - session = factory.createSession(!perfParams.isSessionTransacted(), !perfParams.isSessionTransacted()); - - if (perfParams.isDrainQueue()) { - drainQueue(); - } - - ClientConsumer consumer = session.createConsumer(perfParams.getQueueName()); - - session.start(); - - PerfBase.log.info("READY!!!"); - - CountDownLatch countDownLatch = new CountDownLatch(1); - consumer.setMessageHandler(new PerfListener(session, countDownLatch, perfParams)); - countDownLatch.await(); - long end = System.currentTimeMillis(); - // start was set on the first received message - displayAverage(perfParams.getNoOfMessagesToSend(), start, end); - } - catch (Exception e) { - e.printStackTrace(); - } - finally { - if (factory != null) { - try { - factory.close(); - } - catch (Exception e) { - e.printStackTrace(); - } - } - } - } - - private void drainQueue() throws Exception { - PerfBase.log.info("Draining queue"); - - ClientSession session = null; - - try { - session = factory.createSession(); - - ClientConsumer consumer = session.createConsumer(perfParams.getQueueName()); - - session.start(); - - ClientMessage message = null; - - int count = 0; - do { - message = consumer.receive(3000); - - if (message != null) { - message.acknowledge(); - - count++; - } - } while (message != null); - - PerfBase.log.info("Drained " + count + " messages"); - } - finally { - if (session != null) { - session.close(); - } - } - } - - private void sendMessages(final int numberOfMessages, - final int txBatchSize, - final boolean durable, - final boolean transacted, - final boolean display, - final int throttleRate, - final int messageSize, - final boolean useSendAcks) throws Exception { - ClientSession session = null; - - try { - session = factory.createSession(!transacted, !transacted); - - CountDownLatch theLatch = null; - - if (useSendAcks) { - final CountDownLatch latch = new CountDownLatch(numberOfMessages); - - class MySendAckHandler implements SendAcknowledgementHandler { - - public void sendAcknowledged(Message message) { - latch.countDown(); - } - } - - session.setSendAcknowledgementHandler(new MySendAckHandler()); - - theLatch = latch; - } - - ClientProducer producer = session.createProducer(perfParams.getAddress()); - - ClientMessage message = session.createMessage(durable); - - byte[] payload = PerfBase.randomByteArray(messageSize); - - message.getBodyBuffer().writeBytes(payload); - - final int modulo = 2000; - - TokenBucketLimiter tbl = throttleRate != -1 ? new TokenBucketLimiterImpl(throttleRate, false) : null; - - boolean committed = false; - - for (int i = 1; i <= numberOfMessages; i++) { - producer.send(message); - - if (transacted) { - if (i % txBatchSize == 0) { - session.commit(); - committed = true; - } - else { - committed = false; - } - } - if (display && i % modulo == 0) { - double duration = (1.0 * System.currentTimeMillis() - start) / 1000; - PerfBase.log.info(String.format("sent %6d messages in %2.2fs", i, duration)); - } - - // log.info("sent message " + i); - - if (tbl != null) { - tbl.limit(); - } - } - - if (transacted && !committed) { - session.commit(); - } - - session.close(); - - if (useSendAcks) { - theLatch.await(); - } - } - finally { - if (session != null) { - session.close(); - } - } - } - - private class PerfListener implements MessageHandler { - - private final CountDownLatch countDownLatch; - - private final PerfParams perfParams; - - private boolean warmingUp = true; - - private boolean started = false; - - private final int modulo; - - private final AtomicLong count = new AtomicLong(0); - - private final ClientSession session; - - public PerfListener(final ClientSession session, - final CountDownLatch countDownLatch, - final PerfParams perfParams) { - this.session = session; - this.countDownLatch = countDownLatch; - this.perfParams = perfParams; - warmingUp = perfParams.getNoOfWarmupMessages() > 0; - modulo = 2000; - } - - public void onMessage(final ClientMessage message) { - try { - if (warmingUp) { - boolean committed = checkCommit(session); - if (count.incrementAndGet() == perfParams.getNoOfWarmupMessages()) { - PerfBase.log.info("warmed up after receiving " + count.longValue() + " msgs"); - if (!committed) { - checkCommit(session); - } - warmingUp = false; - } - return; - } - - if (!started) { - started = true; - // reset count to take stats - count.set(0); - start = System.currentTimeMillis(); - } - - message.acknowledge(); - - long currentCount = count.incrementAndGet(); - boolean committed = checkCommit(session); - if (currentCount == perfParams.getNoOfMessagesToSend()) { - if (!committed) { - checkCommit(session); - } - countDownLatch.countDown(); - } - if (currentCount % modulo == 0) { - double duration = (1.0 * System.currentTimeMillis() - start) / 1000; - PerfBase.log.info(String.format("received %6d messages in %2.2fs", currentCount, duration)); - } - } - catch (Exception e) { - e.printStackTrace(); - } - } - - private boolean checkCommit(final ClientSession session) throws Exception { - if (perfParams.isSessionTransacted()) { - if (count.longValue() % perfParams.getBatchSize() == 0) { - session.commit(); - - return true; - } - } - return false; - } - } - -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfListener.java ---------------------------------------------------------------------- diff --git a/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfListener.java b/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfListener.java deleted file mode 100644 index 1ad3257..0000000 --- a/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfListener.java +++ /dev/null @@ -1,46 +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.core.example; - -import java.util.logging.Logger; - -public class PerfListener extends PerfBase { - - private static final Logger log = Logger.getLogger(PerfListener.class.getName()); - - public static void main(final String[] args) { - try { - String fileName = PerfBase.getPerfFileName(args); - - PerfParams params = PerfBase.getParams(fileName); - - new PerfListener(params).run(); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - private PerfListener(final PerfParams perfParams) { - super(perfParams); - } - - public void run() throws Exception { - runListener(); - } - -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfParams.java ---------------------------------------------------------------------- diff --git a/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfParams.java b/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfParams.java deleted file mode 100644 index 933322a..0000000 --- a/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfParams.java +++ /dev/null @@ -1,257 +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.core.example; - -import java.io.Serializable; - -/** - * Class that holds the parameters used in the performance examples - */ -public class PerfParams implements Serializable { - - private static final long serialVersionUID = -4336539641012356002L; - - private int noOfMessagesToSend = 1000; - - private int noOfWarmupMessages; - - private int messageSize = 1024; // in bytes - - private boolean durable = false; - - private boolean isSessionTransacted = false; - - private int batchSize = 5000; - - private boolean drainQueue = true; - - private String queueName; - - private String address; - - private int throttleRate; - - private String host; - - private int port; - - private int tcpBufferSize; - - private boolean tcpNoDelay; - - private boolean preAck; - - private int confirmationWindow = -1; - - private int producerWindow; - - private int consumerWindow; - - private boolean blockOnPersistent = true; - - private boolean blockOnACK = true; - - private boolean useSendAcks; - - public boolean isBlockOnPersistent() { - return blockOnPersistent; - } - - public void setBlockOnPersistent(final boolean blockOnPersistent) { - this.blockOnPersistent = blockOnPersistent; - } - - public boolean isBlockOnACK() { - return blockOnACK; - } - - public void setBlockOnACK(final boolean blockOnACK) { - this.blockOnACK = blockOnACK; - } - - public int getNoOfMessagesToSend() { - return noOfMessagesToSend; - } - - public void setNoOfMessagesToSend(final int noOfMessagesToSend) { - this.noOfMessagesToSend = noOfMessagesToSend; - } - - public int getNoOfWarmupMessages() { - return noOfWarmupMessages; - } - - public void setNoOfWarmupMessages(final int noOfWarmupMessages) { - this.noOfWarmupMessages = noOfWarmupMessages; - } - - public int getMessageSize() { - return messageSize; - } - - public void setMessageSize(final int messageSize) { - this.messageSize = messageSize; - } - - public boolean isDurable() { - return durable; - } - - public void setDurable(final boolean durable) { - this.durable = durable; - } - - public boolean isSessionTransacted() { - return isSessionTransacted; - } - - public void setSessionTransacted(final boolean sessionTransacted) { - isSessionTransacted = sessionTransacted; - } - - public int getBatchSize() { - return batchSize; - } - - public void setBatchSize(final int batchSize) { - this.batchSize = batchSize; - } - - public boolean isDrainQueue() { - return drainQueue; - } - - public void setDrainQueue(final boolean drainQueue) { - this.drainQueue = drainQueue; - } - - public String getQueueName() { - return queueName; - } - - public void setQueueName(final String queueName) { - this.queueName = queueName; - } - - public String getAddress() { - return address; - } - - public void setAddress(final String address) { - this.address = address; - } - - public int getThrottleRate() { - return throttleRate; - } - - public void setThrottleRate(final int throttleRate) { - this.throttleRate = throttleRate; - } - - @Override - public String toString() { - return "message to send = " + noOfMessagesToSend + - ", Durable = " + - durable + - ", session transacted = " + - isSessionTransacted + - (isSessionTransacted ? ", transaction batch size = " + batchSize : "") + - ", drain queue = " + - drainQueue + - ", queue name = " + - queueName + - ", Throttle rate = " + - throttleRate + - ", blockOnPersistent = " + - blockOnPersistent + - ". blockOnACK = " + - blockOnACK; - } - - public synchronized String getHost() { - return host; - } - - public synchronized void setHost(final String host) { - this.host = host; - } - - public synchronized int getPort() { - return port; - } - - public synchronized void setPort(final int port) { - this.port = port; - } - - public synchronized int getTcpBufferSize() { - return tcpBufferSize; - } - - public synchronized void setTcpBufferSize(final int tcpBufferSize) { - this.tcpBufferSize = tcpBufferSize; - } - - public synchronized boolean isTcpNoDelay() { - return tcpNoDelay; - } - - public synchronized void setTcpNoDelay(final boolean tcpNoDelay) { - this.tcpNoDelay = tcpNoDelay; - } - - public synchronized boolean isPreAck() { - return preAck; - } - - public synchronized void setPreAck(final boolean preAck) { - this.preAck = preAck; - } - - public synchronized int getConfirmationWindow() { - return confirmationWindow; - } - - public synchronized void setConfirmationWindow(final int confirmationWindow) { - this.confirmationWindow = confirmationWindow; - } - - public int getProducerWindow() { - return producerWindow; - } - - public void setProducerWindow(final int producerWindow) { - this.producerWindow = producerWindow; - } - - public int getConsumerWindow() { - return consumerWindow; - } - - public void setConsumerWindow(final int consumerWindow) { - this.consumerWindow = consumerWindow; - } - - public boolean isUseSendAcks() { - return useSendAcks; - } - - public void setUseSendAcks(boolean useSendAcks) { - this.useSendAcks = useSendAcks; - } -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfSender.java ---------------------------------------------------------------------- diff --git a/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfSender.java b/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfSender.java deleted file mode 100644 index 4fed6b5..0000000 --- a/examples/core/perf/src/main/java/org/apache/activemq/artemis/core/example/PerfSender.java +++ /dev/null @@ -1,46 +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.core.example; - -import java.util.logging.Logger; - -public class PerfSender extends PerfBase { - - private static final Logger log = Logger.getLogger(PerfSender.class.getName()); - - public static void main(final String[] args) { - try { - String fileName = PerfBase.getPerfFileName(args); - - PerfParams params = PerfBase.getParams(fileName); - - new PerfSender(params).run(); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - private PerfSender(final PerfParams perfParams) { - super(perfParams); - } - - public void run() throws Exception { - runSender(); - } - -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/perf/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/core/perf/src/main/resources/activemq/server0/broker.xml b/examples/core/perf/src/main/resources/activemq/server0/broker.xml deleted file mode 100644 index 6e787fb..0000000 --- a/examples/core/perf/src/main/resources/activemq/server0/broker.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - ./data/bindings - - ./data/journal - - ./data/largemessages - - ./data/paging - - - - tcp://localhost:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576 - - - false - - true - - true - true - ASYNCIO - 20 - 20000 - false - false - - - - - -
perfAddress
-
-
- - -
- -
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/perf/src/main/resources/activemq/server0/hornetq-configuration-messaging-lab.xml ---------------------------------------------------------------------- diff --git a/examples/core/perf/src/main/resources/activemq/server0/hornetq-configuration-messaging-lab.xml b/examples/core/perf/src/main/resources/activemq/server0/hornetq-configuration-messaging-lab.xml deleted file mode 100644 index 74b120e..0000000 --- a/examples/core/perf/src/main/resources/activemq/server0/hornetq-configuration-messaging-lab.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - tcp://172.16.8.10:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576 - - - false - - true - - /activemq-data/large-messages - /activemq-data/bindings - /activemq-data/journal - /activemq-data/paging - - - -
perfAddress
-
-
-
- -
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/pom.xml ---------------------------------------------------------------------- diff --git a/examples/core/pom.xml b/examples/core/pom.xml deleted file mode 100644 index fd3ba18..0000000 --- a/examples/core/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq.examples - artemis-examples - 1.0.1-SNAPSHOT - - - org.apache.activemq.examples.core - core-examples - pom - ActiveMQ Artemis Core Examples - - - 231.7.7.7 - ${project.basedir}/../.. - - - - - - examples - - embedded - embedded-remote - perf - vertx-connector - - - - - http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/core/vertx-connector/pom.xml ---------------------------------------------------------------------- diff --git a/examples/core/vertx-connector/pom.xml b/examples/core/vertx-connector/pom.xml deleted file mode 100644 index 8d8ba8e..0000000 --- a/examples/core/vertx-connector/pom.xml +++ /dev/null @@ -1,189 +0,0 @@ - - - - - 4.0.0 - - - org.apache.activemq.examples.core - core-examples - 1.0.1-SNAPSHOT - - - artemis-vertx-example - jar - ActiveMQ Artemis Vert.x Example - - - ${project.basedir}/../../.. - 2.1.2 - - - - - org.apache.activemq - artemis-server - ${project.version} - - - org.apache.activemq - artemis-core-client - ${project.version} - - - org.apache.activemq - artemis-commons - ${project.version} - - - io.netty - netty-all - ${netty.version} - - - org.apache.geronimo.specs - geronimo-jms_2.0_spec - - - io.vertx - vertx-core - ${vertx.version} - provided - - - io.vertx - vertx-platform - ${vertx.version} - provided - - - io.vertx - vertx-hazelcast - ${vertx.version} - provided - - - org.apache.activemq - artemis-vertx-integration - ${project.version} - - - - - - example - - - - org.apache.activemq - artemis-maven-plugin - - - create0 - - create - - - ${basedir}/target/server0 - ${basedir}/target/classes/activemq/server0 - - - - start0 - - cli - - - true - ${basedir}/target/server0 - tcp://localhost:61616 - - run - - - - - runClient - - runClient - - - org.apache.activemq.artemis.core.example.VertxConnectorExample - - - - - - org.apache.activemq.examples.core - artemis-vertx-example - ${project.version} - - - org.apache.activemq - artemis-vertx-integration - ${project.version} - - - org.apache.activemq - artemis-core-client - ${project.version} - - - org.apache.activemq - artemis-server - ${project.version} - - - org.apache.activemq - artemis-jms-client - ${project.version} - - - org.apache.activemq - artemis-jms-server - ${project.version} - - - io.netty - netty-all - ${netty.version} - - - io.vertx - vertx-core - ${vertx.version} - - - io.vertx - vertx-platform - ${vertx.version} - - - io.vertx - vertx-hazelcast - ${vertx.version} - - - - - - - -