http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfParams.java ---------------------------------------------------------------------- diff --git a/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfParams.java b/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfParams.java deleted file mode 100644 index c358171..0000000 --- a/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfParams.java +++ /dev/null @@ -1,158 +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.jms.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 connectionFactoryLookup; - - private String destinationLookup; - - private int throttleRate; - - private boolean disableMessageID; - - private boolean disableTimestamp; - - private boolean dupsOK; - - public synchronized int getNoOfMessagesToSend() { - return noOfMessagesToSend; - } - - public synchronized void setNoOfMessagesToSend(final int noOfMessagesToSend) { - this.noOfMessagesToSend = noOfMessagesToSend; - } - - public synchronized int getNoOfWarmupMessages() { - return noOfWarmupMessages; - } - - public synchronized void setNoOfWarmupMessages(final int noOfWarmupMessages) { - this.noOfWarmupMessages = noOfWarmupMessages; - } - - public synchronized int getMessageSize() { - return messageSize; - } - - public synchronized void setMessageSize(final int messageSize) { - this.messageSize = messageSize; - } - - public synchronized boolean isDurable() { - return durable; - } - - public synchronized void setDurable(final boolean durable) { - this.durable = durable; - } - - public synchronized boolean isSessionTransacted() { - return isSessionTransacted; - } - - public synchronized void setSessionTransacted(final boolean isSessionTransacted) { - this.isSessionTransacted = isSessionTransacted; - } - - public synchronized int getBatchSize() { - return batchSize; - } - - public synchronized void setBatchSize(final int batchSize) { - this.batchSize = batchSize; - } - - public synchronized boolean isDrainQueue() { - return drainQueue; - } - - public synchronized void setDrainQueue(final boolean drainQueue) { - this.drainQueue = drainQueue; - } - - public synchronized String getConnectionFactoryLookup() { - return connectionFactoryLookup; - } - - public synchronized void setConnectionFactoryLookup(final String connectionFactoryLookup) { - this.connectionFactoryLookup = connectionFactoryLookup; - } - - public synchronized String getDestinationLookup() { - return destinationLookup; - } - - public synchronized void setDestinationLookup(final String destinationLookup) { - this.destinationLookup = destinationLookup; - } - - public synchronized int getThrottleRate() { - return throttleRate; - } - - public synchronized void setThrottleRate(final int throttleRate) { - this.throttleRate = throttleRate; - } - - public synchronized boolean isDisableMessageID() { - return disableMessageID; - } - - public synchronized void setDisableMessageID(final boolean disableMessageID) { - this.disableMessageID = disableMessageID; - } - - public synchronized boolean isDisableTimestamp() { - return disableTimestamp; - } - - public synchronized void setDisableTimestamp(final boolean disableTimestamp) { - this.disableTimestamp = disableTimestamp; - } - - public synchronized boolean isDupsOK() { - return dupsOK; - } - - public synchronized void setDupsOK(final boolean dupsOK) { - this.dupsOK = dupsOK; - } - -}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfSender.java ---------------------------------------------------------------------- diff --git a/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfSender.java b/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfSender.java deleted file mode 100644 index 6649bfa..0000000 --- a/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/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.jms.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/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java ---------------------------------------------------------------------- diff --git a/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java b/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java deleted file mode 100644 index 14a8e7a..0000000 --- a/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java +++ /dev/null @@ -1,27 +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.jms.example; - -public class Server { - - public static void main(String arg[]) { - System.out.println("***********************************************************************************"); - System.out.println("You need to start manually under ./target/server/bin just run ./artemis run"); - System.out.println("***********************************************************************************"); - } -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/perf/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/jms/perf/src/main/resources/activemq/server0/broker.xml b/examples/jms/perf/src/main/resources/activemq/server0/broker.xml deleted file mode 100644 index a642ac5..0000000 --- a/examples/jms/perf/src/main/resources/activemq/server0/broker.xml +++ /dev/null @@ -1,46 +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"> - <queue name="perfQueue"/> - </jms> - - <core xmlns="urn:activemq:core"> - - <security-enabled>false</security-enabled> - <persistence-enabled>true</persistence-enabled> - - <!-- Acceptors --> - <acceptors> - <acceptor name="netty-acceptor">tcp://localhost:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor> - </acceptors> - - <queues> - <queue name="perfQueue"> - <address>perfAddress</address> - </queue> - </queues> - - </core> -</configuration> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/perf/src/main/resources/jndi.properties ---------------------------------------------------------------------- diff --git a/examples/jms/perf/src/main/resources/jndi.properties b/examples/jms/perf/src/main/resources/jndi.properties deleted file mode 100644 index bcf6926..0000000 --- a/examples/jms/perf/src/main/resources/jndi.properties +++ /dev/null @@ -1,20 +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. - -java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory -connectionFactory.ConnectionFactory=tcp://localhost:61616?tcp-no-delay=false&tcp-send-buffer-size=1048576&tcp-receive-buffer-size=1048576 -queue.perfQueue=perfQueue http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/perf/src/main/resources/perf.properties ---------------------------------------------------------------------- diff --git a/examples/jms/perf/src/main/resources/perf.properties b/examples/jms/perf/src/main/resources/perf.properties deleted file mode 100644 index 5f6f975..0000000 --- a/examples/jms/perf/src/main/resources/perf.properties +++ /dev/null @@ -1,30 +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=1000 -drain-queue=false -destination-lookup=perfQueue -connection-factory-lookup=ConnectionFactory -throttle-rate=-1 -dups-ok-acknowledge=false -disable-message-id=true -disable-message-timestamp=true http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/pom.xml b/examples/jms/pom.xml deleted file mode 100644 index 3b59d1a..0000000 --- a/examples/jms/pom.xml +++ /dev/null @@ -1,149 +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. ---> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.activemq.examples</groupId> - <artifactId>artemis-examples</artifactId> - <version>1.0.1-SNAPSHOT</version> - </parent> - - <groupId>org.apache.activemq.examples.jms</groupId> - <artifactId>jms-examples</artifactId> - <packaging>pom</packaging> - <name>ActiveMQ Artemis JMS Examples</name> - - <properties> - <udp-address>231.7.7.7</udp-address> - <activemq.basedir>${project.basedir}/../..</activemq.basedir> - </properties> - - <profiles> - <profile> - <!-- You need to activate -Pexamples to run all the examples --> - <id>examples</id> - <modules> - <module>application-layer-failover</module> - <module>bridge</module> - <module>browser</module> - <module>client-kickoff</module> - <module>client-side-load-balancing</module> - <module>client-side-failoverlistener</module> - <module>clustered-durable-subscription</module> - <module>clustered-grouping</module> - <module>clustered-jgroups</module> - <module>clustered-queue</module> - <module>clustered-static-oneway</module> - <module>clustered-static-discovery</module> - <module>clustered-topic</module> - - <!-- ARTEMIS-197 FIX ME: - <module>colocated-failover</module> - <module>colocated-failover-scale-down</module> --> - - <module>consumer-rate-limit</module> - <module>dead-letter</module> - <module>delayed-redelivery</module> - <module>divert</module> - <module>durable-subscription</module> - <module>embedded</module> - <module>embedded-simple</module> - <module>expiry</module> - <module>ha-policy-autobackup</module> - <module>http-transport</module> - <module>interceptor</module> - <module>jms-auto-closeable</module> - <module>instantiate-connection-factory</module> - <module>jms-bridge</module> - <module>jms-completion-listener</module> - <module>jms-context</module> - <module>jms-shared-consumer</module> - <module>jmx</module> - <module>large-message</module> - <module>last-value-queue</module> - <module>management</module> - <module>management-notifications</module> - <module>message-counters</module> - <module>message-group</module> - <module>message-group2</module> - <module>message-priority</module> - <module>multiple-failover</module> - <module>multiple-failover-failback</module> - <module>no-consumer-buffering</module> - <module>non-transaction-failover</module> - <module>paging</module> - <!--run this standalone--> - <!--<module>perf</module>--> - <module>pre-acknowledge</module> - <module>producer-rate-limit</module> - <module>proton-cpp</module> - <module>proton-j</module> - <module>proton-ruby</module> - <module>queue</module> - <module>queue-message-redistribution</module> - <module>queue-requestor</module> - <module>queue-selector</module> - <module>reattach-node</module> - - <!-- ARTEMIS-197 FIX ME: - <module>replicated-failback</module> - <module>replicated-failback-static</module> --> - - <module>replicated-multiple-failover</module> - <module>replicated-transaction-failover</module> - <module>request-reply</module> - <module>rest</module> - <module>scale-down</module> - <module>scheduled-message</module> - <module>security</module> - <module>send-acknowledgements</module> - <module>spring-integration</module> - - <!-- ARTEMIS-197 FIX ME - this one could be the case of leaving it out for good - as it may require to be run manually - <module>ssl-enabled</module> --> - - <module>static-selector</module> - <module>stomp</module> - <!--this should be run standalone--> - <!--<module>stomp-websockets</module>--> - <module>stomp1.1</module> - <module>stomp1.2</module> - <!--this needs to be run standalone as it needs manual intervention--> - <!--<module>stop-server-failover</module>--> - <module>symmetric-cluster</module> - <module>temp-queue</module> - <module>topic</module> - <module>topic-hierarchies</module> - <module>topic-selector-example1</module> - <module>topic-selector-example2</module> - <module>transactional</module> - <module>transaction-failover</module> - <module>xa-heuristic</module> - <module>xa-receive</module> - <module>xa-send</module> - </modules> - </profile> - </profiles> - -</project> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/pre-acknowledge/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/pre-acknowledge/pom.xml b/examples/jms/pre-acknowledge/pom.xml deleted file mode 100644 index e3ee5ef..0000000 --- a/examples/jms/pre-acknowledge/pom.xml +++ /dev/null @@ -1,118 +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. ---> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.activemq.examples.jms</groupId> - <artifactId>jms-examples</artifactId> - <version>1.0.1-SNAPSHOT</version> - </parent> - - <artifactId>pre-acknowledge</artifactId> - <packaging>jar</packaging> - <name>ActiveMQ Artemis JMS Pre Acknowledge Example</name> - - <properties> - <activemq.basedir>${project.basedir}/../../..</activemq.basedir> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.activemq</groupId> - <artifactId>artemis-jms-client</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - - <profiles> - <profile> - <!-- specify -PnoServer if you don't want to start the server --> - <id>noServer</id> - <properties> - <noServer>true</noServer> - </properties> - </profile> - </profiles> - <build> - <plugins> - <plugin> - <groupId>org.apache.activemq</groupId> - <artifactId>artemis-maven-plugin</artifactId> - <executions> - <execution> - <id>create</id> - <goals> - <goal>create</goal> - </goals> - <configuration> - <ignore>${noServer}</ignore> - </configuration> - </execution> - <execution> - <id>start</id> - <goals> - <goal>cli</goal> - </goals> - <configuration> - <ignore>${noServer}</ignore> - <spawn>true</spawn> - <testURI>tcp://localhost:61616</testURI> - <args> - <param>run</param> - </args> - </configuration> - </execution> - <execution> - <id>runClient</id> - <goals> - <goal>runClient</goal> - </goals> - <configuration> - <clientClass>org.apache.activemq.artemis.jms.example.PreacknowledgeExample</clientClass> - </configuration> - </execution> - <execution> - <id>stop</id> - <goals> - <goal>cli</goal> - </goals> - <configuration> - <ignore>${noServer}</ignore> - <args> - <param>stop</param> - </args> - </configuration> - </execution> - </executions> - <dependencies> - <dependency> - <groupId>org.apache.activemq.examples.jms</groupId> - <artifactId>pre-acknowledge</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - </plugin> - </plugins> - </build> - -</project> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/pre-acknowledge/readme.html ---------------------------------------------------------------------- diff --git a/examples/jms/pre-acknowledge/readme.html b/examples/jms/pre-acknowledge/readme.html deleted file mode 100644 index cadea23..0000000 --- a/examples/jms/pre-acknowledge/readme.html +++ /dev/null @@ -1,154 +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. ---> - -<html> - <head> - <title>ActiveMQ Artemis JMS Pre-Acknowledge Example</title> - <link rel="stylesheet" type="text/css" href="../common/common.css" /> - <link rel="stylesheet" type="text/css" href="../common/prettify.css" /> - <script type="text/javascript" src="../common/prettify.js"></script> - </head> - <body onload="prettyPrint()"> - <h1>JMS Pre-Acknowledge Example</h1> - - <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre> - - - <p>Standard JMS supports three acknowledgement modes: AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, and - DUPS_OK_ACKNOWLEDGE. For a full description on these modes please consult the JMS specification, or any - JMS tutorial.</p> - <p>All of these standard modes involve sending acknowledgements from the client to the server. However - in some cases, you really don't mind losing messages in event of failure, so it would make sense - to acknowledge the message on the server <b>before</b> delivering it to the client.</p> - <p>By acknowledging the message before sending to the client, you can avoid extra network traffic and CPU - work done in sending acknowledgements from client to server.</p> - <p>The down-side of acknowledging on the server before delivery, is that if the system crashes after acknowledging - the message, but before the message has been received by the client, then, on recovery, that message - will be lost. This makes pre-acknowledgement not appropriate for all use cases, but it is very useful for some - use-cases when you can cope with such loss of messages<p> - <p>An example of a use-case where it might be a good idea to use pre-acknowledge, is for stock price update - messages. With these messages it might be ok to lose a message in event of crash, since the next price - update message will arrive soon, overriding the previous price.</p> - <p>In order to use pre-acknowledge functionality with ActiveMQ Artemis the session has to be created with - a special, ActiveMQ Artemis specific acknowledgement mode, given by the value of - <code>ActiveMQJMSConstants.PRE_ACKNOWLEDGE</code>. - <h2>Example step-by-step</h2> - - <ol> - <li>Create an initial context to perform the JNDI lookup.</li> - <pre class="prettyprint"> - <code> - initialContext = getContext(0); - </code> - </pre> - - <li>Perform the look-ups</li> - <pre class="prettyprint"> - <code> - Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue"); - - ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory"); - </code> - </pre> - - <li>Create a the JMS objects.</li> - <pre class="prettyprint"> - <code> - connection = cf.createConnection(); - - Session session = connection.createSession(false, ActiveMQSession.PRE_ACKNOWLEDGE); - - MessageProducer producer = session.createProducer(queue); - - MessageConsumer messageConsumer = session.createConsumer(queue); - </code> - </pre> - - <li>Create and send a message.</li> - <pre class="prettyprint"> - <code> - TextMessage message1 = session.createTextMessage("This is a text message 1"); - - producer.send(message1); - - System.out.println("Sent message: " + message1.getText()); - </code> - </pre> - - <li>Print out the message count of the queue. The queue contains one message as expected - delivery has not yet started on the queue.</li> - <pre class="prettyprint"> - <code> - int count = getMessageCount(connection); - - System.out.println("Queue message count is " + count); - </code> - </pre> - - <li>Start the Connection, delivery will now start. Give a little time for delivery to occur.</li> - <pre class="prettyprint"> - <code> - connection.start(); - - Thread.sleep(1000); - </code> - </pre> - - <li>Print out the message count of the queue. It should now be zero, since the message has - already been acknowledged even before the consumer has received it.</li> - <pre class="prettyprint"> - <code> - count = getMessageCount(connection); - - System.out.println("Queue message count is now " + count); - </code> - </pre> - - <li>Finally, receive the message.</li> - <pre class="prettyprint"> - <code> - TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000); - - System.out.println("Received message: " + messageReceived.getText()); - </code> - </pre> - - <li>Be sure to close our resources!</li> - <pre class="prettyprint"> - <code> - if (initialContext != null) - { - initialContext.close(); - } - if (connection != null) - { - connection.close(); - } - </code> - </pre> - </ol> - - <h2>More information</h2> - - <ul> - <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#pre-acknowledge">Pre-acknowledgement Mode chapter</a></li> - </ul> - - </body> -</html> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java ---------------------------------------------------------------------- diff --git a/examples/jms/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java b/examples/jms/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java deleted file mode 100644 index 834b54a..0000000 --- a/examples/jms/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java +++ /dev/null @@ -1,126 +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.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.QueueConnection; -import javax.jms.QueueRequestor; -import javax.jms.QueueSession; -import javax.jms.Session; -import javax.jms.TextMessage; - -import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; -import org.apache.activemq.artemis.api.jms.ActiveMQJMSConstants; -import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper; -import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; - -/** - * This example demonstrates the use of ActiveMQ Artemis "pre-acknowledge" functionality where - * messages are acknowledged before they are delivered to the consumer. - * - * Please see the readme.html for more details. - */ -public class PreacknowledgeExample { - - public static void main(final String[] args) throws Exception { - Connection connection = null; - try { - - // Step 2. instantiate the queue object - Queue queue = ActiveMQJMSClient.createQueue("exampleQueue"); - - // new connection factory - ConnectionFactory cf = new ActiveMQConnectionFactory(); - - // Step 3. Create a the JMS objects - connection = cf.createConnection(); - - Session session = connection.createSession(false, ActiveMQJMSConstants.PRE_ACKNOWLEDGE); - - MessageProducer producer = session.createProducer(queue); - - MessageConsumer messageConsumer = session.createConsumer(queue); - - // Step 4. Create and send a message - TextMessage message1 = session.createTextMessage("This is a text message 1"); - - producer.send(message1); - - System.out.println("Sent message: " + message1.getText()); - - // Step 5. Print out the message count of the queue. The queue contains one message as expected - // delivery has not yet started on the queue - int count = getMessageCount(connection); - - System.out.println("Queue message count is " + count); - - // Step 6. Start the Connection, delivery will now start. Give a little time for delivery to occur. - connection.start(); - - Thread.sleep(1000); - - // Step 7. Print out the message countof the queue. It should now be zero, since the message has - // already been acknowledged even before the consumer has received it. - count = getMessageCount(connection); - - System.out.println("Queue message count is now " + count); - - if (count != 0) { - throw new IllegalStateException("Queue message count is not 0."); - } - - // Step 8. Finally, receive the message - TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000); - - System.out.println("Received message: " + messageReceived.getText()); - } - finally { - // Step 9. Be sure to close our resources! - if (connection != null) { - connection.close(); - } - } - } - - // To do this we send a management message to get the message count. - // In real life you wouldn't create a new session every time you send a management message - private static int getMessageCount(final Connection connection) throws Exception { - QueueSession session = ((QueueConnection) connection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE); - - Queue managementQueue = ActiveMQJMSClient.createQueue("activemq.management"); - - QueueRequestor requestor = new QueueRequestor(session, managementQueue); - - connection.start(); - - Message m = session.createMessage(); - - JMSManagementHelper.putAttribute(m, "jms.queue.exampleQueue", "messageCount"); - - Message response = requestor.request(m); - - int messageCount = (Integer) JMSManagementHelper.getResult(response); - - return messageCount; - } - -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/artemis-roles.properties ---------------------------------------------------------------------- diff --git a/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/artemis-roles.properties deleted file mode 100644 index 4e2d44c..0000000 --- a/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/artemis-roles.properties +++ /dev/null @@ -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 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/artemis-users.properties ---------------------------------------------------------------------- diff --git a/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/artemis-users.properties deleted file mode 100644 index 4e2d44c..0000000 --- a/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/artemis-users.properties +++ /dev/null @@ -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 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/broker.xml b/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/broker.xml deleted file mode 100644 index f29acbc..0000000 --- a/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/broker.xml +++ /dev/null @@ -1,63 +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-setting match="jms.#"> - <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-setting match="jms.queue.activemq.management"> - <permission type="manage" roles="guest"/> - </security-setting> - </security-settings> - - </core> -</configuration> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/pre-acknowledge/src/main/resources/jndi.properties ---------------------------------------------------------------------- diff --git a/examples/jms/pre-acknowledge/src/main/resources/jndi.properties b/examples/jms/pre-acknowledge/src/main/resources/jndi.properties deleted file mode 100644 index 93537c4..0000000 --- a/examples/jms/pre-acknowledge/src/main/resources/jndi.properties +++ /dev/null @@ -1,20 +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. - -java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory -connectionFactory.ConnectionFactory=tcp://localhost:61616 -queue.queue/exampleQueue=exampleQueue http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/producer-rate-limit/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/producer-rate-limit/pom.xml b/examples/jms/producer-rate-limit/pom.xml deleted file mode 100644 index c514526..0000000 --- a/examples/jms/producer-rate-limit/pom.xml +++ /dev/null @@ -1,118 +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. ---> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.activemq.examples.jms</groupId> - <artifactId>jms-examples</artifactId> - <version>1.0.1-SNAPSHOT</version> - </parent> - - <artifactId>producer-rate-limit</artifactId> - <packaging>jar</packaging> - <name>ActiveMQ Artemis JMS Producer Rate Limit Example</name> - - <properties> - <activemq.basedir>${project.basedir}/../../..</activemq.basedir> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.activemq</groupId> - <artifactId>artemis-jms-client</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - - <profiles> - <profile> - <!-- specify -PnoServer if you don't want to start the server --> - <id>noServer</id> - <properties> - <noServer>true</noServer> - </properties> - </profile> - </profiles> - <build> - <plugins> - <plugin> - <groupId>org.apache.activemq</groupId> - <artifactId>artemis-maven-plugin</artifactId> - <executions> - <execution> - <id>create</id> - <goals> - <goal>create</goal> - </goals> - <configuration> - <ignore>${noServer}</ignore> - </configuration> - </execution> - <execution> - <id>start</id> - <goals> - <goal>cli</goal> - </goals> - <configuration> - <ignore>${noServer}</ignore> - <spawn>true</spawn> - <testURI>tcp://localhost:61616</testURI> - <args> - <param>run</param> - </args> - </configuration> - </execution> - <execution> - <id>runClient</id> - <goals> - <goal>runClient</goal> - </goals> - <configuration> - <clientClass>org.apache.activemq.artemis.jms.example.ProducerRateLimitExample</clientClass> - </configuration> - </execution> - <execution> - <id>stop</id> - <goals> - <goal>cli</goal> - </goals> - <configuration> - <ignore>${noServer}</ignore> - <args> - <param>stop</param> - </args> - </configuration> - </execution> - </executions> - <dependencies> - <dependency> - <groupId>org.apache.activemq.examples.jms</groupId> - <artifactId>producer-rate-limit</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - </plugin> - </plugins> - </build> - -</project> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/producer-rate-limit/readme.html ---------------------------------------------------------------------- diff --git a/examples/jms/producer-rate-limit/readme.html b/examples/jms/producer-rate-limit/readme.html deleted file mode 100644 index fa8d086..0000000 --- a/examples/jms/producer-rate-limit/readme.html +++ /dev/null @@ -1,176 +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. ---> - -<html> - <head> - <title>ActiveMQ Artemis JMS Message Producer Rate Limiting</title> - <link rel="stylesheet" type="text/css" href="../common/common.css" /> - <link rel="stylesheet" type="text/css" href="../common/prettify.css" /> - <script type="text/javascript" src="../common/prettify.js"></script> - </head> - <body onload="prettyPrint()"> - <h1>JMS Message Producer Rate Limiting</h1> - - <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre> - - - <p>With ActiveMQ Artemis you can specify a maximum send rate at which a JMS MessageProducer will send messages. - This can be specified when creating or deploying the connection factory. See <code>activemq-jms.xml</code></p> - <p>If this value is specified then ActiveMQ Artemis will ensure that messages are never produced at a rate higher than - specified. This is a form of producer <i>throttling</i>.</p> - <h2>Example step-by-step</h2> - <p>In this example we specify a <code>producer-max-rate</code> of <code>50</code> messages per second in the <code>activemq-jms.xml</code> - file when deploying the connection factory:</p> - <pre class="prettyprint"> - <code> - <connection-factory name="ConnectionFactory"> - <connector-ref connector-name="netty-connector"/> - <entries> - <entry name="ConnectionFactory"/> - </entries> - - <!-- We limit producers created on this connection factory to produce messages at a maximum rate - of 50 messages per sec --> - <producer-max-rate>50</producer-max-rate> - - </connection-factory> - </code> - </pre> - <p>We then simply send as many messages as we can in 10 seconds and note how many messages are actually sent.</p> - <p>We note that the number of messages sent per second never exceeds the specified value of <code>50</code> messages per second.</p> - - <ol> - <li>Create an initial context to perform the JNDI lookup.</li> - <pre class="prettyprint"> - <code>initialContext = getContext(0);</code> - </pre> - - <li>Perfom a lookup on the queue</li> - <pre class="prettyprint"> - <code>Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");</code> - </pre> - - <li>Perform a lookup on the Connection Factory</li> - <pre class="prettyprint"> - <code>ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code> - </pre> - - <li>Create a JMS Connection</li> - <pre class="prettyprint"> - <code>connection = cf.createConnection();</code> - </pre> - - <li>Create a JMS Session</li> - <pre class="prettyprint"> - <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code> - </pre> - - <li>Create a JMS Message Producer</li> - <pre class="prettyprint"> - <code>MessageProducer producer = session.createProducer(queue);</code> - </pre> - - <li>Send as many messages as we can in 10 seconds</li> - <pre class="prettyprint"> - <code> - final long duration = 10000; - - int i = 0; - - long start = System.currentTimeMillis(); - - while (System.currentTimeMillis() - start <= duration) - { - TextMessage message = session.createTextMessage("This is text message: " + i++); - - producer.send(message); - } - - long end = System.currentTimeMillis(); - - double rate = 1000 * (double)i / (end - start); - - System.out.println("We sent " + i + " messages in " + (end - start) + " milliseconds"); - - System.out.println("Actual send rate was " + rate + " messages per second"); - </code> - </pre> - - <li>We note that the sending rate doesn't exceed 50 messages per second. Here's some example output from a real - run</li> - - <pre class="prettyprint"> - <code> - [java] Will now send as many messages as we can in 10 seconds... - [java] We sent 500 messages in 10072 milliseconds - [java] Actual send rate was 49.64257347100874 messages per second - </code> - </pre> - - - <li>For good measure we consumer the messages we produced.</li> - <pre class="prettyprint"> - <code> - MessageConsumer messageConsumer = session.createConsumer(queue); - - connection.start(); - - System.out.println("Now consuming the messages..."); - - i = 0; - while (true) - { - TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000); - - if (messageReceived == null) - { - break; - } - - i++; - } - - System.out.println("Received " + i + " messages"); - - </code> - </pre> - - <li>Be sure to close our resources!</li> - - <pre class="prettyprint"> - <code> - finally - { - if (initialContext != null) - { - initialContext.close(); - } - - if (connection != null) - { - connection.close(); - } - }</code> - </pre> - - - - </ol> - </body> -</html> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java ---------------------------------------------------------------------- diff --git a/examples/jms/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java b/examples/jms/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java deleted file mode 100644 index a7623bb..0000000 --- a/examples/jms/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java +++ /dev/null @@ -1,106 +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.jms.example; - -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.MessageConsumer; -import javax.jms.MessageProducer; -import javax.jms.Queue; -import javax.jms.Session; -import javax.jms.TextMessage; - -import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; -import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; - -/** - * This example demonstrates how a message producer can be limited to produce messages at a maximum rate - * specified in messages per sec. - */ -public class ProducerRateLimitExample { - - public static void main(final String[] args) throws Exception { - Connection connection = null; - try { - // Step 2. Perfom a lookup on the queue - Queue queue = ActiveMQJMSClient.createQueue("exampleQueue"); - - // Step 3. Perform a lookup on the Connection Factory - ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?producerMaxRate=50"); - - // Step 4. Create a JMS Connection - connection = cf.createConnection(); - - // Step 5. Create a JMS Session - Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - // Step 6. Create a JMS Message Producer - MessageProducer producer = session.createProducer(queue); - - System.out.println("Will now send as many messages as we can in 10 seconds..."); - - // Step 7. Send as many messages as we can in 10 seconds - - final long duration = 10000; - - int i = 0; - - long start = System.currentTimeMillis(); - - while (System.currentTimeMillis() - start <= duration) { - TextMessage message = session.createTextMessage("This is text message: " + i++); - - producer.send(message); - } - - long end = System.currentTimeMillis(); - - double rate = 1000 * (double) i / (end - start); - - System.out.println("We sent " + i + " messages in " + (end - start) + " milliseconds"); - - System.out.println("Actual send rate was " + rate + " messages per second"); - - // Step 8. For good measure we consumer the messages we produced. - - MessageConsumer messageConsumer = session.createConsumer(queue); - - connection.start(); - - System.out.println("Now consuming the messages..."); - - i = 0; - while (true) { - TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000); - - if (messageReceived == null) { - break; - } - - i++; - } - - System.out.println("Received " + i + " messages"); - } - finally { - // Step 9. Be sure to close our resources! - if (connection != null) { - connection.close(); - } - } - } -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/producer-rate-limit/src/main/resources/jndi.properties ---------------------------------------------------------------------- diff --git a/examples/jms/producer-rate-limit/src/main/resources/jndi.properties b/examples/jms/producer-rate-limit/src/main/resources/jndi.properties deleted file mode 100644 index 0e42b2a..0000000 --- a/examples/jms/producer-rate-limit/src/main/resources/jndi.properties +++ /dev/null @@ -1,20 +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. - -java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory -connectionFactory.ConnectionFactory=tcp://localhost:61616?producerMaxRate=50 -queue.queue/exampleQueue=exampleQueue http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/proton-cpp/compile.sh ---------------------------------------------------------------------- diff --git a/examples/jms/proton-cpp/compile.sh b/examples/jms/proton-cpp/compile.sh deleted file mode 100755 index cc16a27..0000000 --- a/examples/jms/proton-cpp/compile.sh +++ /dev/null @@ -1,18 +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. -# This requires g++ and qpid-cpp-client-devel -g++ src/main/cpp/hello.cpp -o hello -l qpidmessaging -l qpidtypes http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/proton-cpp/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/proton-cpp/pom.xml b/examples/jms/proton-cpp/pom.xml deleted file mode 100644 index 32d2185..0000000 --- a/examples/jms/proton-cpp/pom.xml +++ /dev/null @@ -1,122 +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. ---> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.activemq.examples.jms</groupId> - <artifactId>jms-examples</artifactId> - <version>1.0.1-SNAPSHOT</version> - </parent> - - <artifactId>protoncpp</artifactId> - <packaging>jar</packaging> - <name>ActiveMQ Artemis AMQP CPP Example</name> - - <properties> - <activemq.basedir>${project.basedir}/../../..</activemq.basedir> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.activemq</groupId> - <artifactId>artemis-jms-client</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-jms_2.0_spec</artifactId> - </dependency> - </dependencies> - - <profiles> - <profile> - <!-- specify -PnoServer if you don't want to start the server --> - <id>noServer</id> - <properties> - <noServer>true</noServer> - </properties> - </profile> - </profiles> - <build> - <plugins> - <plugin> - <groupId>org.apache.activemq</groupId> - <artifactId>artemis-maven-plugin</artifactId> - <executions> - <execution> - <id>create</id> - <goals> - <goal>create</goal> - </goals> - <configuration> - <ignore>${noServer}</ignore> - </configuration> - </execution> - <execution> - <id>start</id> - <goals> - <goal>cli</goal> - </goals> - <configuration> - <ignore>${noServer}</ignore> - <spawn>true</spawn> - <testURI>tcp://localhost:61616</testURI> - <args> - <param>run</param> - </args> - </configuration> - </execution> - <execution> - <id>runClient</id> - <goals> - <goal>runClient</goal> - </goals> - <configuration> - <clientClass>org.apache.activemq.artemis.jms.example.ProtonCPPExample</clientClass> - </configuration> - </execution> - <execution> - <id>stop</id> - <goals> - <goal>cli</goal> - </goals> - <configuration> - <ignore>${noServer}</ignore> - <args> - <param>stop</param> - </args> - </configuration> - </execution> - </executions> - <dependencies> - <dependency> - <groupId>org.apache.activemq.examples.jms</groupId> - <artifactId>protoncpp</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - </plugin> - </plugins> - </build> - -</project> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/proton-cpp/readme.html ---------------------------------------------------------------------- diff --git a/examples/jms/proton-cpp/readme.html b/examples/jms/proton-cpp/readme.html deleted file mode 100644 index 1e51091..0000000 --- a/examples/jms/proton-cpp/readme.html +++ /dev/null @@ -1,120 +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. ---> - -<html> -<head> - <title>ActiveMQ Artemis QPID cpp example</title> - <link rel="stylesheet" type="text/css" href="../common/common.css" /> - <link rel="stylesheet" type="text/css" href="../common/prettify.css" /> - <script type="text/javascript" src="../common/prettify.js"></script> -</head> -<body onload="prettyPrint()"> -<h1>AMQP CPP example</h1> - -<p>ActiveMQ Artemis is a multi protocol broker. It will inspect the initial handshake of clients to determine what protocol to use.</p> -<p>All you need to do is to connect a client into activemq's configured port and you should be able connect.</p> -<p>To run this example simply run the command <literal>mvn verify -Pexample</literal>, execute the compile.sh script and start the executable called ./hello</p> -<pre> - # first make sure you have the dependencies you need to compile and run the client - # You will have to adapt this step according to your platform. Consult the <a href="http://qpid.apache.org/releases/qpid-0.30/programming/book/">qpid docs</a> for more information. - # There is a list of <a href="http://qpid.apache.org/packages.html">packages</a> you can install as well. - [proton-cpp]$ sudo yum install qpid-cpp-client-devel - - # on a first window - [proton-cpp]$ mvn verify -Pexample - - # on a second window - # That goes without saying but you will of course need g++ (the C++ compiler) installed - [proton-cpp]$ ./compile.sh - [proton-cpp]$ ./hello -</pre> - - -<p>You don't need to do anything special to configure the ActiveMQ Artemis server to accept AMQP clients. </p> -<p>Just for the sake of documentation though we are setting the port of ActiveMQ Artemis on this example as 5672 which is the port qpid have by default. </p> -<p>This is totally optional and you don't need to follow this convention. You can use any port you chose including ActiveMQ's 61616 default port</p> - <pre class="prettyprint"> - <code> - <acceptor name="proton-acceptor">tcp://localhost:5672</acceptor> - </code> - </pre> -<h2>Example step-by-step</h2> -<p> We are using qpid cpp client on this example. There are several libraries you may chose from for AMQP. We have ellect one that we consider simple enough for users.</p> - -<p> This example is based on <a href='http://qpid.apache.org/releases/qpid-0.30/messaging-api/cpp/examples/hello_world.cpp.html'>qpid's hello world example</a>.</p> -<ol> - <li>qpid-cpp-client-devel installed.</li> - <p>Assuming you are on Linux Fedora, you will need to run this following command</p> - <pre class="prettyprint"> - <code>yum install qpid-cpp-client-devel</code> - </pre> - <p>Consult the <a href="http://qpid.apache.org/releases/qpid-0.30/programming/book/">qpid documentation</a>, and <a href="http://qpid.apache.org/packages.html">the required </a> packages for information on other platoforms.</p> - <li>Make the proper C++ imports</li> - - <li> Create an amqp qpid 1.0 connection.</li> - <pre class="prettyprint"> - <code> - std::string broker = argc > 1 ? argv[1] : "localhost:61616"; - std::string address = argc > 2 ? argv[2] : "jms.queue.exampleQueue"; - std::string connectionOptions = argc > 3 ? argv[3] : "{protocol:amqp1.0}"; // Look at the <a href="http://qpid.apache.org/releases/qpid-0.30/programming/book/connections.html#connection-options">docs</a> for more options - - Connection connection(broker, connectionOptions); - connection.open(); - </code> - </pre> - - <li>Create a session</li> - <pre class="prettyprint"> - <code>Session session = connection.createSession();</code> - </pre> - - <li>Create a sender</li> - <pre class="prettyprint"> - <code>Sender sender = session.createSender(address);</code> - </pre> - - <li>send a simple message</li> - <pre class="prettyprint"> - <code>sender.send(Message("Hello world!"));</code> - </pre> - - <li>create a receiver</li> - <pre class="prettyprint"> - <code>Receiver receiver = session.createReceiver(address);</code> - </pre> - - <li>receive the simple message</li> - <pre class="prettyprint"> - <code>Message message = receiver.fetch(Duration::SECOND * 1); - </code> - </pre> - - <li>acknowledge the message</li> - <pre class="prettyprint"> - <code>session.acknowledge();</code> - </pre> - - <li>close the connection</li> - <pre class="prettyprint"> - <code>connection.close();</code> - </pre> -</ol> - -</body> -</html> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/proton-cpp/src/main/cpp/hello.cpp ---------------------------------------------------------------------- diff --git a/examples/jms/proton-cpp/src/main/cpp/hello.cpp b/examples/jms/proton-cpp/src/main/cpp/hello.cpp deleted file mode 100644 index 214d255..0000000 --- a/examples/jms/proton-cpp/src/main/cpp/hello.cpp +++ /dev/null @@ -1,72 +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. - * - */ - - -// Step 2. Make the proper C++ imports -#include <qpid/messaging/Connection.h> -#include <qpid/messaging/Message.h> -#include <qpid/messaging/Receiver.h> -#include <qpid/messaging/Sender.h> -#include <qpid/messaging/Session.h> - -#include <iostream> - -using namespace qpid::messaging; - -int main(int argc, char** argv) { - std::string broker = argc > 1 ? argv[1] : "localhost:61616"; - std::string address = argc > 2 ? argv[2] : "jms.queue.exampleQueue"; - - // Connection options documented at http://qpid.apache.org/releases/qpid-0.30/programming/book/connections.html#connection-options - std::string connectionOptions = argc > 3 ? argv[3] : "{protocol:amqp1.0}"; - - try { - // Step 3. Create an amqp qpid 1.0 connection - Connection connection(broker, connectionOptions); - connection.open(); - - // Step 4. Create a session - Session session = connection.createSession(); - - // Step 5. Create a sender - Sender sender = session.createSender(address); - - // Step 6. send a simple message - sender.send(Message("Hello world!")); - - // Step 7. create a receiver - Receiver receiver = session.createReceiver(address); - - // Step 8. receive the simple message - Message message = receiver.fetch(Duration::SECOND * 1); - std::cout << "Received a message with this following content \"" << message.getContent() << "\"" << std::endl; - - // Step 9. acknowledge the message - session.acknowledge(); - - // Step 10. close the connection - connection.close(); - return 0; - } catch(const std::exception& error) { - std::cerr << error.what() << std::endl; - return 1; - } -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java ---------------------------------------------------------------------- diff --git a/examples/jms/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java b/examples/jms/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java deleted file mode 100644 index be9c2f3..0000000 --- a/examples/jms/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java +++ /dev/null @@ -1,121 +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.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.QueueConnection; -import javax.jms.QueueRequestor; -import javax.jms.QueueSession; -import javax.jms.Session; -import javax.naming.InitialContext; - -import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; -import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper; - -/** - * This example demonstrates the use of ActiveMQ Artemis "pre-acknowledge" functionality where - * messages are acknowledged before they are delivered to the consumer. - * - * Please see the readme.html for more details. - */ -public class ProtonCPPExample { - - public static void main(final String[] args) throws Exception { - Connection connection = null; - - InitialContext initialContext = null; - try { - // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = new InitialContext(); - - // Step 2. Perform the look-ups - Queue queue = (Queue) initialContext.lookup("queue/exampleQueue"); - - ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory"); - - // Step 3. Create a the JMS objects - connection = cf.createConnection(); - - Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - MessageConsumer messageConsumer = session.createConsumer(queue); - - MessageProducer producerAnswer = session.createProducer(queue); - - // Step 4. Start the connection - connection.start(); - - System.out.println("On a shell script, execute the following:"); - - System.out.println("./compile.sh"); - - System.out.println("./hello"); - - // Step 5. Finally, receive the message - Message messageReceived = messageConsumer.receive(5000); - - if (messageReceived == null) { - // We are not going to issue this as an error because - // we also use this example as part of our tests on artemis - // this is not considered an error, just that no messages arrived (i.e. hello wasn't called) - } - else { - System.out.println("message received: " + messageReceived); - - // Sending message back to client - producerAnswer.send(session.createTextMessage("HELLO from Apache ActiveMQ Artemis")); - } - } - finally { - // Step 9. Be sure to close our resources! - if (initialContext != null) { - initialContext.close(); - } - if (connection != null) { - connection.close(); - } - } - } - - // To do this we send a management message to get the message count. - // In real life you wouldn't create a new session every time you send a management message - private int getMessageCount(final Connection connection) throws Exception { - QueueSession session = ((QueueConnection) connection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE); - - Queue managementQueue = ActiveMQJMSClient.createQueue("activemq.management"); - - QueueRequestor requestor = new QueueRequestor(session, managementQueue); - - connection.start(); - - Message m = session.createMessage(); - - JMSManagementHelper.putAttribute(m, "jms.queue.exampleQueue", "messageCount"); - - Message response = requestor.request(m); - - int messageCount = (Integer) JMSManagementHelper.getResult(response); - - return messageCount; - } - -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/proton-cpp/src/main/resources/jndi.properties ---------------------------------------------------------------------- diff --git a/examples/jms/proton-cpp/src/main/resources/jndi.properties b/examples/jms/proton-cpp/src/main/resources/jndi.properties deleted file mode 100644 index 93537c4..0000000 --- a/examples/jms/proton-cpp/src/main/resources/jndi.properties +++ /dev/null @@ -1,20 +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. - -java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory -connectionFactory.ConnectionFactory=tcp://localhost:61616 -queue.queue/exampleQueue=exampleQueue http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/jms/proton-j/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/proton-j/pom.xml b/examples/jms/proton-j/pom.xml deleted file mode 100644 index ebd92c4..0000000 --- a/examples/jms/proton-j/pom.xml +++ /dev/null @@ -1,118 +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. ---> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.activemq.examples.jms</groupId> - <artifactId>jms-examples</artifactId> - <version>1.0.1-SNAPSHOT</version> - </parent> - - <artifactId>artemis-proton-j</artifactId> - <packaging>jar</packaging> - <name>ActiveMQ Artemis Proton-J Example</name> - - <properties> - <activemq.basedir>${project.basedir}/../../..</activemq.basedir> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.qpid</groupId> - <artifactId>qpid-amqp-1-0-client</artifactId> - <version>0.22</version> - </dependency> - </dependencies> - - <profiles> - <profile> - <!-- specify -PnoServer if you don't want to start the server --> - <id>noServer</id> - <properties> - <noServer>true</noServer> - </properties> - </profile> - </profiles> - <build> - <plugins> - <plugin> - <groupId>org.apache.activemq</groupId> - <artifactId>artemis-maven-plugin</artifactId> - <executions> - <execution> - <id>create</id> - <goals> - <goal>create</goal> - </goals> - <configuration> - <ignore>${noServer}</ignore> - </configuration> - </execution> - <execution> - <id>start</id> - <goals> - <goal>cli</goal> - </goals> - <configuration> - <ignore>${noServer}</ignore> - <spawn>true</spawn> - <testURI>tcp://localhost:61616</testURI> - <args> - <param>run</param> - </args> - </configuration> - </execution> - <execution> - <id>runClient</id> - <goals> - <goal>runClient</goal> - </goals> - <configuration> - <clientClass>org.apache.activemq.artemis.jms.example.ProtonJExample</clientClass> - </configuration> - </execution> - <execution> - <id>stop</id> - <goals> - <goal>cli</goal> - </goals> - <configuration> - <ignore>${noServer}</ignore> - <args> - <param>stop</param> - </args> - </configuration> - </execution> - </executions> - <dependencies> - <dependency> - <groupId>org.apache.activemq.examples.jms</groupId> - <artifactId>artemis-proton-j</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - </plugin> - </plugins> - </build> - -</project>
