diff --git a/artemis-distribution/src/test/scripts/run-examples.sh b/artemis-distribution/src/test/scripts/run-examples.sh index 71bd398249..cb1398004a 100755 --- a/artemis-distribution/src/test/scripts/run-examples.sh +++ b/artemis-distribution/src/test/scripts/run-examples.sh @@ -30,13 +30,16 @@ export TEST_TARGET="./target" cd $ARTEMIS_HOME/examples/features/standard/ -cd bridge; mvn verify; cd .. -cd bridge; mvn verify; cd .. -cd browser; mvn verify; cd .. +cd auto-closeable; mvn verify; cd .. cd broker-plugin; mvn verify; cd .. +cd browser; mvn verify; cd .. cd cdi; mvn verify; cd .. cd client-kickoff; mvn verify; cd .. +cd completion-listener; mvn verify; cd .. cd consumer-rate-limit; mvn verify; cd .. +cd context; mvn verify; cd .. +cd core-bridge; mvn verify; cd .. +cd database; mvn verify; cd .. cd dead-letter; mvn verify; cd .. cd delayed-redelivery; mvn verify; cd .. cd divert; mvn verify; cd .. @@ -45,16 +48,14 @@ cd embedded; mvn verify; cd .. cd embedded-simple; mvn verify; cd .. cd expiry; mvn verify; cd .. cd http-transport; mvn verify; cd .. -cd interceptor; mvn verify; cd .. -cd interceptor-client; mvn verify; cd .. -cd interceptor-client-mqtt; mvn verify; cd .. -cd jms-auto-closeable; mvn verify; cd .. cd instantiate-connection-factory; mvn verify; cd .. +cd interceptor; mvn verify; cd .. +cd interceptor-amqp; mvn verify; cd .. +cd interceptor-client; mvn verify; cd .. +cd interceptor-mqtt; mvn verify; cd .. cd jms-bridge; mvn verify; cd .. -cd jms-completion-listener; mvn verify; cd .. -cd jms-context; mvn verify; cd .. -cd jms-shared-consumer; mvn verify; cd .. cd jmx; mvn verify; cd .. +cd jmx-ssl; mvn verify; cd .. # too big for most CI machines #cd large-message; mvn verify; cd .. @@ -80,15 +81,18 @@ cd scheduled-message; mvn verify; cd .. cd security; mvn verify; cd .. cd security-ldap; mvn verify; cd .. cd send-acknowledgements; mvn verify; cd .. +cd shared-consumer; mvn verify; cd .. +cd slow-consumer; mvn verify; cd .. cd spring-integration; mvn verify; cd .. cd ssl-enabled; mvn verify; cd .. +cd ssl-enabled-crl-mqtt; mvn verify; cd .. cd ssl-enabled-dual-authentication; mvn verify; cd .. cd static-selector; mvn verify; cd .. cd temp-queue; mvn verify; cd .. cd topic; mvn verify; cd .. cd topic-hierarchies; mvn verify; cd .. -cd topic-selector-example1; mvn verify; cd .. -cd topic-selector-example2; mvn verify; cd .. +cd topic-selector1; mvn verify; cd .. +cd topic-selector2; mvn verify; cd .. cd transactional; mvn verify; cd .. cd xa-heuristic; mvn verify; cd .. cd xa-receive; mvn verify; cd .. @@ -134,5 +138,37 @@ cd scale-down; mvn verify; cd .. cd transaction-failover; mvn verify; cd .. +cd $ARTEMIS_HOME/examples/protocols/amqp/ + + +cd queue; mvn verify; cd .. + + +cd $ARTEMIS_HOME/examples/protocols/mqtt/ + + +cd clustered-queue-mqtt; mvn verify; cd .. +cd publish-subscribe; mvn verify; cd .. + + +cd $ARTEMIS_HOME/examples/protocols/openwire/ + + +cd queue; mvn verify; cd .. +cd message-listener; mvn verify; cd .. +cd message-recovery; mvn verify; cd .. + + +cd $ARTEMIS_HOME/examples/protocols/stomp/ + + +cd stomp; mvn verify; cd .. +cd stomp1.1; mvn verify; cd .. +cd stomp1.2; mvn verify; cd .. +cd stomp-dual-authentication; mvn verify; cd .. +cd stomp-embedded-interceptor; mvn verify; cd .. +cd stomp-jms; mvn verify; cd .. + + cd $CURRENT_DIR rm -rf target diff --git a/artemis-distribution/src/test/scripts/run-standard-examples.sh b/artemis-distribution/src/test/scripts/run-standard-examples.sh index 677d029d9b..fbbaff5aa8 100755 --- a/artemis-distribution/src/test/scripts/run-standard-examples.sh +++ b/artemis-distribution/src/test/scripts/run-standard-examples.sh @@ -30,12 +30,16 @@ export TEST_TARGET="./target" cd $ARTEMIS_HOME/examples/features/standard/ -cd bridge; mvn verify; cd .. -cd bridge; mvn verify; cd .. -cd browser; mvn verify; cd .. +cd auto-closeable; mvn verify; cd .. cd broker-plugin; mvn verify; cd .. +cd browser; mvn verify; cd .. +cd cdi; mvn verify; cd .. cd client-kickoff; mvn verify; cd .. +cd completion-listener; mvn verify; cd .. cd consumer-rate-limit; mvn verify; cd .. +cd context; mvn verify; cd .. +cd core-bridge; mvn verify; cd .. +cd database; mvn verify; cd .. cd dead-letter; mvn verify; cd .. cd delayed-redelivery; mvn verify; cd .. cd divert; mvn verify; cd .. @@ -44,15 +48,14 @@ cd embedded; mvn verify; cd .. cd embedded-simple; mvn verify; cd .. cd expiry; mvn verify; cd .. cd http-transport; mvn verify; cd .. -cd interceptor; mvn verify; cd .. -cd interceptor-client; mvn verify; cd .. -cd jms-auto-closeable; mvn verify; cd .. cd instantiate-connection-factory; mvn verify; cd .. +cd interceptor; mvn verify; cd .. +cd interceptor-amqp; mvn verify; cd .. +cd interceptor-client; mvn verify; cd .. +cd interceptor-mqtt; mvn verify; cd .. cd jms-bridge; mvn verify; cd .. -cd jms-completion-listener; mvn verify; cd .. -cd jms-context; mvn verify; cd .. -cd jms-shared-consumer; mvn verify; cd .. cd jmx; mvn verify; cd .. +cd jmx-ssl; mvn verify; cd .. # too big for most CI machines #cd large-message; mvn verify; cd .. @@ -78,15 +81,18 @@ cd scheduled-message; mvn verify; cd .. cd security; mvn verify; cd .. cd security-ldap; mvn verify; cd .. cd send-acknowledgements; mvn verify; cd .. +cd shared-consumer; mvn verify; cd .. +cd slow-consumer; mvn verify; cd .. cd spring-integration; mvn verify; cd .. cd ssl-enabled; mvn verify; cd .. +cd ssl-enabled-crl-mqtt; mvn verify; cd .. cd ssl-enabled-dual-authentication; mvn verify; cd .. cd static-selector; mvn verify; cd .. cd temp-queue; mvn verify; cd .. cd topic; mvn verify; cd .. cd topic-hierarchies; mvn verify; cd .. -cd topic-selector-example1; mvn verify; cd .. -cd topic-selector-example2; mvn verify; cd .. +cd topic-selector1; mvn verify; cd .. +cd topic-selector2; mvn verify; cd .. cd transactional; mvn verify; cd .. cd xa-heuristic; mvn verify; cd .. cd xa-receive; mvn verify; cd .. diff --git a/examples/features/standard/README.md b/examples/features/standard/README.md deleted file mode 100644 index c26876f41d..0000000000 --- a/examples/features/standard/README.md +++ /dev/null @@ -1,32 +0,0 @@ -Running the ActiveMQ Artemis Examples -============================ - -To run an individual example firstly cd into the example directory and run - -```sh -mvn verify -``` - -Most examples offer a way to start them without creating and starting the broker (say if you want to do it manually) - -```sh -mvn verify -PnoServer -``` - -If you are running against an un released version, i.e. from master branch, you will have to run `mvn install` on the root -pom.xml and the example/activemq-jms-examples-common/pom.xml first. - -If you want to run all the examples (except those that need to be run standalone) you can run `mvn verify -Pexamples` in the examples -directory but before you do you will need to up the memory used by running: - -``` -export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" -``` -### Recreating the examples - -If you are trying to copy the examples somewhere else and modifying them. Consider asking Maven to explicitly list all the dependencies: - -``` -# if trying to modify the 'topic' example: -cd examples/jms/topic && mvn dependency:list -``` diff --git a/examples/features/standard/jms-auto-closeable/pom.xml b/examples/features/standard/auto-closeable/pom.xml similarity index 100% rename from examples/features/standard/jms-auto-closeable/pom.xml rename to examples/features/standard/auto-closeable/pom.xml diff --git a/examples/features/standard/jms-auto-closeable/readme.md b/examples/features/standard/auto-closeable/readme.md similarity index 100% rename from examples/features/standard/jms-auto-closeable/readme.md rename to examples/features/standard/auto-closeable/readme.md diff --git a/examples/features/standard/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java b/examples/features/standard/auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java similarity index 100% rename from examples/features/standard/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java rename to examples/features/standard/auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java diff --git a/examples/features/standard/jms-auto-closeable/src/main/resources/jndi.properties b/examples/features/standard/auto-closeable/src/main/resources/jndi.properties similarity index 100% rename from examples/features/standard/jms-auto-closeable/src/main/resources/jndi.properties rename to examples/features/standard/auto-closeable/src/main/resources/jndi.properties diff --git a/examples/features/standard/cdi/pom.xml b/examples/features/standard/cdi/pom.xml index 27215c0775..8aaf47584b 100644 --- a/examples/features/standard/cdi/pom.xml +++ b/examples/features/standard/cdi/pom.xml @@ -27,7 +27,7 @@ 2.5.0-SNAPSHOT - artemis-cdi-example + cdi jar ActiveMQ Artemis CDI Example @@ -153,7 +153,7 @@ org.apache.activemq.examples.broker - artemis-cdi-example + cdi ${project.version} diff --git a/examples/features/standard/jms-completion-listener/pom.xml b/examples/features/standard/completion-listener/pom.xml similarity index 100% rename from examples/features/standard/jms-completion-listener/pom.xml rename to examples/features/standard/completion-listener/pom.xml diff --git a/examples/features/standard/jms-completion-listener/readme.md b/examples/features/standard/completion-listener/readme.md similarity index 100% rename from examples/features/standard/jms-completion-listener/readme.md rename to examples/features/standard/completion-listener/readme.md diff --git a/examples/features/standard/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java b/examples/features/standard/completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java similarity index 100% rename from examples/features/standard/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java rename to examples/features/standard/completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java diff --git a/examples/features/standard/jms-completion-listener/src/main/resources/jndi.properties b/examples/features/standard/completion-listener/src/main/resources/jndi.properties similarity index 100% rename from examples/features/standard/jms-completion-listener/src/main/resources/jndi.properties rename to examples/features/standard/completion-listener/src/main/resources/jndi.properties diff --git a/examples/features/standard/jms-context/pom.xml b/examples/features/standard/context/pom.xml similarity index 100% rename from examples/features/standard/jms-context/pom.xml rename to examples/features/standard/context/pom.xml diff --git a/examples/features/standard/jms-context/readme.md b/examples/features/standard/context/readme.md similarity index 100% rename from examples/features/standard/jms-context/readme.md rename to examples/features/standard/context/readme.md diff --git a/examples/features/standard/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java b/examples/features/standard/context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java similarity index 100% rename from examples/features/standard/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java rename to examples/features/standard/context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java diff --git a/examples/features/standard/bridge/pom.xml b/examples/features/standard/core-bridge/pom.xml similarity index 100% rename from examples/features/standard/bridge/pom.xml rename to examples/features/standard/core-bridge/pom.xml diff --git a/examples/features/standard/bridge/readme.md b/examples/features/standard/core-bridge/readme.md similarity index 100% rename from examples/features/standard/bridge/readme.md rename to examples/features/standard/core-bridge/readme.md diff --git a/examples/features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java b/examples/features/standard/core-bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java similarity index 100% rename from examples/features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java rename to examples/features/standard/core-bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java diff --git a/examples/features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/HatColourChangeTransformer.java b/examples/features/standard/core-bridge/src/main/java/org/apache/activemq/artemis/jms/example/HatColourChangeTransformer.java similarity index 100% rename from examples/features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/HatColourChangeTransformer.java rename to examples/features/standard/core-bridge/src/main/java/org/apache/activemq/artemis/jms/example/HatColourChangeTransformer.java diff --git a/examples/features/standard/bridge/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/core-bridge/src/main/resources/activemq/server0/broker.xml similarity index 100% rename from examples/features/standard/bridge/src/main/resources/activemq/server0/broker.xml rename to examples/features/standard/core-bridge/src/main/resources/activemq/server0/broker.xml diff --git a/examples/features/standard/bridge/src/main/resources/activemq/server1/broker.xml b/examples/features/standard/core-bridge/src/main/resources/activemq/server1/broker.xml similarity index 100% rename from examples/features/standard/bridge/src/main/resources/activemq/server1/broker.xml rename to examples/features/standard/core-bridge/src/main/resources/activemq/server1/broker.xml diff --git a/examples/features/standard/database/pom.xml b/examples/features/standard/database/pom.xml index 51a5db0ddf..445294c2ce 100644 --- a/examples/features/standard/database/pom.xml +++ b/examples/features/standard/database/pom.xml @@ -27,9 +27,9 @@ under the License. 2.5.0-SNAPSHOT - datatabase + database jar - ActiveMQ Artemis JMS Expiry Example + ActiveMQ Artemis JMS Database Example ${project.basedir}/../../../.. @@ -104,7 +104,7 @@ under the License. org.apache.activemq.examples.broker - datatabase + database ${project.version} diff --git a/examples/features/standard/database/readme.md b/examples/features/standard/database/readme.md index d32f727526..fa1613cd58 100644 --- a/examples/features/standard/database/readme.md +++ b/examples/features/standard/database/readme.md @@ -4,4 +4,6 @@ To run the example, simply type **mvn verify** from this directory, or **mvn -Pn This example shows you how to configure ActiveMQ Artemis to run with a database. -Notice this is not making any assumption of what is the recommended database to be used with Artemis. After all we recommend the artemis journal to be used, however in certain environments users will prefer databases for specific reasons. +### Notice + +This is not making any assumption of what is the recommended database to be used with Artemis. We generally recommend the Artemis journal to be used. However, in certain environments users will prefer databases for specific reasons. diff --git a/examples/features/standard/embedded-simple/src/main/resources/broker.xml b/examples/features/standard/embedded-simple/src/main/resources/broker.xml index a67720c30d..795e648b36 100644 --- a/examples/features/standard/embedded-simple/src/main/resources/broker.xml +++ b/examples/features/standard/embedded-simple/src/main/resources/broker.xml @@ -18,10 +18,7 @@ specific language governing permissions and limitations under the License. --> - - + false @@ -30,11 +27,9 @@ under the License. vm://0 - - - + @@ -43,6 +38,5 @@ under the License. - diff --git a/examples/features/standard/jms-bridge/pom.xml b/examples/features/standard/jms-bridge/pom.xml index 4422130a18..e186bb0097 100644 --- a/examples/features/standard/jms-bridge/pom.xml +++ b/examples/features/standard/jms-bridge/pom.xml @@ -27,7 +27,7 @@ under the License. 2.5.0-SNAPSHOT - bridge + jms-bridge jar ActiveMQ Artemis JMS Bridge Example @@ -147,7 +147,7 @@ under the License. org.apache.activemq.examples.broker - bridge + jms-bridge ${project.version} diff --git a/examples/features/standard/jmx-ssl/readme.md b/examples/features/standard/jmx-ssl/readme.md index e65301285f..454dfb6930 100644 --- a/examples/features/standard/jmx-ssl/readme.md +++ b/examples/features/standard/jmx-ssl/readme.md @@ -14,6 +14,15 @@ To access this MBeanServer remotely, add the following to the management.xml con With these properties, ActiveMQ Artemis broker will be manageable remotely using standard JMX URL on port `1099`. +The various keystore files are generated using the following commands: + +* `keytool -genkey -keystore server-side-keystore.jks -storepass secureexample -keypass secureexample -dname "CN=ActiveMQ Artemis Server, OU=Artemis, O=ActiveMQ, L=AMQ, S=AMQ, C=AMQ" -keyalg RSA` +* `keytool -export -keystore server-side-keystore.jks -file server-side-cert.cer -storepass secureexample` +* `keytool -import -keystore client-side-truststore.jks -file server-side-cert.cer -storepass secureexample -keypass secureexample -noprompt` +* `keytool -genkey -keystore client-side-keystore.jks -storepass secureexample -keypass secureexample -dname "CN=ActiveMQ Artemis Client, OU=Artemis, O=ActiveMQ, L=AMQ, S=AMQ, C=AMQ" -keyalg RSA` +* `keytool -export -keystore client-side-keystore.jks -file client-side-cert.cer -storepass secureexample` +* `keytool -import -keystore server-side-truststore.jks -file client-side-cert.cer -storepass secureexample -keypass secureexample -noprompt` + ## More information * [Java management guide](https://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html) \ No newline at end of file diff --git a/examples/features/standard/jmx-ssl/src/main/java/org/apache/activemq/artemis/jms/example/JMXOverSSLExample.java b/examples/features/standard/jmx-ssl/src/main/java/org/apache/activemq/artemis/jms/example/JMXOverSSLExample.java index b8b8ef7ec9..8681a19dc1 100644 --- a/examples/features/standard/jmx-ssl/src/main/java/org/apache/activemq/artemis/jms/example/JMXOverSSLExample.java +++ b/examples/features/standard/jmx-ssl/src/main/java/org/apache/activemq/artemis/jms/example/JMXOverSSLExample.java @@ -83,10 +83,10 @@ public class JMXOverSSLExample { String[] creds = {"guest", "guest"}; env.put(JMXConnector.CREDENTIALS, creds); - System.setProperty("javax.net.ssl.trustStore", args[0] + "activemq.example.truststore"); - System.setProperty("javax.net.ssl.trustStorePassword", "activemqexample"); - System.setProperty("javax.net.ssl.keyStore", args[0] + "activemq.example.keystore"); - System.setProperty("javax.net.ssl.keyStorePassword", "activemqexample"); + System.setProperty("javax.net.ssl.trustStore", args[0] + "client-side-truststore.jks"); + System.setProperty("javax.net.ssl.trustStorePassword", "secureexample"); + System.setProperty("javax.net.ssl.keyStore", args[0] + "client-side-keystore.jks"); + System.setProperty("javax.net.ssl.keyStorePassword", "secureexample"); JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMXOverSSLExample.JMX_URL), env); @@ -131,6 +131,11 @@ public class JMXOverSSLExample { if (connection != null) { connection.close(); } + + System.clearProperty("javax.net.ssl.trustStore"); + System.clearProperty("javax.net.ssl.trustStorePassword"); + System.clearProperty("javax.net.ssl.keyStore"); + System.clearProperty("javax.net.ssl.keyStorePassword"); } } } diff --git a/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/activemq.example.keystore b/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/activemq.example.keystore deleted file mode 100644 index 50de6819ee..0000000000 Binary files a/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/activemq.example.keystore and /dev/null differ diff --git a/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/activemq.example.truststore b/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/activemq.example.truststore deleted file mode 100644 index 129391a948..0000000000 Binary files a/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/activemq.example.truststore and /dev/null differ diff --git a/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/client-side-keystore.jks b/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/client-side-keystore.jks new file mode 100644 index 0000000000..cb65a44ddc Binary files /dev/null and b/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/client-side-keystore.jks differ diff --git a/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/client-side-truststore.jks b/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/client-side-truststore.jks new file mode 100644 index 0000000000..7eb1d5634d Binary files /dev/null and b/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/client-side-truststore.jks differ diff --git a/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/management.xml b/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/management.xml index 0bf2b62e8d..802079c88f 100644 --- a/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/management.xml +++ b/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/management.xml @@ -20,10 +20,10 @@ connector-port="1099" connector-host="localhost" secured="true" - key-store-path="${data.dir}/../etc/activemq.example.keystore" - key-store-password="activemqexample" - trust-store-path="${data.dir}/../etc/activemq.example.truststore" - trust-store-password="activemqexample"/> + key-store-path="${data.dir}/../etc/server-side-keystore.jks" + key-store-password="secureexample" + trust-store-path="${data.dir}/../etc/server-side-truststore.jks" + trust-store-password="secureexample"/> diff --git a/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/server-side-keystore.jks b/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/server-side-keystore.jks new file mode 100644 index 0000000000..6089c6ee13 Binary files /dev/null and b/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/server-side-keystore.jks differ diff --git a/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/server-side-truststore.jks b/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/server-side-truststore.jks new file mode 100644 index 0000000000..0b7e224163 Binary files /dev/null and b/examples/features/standard/jmx-ssl/src/main/resources/activemq/server0/server-side-truststore.jks differ diff --git a/examples/features/standard/pom.xml b/examples/features/standard/pom.xml index 0d4b2f8b03..7ff8ded4f1 100644 --- a/examples/features/standard/pom.xml +++ b/examples/features/standard/pom.xml @@ -41,12 +41,15 @@ under the License. release - bridge + auto-closeable browser broker-plugin cdi client-kickoff + completion-listener consumer-rate-limit + context + core-bridge database dead-letter delayed-redelivery @@ -61,11 +64,7 @@ under the License. interceptor-mqtt interceptor-amqp instantiate-connection-factory - jms-auto-closeable jms-bridge - jms-completion-listener - jms-context - jms-shared-consumer jmx jmx-ssl large-message @@ -90,32 +89,36 @@ under the License. security security-ldap send-acknowledgements + shared-consumer slow-consumer spring-integration ssl-enabled + ssl-enabled-crl-mqtt ssl-enabled-dual-authentication static-selector temp-queue topic topic-hierarchies - topic-selector-example1 - topic-selector-example2 + topic-selector1 + topic-selector2 transactional xa-heuristic xa-receive xa-send - ssl-enabled-crl-mqtt examples - bridge + auto-closeable browser broker-plugin cdi client-kickoff + completion-listener consumer-rate-limit + context + core-bridge database dead-letter delayed-redelivery @@ -129,12 +132,8 @@ under the License. interceptor-client interceptor-mqtt interceptor-amqp - jms-auto-closeable instantiate-connection-factory jms-bridge - jms-completion-listener - jms-context - jms-shared-consumer jmx jmx-ssl large-message @@ -153,16 +152,17 @@ under the License. queue-requestor queue-selector reattach-node - - request-reply rest + request-reply scheduled-message security security-ldap send-acknowledgements + shared-consumer slow-consumer spring-integration ssl-enabled + ssl-enabled-crl-mqtt ssl-enabled-dual-authentication static-selector @@ -172,13 +172,12 @@ under the License. temp-queue topic topic-hierarchies - topic-selector-example1 - topic-selector-example2 + topic-selector1 + topic-selector2 transactional xa-heuristic xa-receive xa-send - ssl-enabled-crl-mqtt diff --git a/examples/features/standard/jms-shared-consumer/pom.xml b/examples/features/standard/shared-consumer/pom.xml similarity index 100% rename from examples/features/standard/jms-shared-consumer/pom.xml rename to examples/features/standard/shared-consumer/pom.xml diff --git a/examples/features/standard/jms-shared-consumer/readme.md b/examples/features/standard/shared-consumer/readme.md similarity index 100% rename from examples/features/standard/jms-shared-consumer/readme.md rename to examples/features/standard/shared-consumer/readme.md diff --git a/examples/features/standard/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java b/examples/features/standard/shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java similarity index 100% rename from examples/features/standard/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java rename to examples/features/standard/shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java diff --git a/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/shared-consumer/src/main/resources/activemq/server0/broker.xml similarity index 100% rename from examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml rename to examples/features/standard/shared-consumer/src/main/resources/activemq/server0/broker.xml diff --git a/examples/features/standard/jms-shared-consumer/src/main/resources/jndi.properties b/examples/features/standard/shared-consumer/src/main/resources/jndi.properties similarity index 100% rename from examples/features/standard/jms-shared-consumer/src/main/resources/jndi.properties rename to examples/features/standard/shared-consumer/src/main/resources/jndi.properties diff --git a/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml index b6bda092ae..066b92fd58 100644 --- a/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml @@ -18,6 +18,7 @@ specific language governing permissions and limitations under the License. --> + ./data/messaging/bindings ./data/messaging/journal diff --git a/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml index a9877281c9..ee0398bfc5 100644 --- a/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml @@ -37,6 +37,7 @@ under the License. + @@ -44,20 +45,6 @@ under the License. - - - - - - - - -
- - - -
-
diff --git a/examples/features/standard/topic-selector-example1/pom.xml b/examples/features/standard/topic-selector1/pom.xml similarity index 100% rename from examples/features/standard/topic-selector-example1/pom.xml rename to examples/features/standard/topic-selector1/pom.xml diff --git a/examples/features/standard/topic-selector-example1/readme.md b/examples/features/standard/topic-selector1/readme.md similarity index 100% rename from examples/features/standard/topic-selector-example1/readme.md rename to examples/features/standard/topic-selector1/readme.md diff --git a/examples/features/standard/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java b/examples/features/standard/topic-selector1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java similarity index 100% rename from examples/features/standard/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java rename to examples/features/standard/topic-selector1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java diff --git a/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/topic-selector1/src/main/resources/activemq/server0/broker.xml similarity index 100% rename from examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml rename to examples/features/standard/topic-selector1/src/main/resources/activemq/server0/broker.xml diff --git a/examples/features/standard/topic-selector-example1/src/main/resources/jndi.properties b/examples/features/standard/topic-selector1/src/main/resources/jndi.properties similarity index 100% rename from examples/features/standard/topic-selector-example1/src/main/resources/jndi.properties rename to examples/features/standard/topic-selector1/src/main/resources/jndi.properties diff --git a/examples/features/standard/topic-selector-example2/pom.xml b/examples/features/standard/topic-selector2/pom.xml similarity index 100% rename from examples/features/standard/topic-selector-example2/pom.xml rename to examples/features/standard/topic-selector2/pom.xml diff --git a/examples/features/standard/topic-selector-example2/readme.md b/examples/features/standard/topic-selector2/readme.md similarity index 100% rename from examples/features/standard/topic-selector-example2/readme.md rename to examples/features/standard/topic-selector2/readme.md diff --git a/examples/features/standard/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java b/examples/features/standard/topic-selector2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java similarity index 100% rename from examples/features/standard/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java rename to examples/features/standard/topic-selector2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java diff --git a/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/topic-selector2/src/main/resources/activemq/server0/broker.xml similarity index 100% rename from examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml rename to examples/features/standard/topic-selector2/src/main/resources/activemq/server0/broker.xml diff --git a/examples/features/standard/topic-selector-example2/src/main/resources/jndi.properties b/examples/features/standard/topic-selector2/src/main/resources/jndi.properties similarity index 100% rename from examples/features/standard/topic-selector-example2/src/main/resources/jndi.properties rename to examples/features/standard/topic-selector2/src/main/resources/jndi.properties diff --git a/examples/protocols/amqp/pom.xml b/examples/protocols/amqp/pom.xml index f09f4ec663..186f668557 100644 --- a/examples/protocols/amqp/pom.xml +++ b/examples/protocols/amqp/pom.xml @@ -56,8 +56,9 @@ under the License. examples - + queue proton-ruby diff --git a/examples/protocols/mqtt/clustered-queue-mqtt/pom.xml b/examples/protocols/mqtt/clustered-queue-mqtt/pom.xml index 190cfbe137..be1d87f962 100644 --- a/examples/protocols/mqtt/clustered-queue-mqtt/pom.xml +++ b/examples/protocols/mqtt/clustered-queue-mqtt/pom.xml @@ -29,7 +29,7 @@ under the License. clustered-queue-mqtt jar - ActiveMQ Artemis JMS Clustered Queue Example + ActiveMQ Artemis MQTT Clustered Queue Example ${project.basedir}/../../../.. @@ -117,7 +117,7 @@ under the License. runClient - org.apache.activemq.artemis.jms.example.ClusteredQueueMQTTExample + org.apache.activemq.artemis.mqtt.example.ClusteredQueueMQTTExample @@ -149,7 +149,7 @@ under the License. - org.apache.activemq.examples.clustered + org.apache.activemq.examples.mqtt clustered-queue-mqtt ${project.version} diff --git a/examples/protocols/mqtt/clustered-queue-mqtt/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueMQTTExample.java b/examples/protocols/mqtt/clustered-queue-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/ClusteredQueueMQTTExample.java similarity index 98% rename from examples/protocols/mqtt/clustered-queue-mqtt/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueMQTTExample.java rename to examples/protocols/mqtt/clustered-queue-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/ClusteredQueueMQTTExample.java index 51845accba..3ac5b49e35 100644 --- a/examples/protocols/mqtt/clustered-queue-mqtt/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueMQTTExample.java +++ b/examples/protocols/mqtt/clustered-queue-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/ClusteredQueueMQTTExample.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.activemq.artemis.jms.example; +package org.apache.activemq.artemis.mqtt.example; import java.util.concurrent.TimeUnit; import org.fusesource.mqtt.client.BlockingConnection; diff --git a/examples/protocols/mqtt/pom.xml b/examples/protocols/mqtt/pom.xml index 5df091caa2..c215d65a63 100644 --- a/examples/protocols/mqtt/pom.xml +++ b/examples/protocols/mqtt/pom.xml @@ -40,15 +40,15 @@ under the License. release - basic-pubsub clustered-queue-mqtt + publish-subscribe examples - basic-pubsub clustered-queue-mqtt + publish-subscribe diff --git a/examples/protocols/mqtt/basic-pubsub/pom.xml b/examples/protocols/mqtt/publish-subscribe/pom.xml similarity index 91% rename from examples/protocols/mqtt/basic-pubsub/pom.xml rename to examples/protocols/mqtt/publish-subscribe/pom.xml index 73671b4cb2..a2f58281e9 100644 --- a/examples/protocols/mqtt/basic-pubsub/pom.xml +++ b/examples/protocols/mqtt/publish-subscribe/pom.xml @@ -27,9 +27,9 @@ under the License. 2.5.0-SNAPSHOT - artemis-mqtt-publish-example + publish-subscribe jar - ActiveMQ Artemis MQTT Publish Example + ActiveMQ Artemis MQTT Publish/Subscribe Example ${project.basedir}/../../../.. @@ -60,6 +60,7 @@ under the License. cli + ${noServer} true tcp://localhost:61616 @@ -73,10 +74,7 @@ under the License. runClient - org.apache.activemq.artemis.mqtt.example.MQTTBasicPubSubExample - - ${basedir}/target/server0 - + org.apache.activemq.artemis.mqtt.example.MQTTPublishSubscribeExample @@ -85,6 +83,7 @@ under the License. cli + ${noServer} stop @@ -94,7 +93,7 @@ under the License. org.apache.activemq.examples.mqtt - artemis-mqtt-publish-example + publish-subscribe ${project.version} diff --git a/examples/protocols/mqtt/basic-pubsub/readme.md b/examples/protocols/mqtt/publish-subscribe/readme.md similarity index 99% rename from examples/protocols/mqtt/basic-pubsub/readme.md rename to examples/protocols/mqtt/publish-subscribe/readme.md index a8207e13b1..75cd36f50e 100644 --- a/examples/protocols/mqtt/basic-pubsub/readme.md +++ b/examples/protocols/mqtt/publish-subscribe/readme.md @@ -1,4 +1,4 @@ -# MQTT Example +# MQTT Publish/Subscribe Example This is a basic MQTT example that demonstrates how to setup and connect to an Apache Artemis broker and send and receive messages using the MQTT protocol. diff --git a/examples/protocols/mqtt/basic-pubsub/src/main/java/org/apache/activemq/artemis/mqtt/example/MQTTBasicPubSubExample.java b/examples/protocols/mqtt/publish-subscribe/src/main/java/org/apache/activemq/artemis/mqtt/example/MQTTPublishSubscribeExample.java similarity index 98% rename from examples/protocols/mqtt/basic-pubsub/src/main/java/org/apache/activemq/artemis/mqtt/example/MQTTBasicPubSubExample.java rename to examples/protocols/mqtt/publish-subscribe/src/main/java/org/apache/activemq/artemis/mqtt/example/MQTTPublishSubscribeExample.java index dd64731e10..2c8cb18188 100644 --- a/examples/protocols/mqtt/basic-pubsub/src/main/java/org/apache/activemq/artemis/mqtt/example/MQTTBasicPubSubExample.java +++ b/examples/protocols/mqtt/publish-subscribe/src/main/java/org/apache/activemq/artemis/mqtt/example/MQTTPublishSubscribeExample.java @@ -27,7 +27,7 @@ import org.fusesource.mqtt.client.Topic; /** * A simple MQTT publish and subscribe example. */ -public class MQTTBasicPubSubExample { +public class MQTTPublishSubscribeExample { public static void main(final String[] args) throws Exception { // Create a new MQTT connection to the broker. We are not setting the client ID. The broker will pick one for us. diff --git a/examples/protocols/openwire/message-listener/pom.xml b/examples/protocols/openwire/message-listener/pom.xml index db947f4a09..f17c34976c 100644 --- a/examples/protocols/openwire/message-listener/pom.xml +++ b/examples/protocols/openwire/message-listener/pom.xml @@ -29,7 +29,7 @@ under the License. message-listener jar - ActiveMQ Artemis JMS Queue Example for openwire + ActiveMQ Artemis OpenWire JMS Message Listener Example ${project.basedir}/../../../.. @@ -84,7 +84,7 @@ under the License. runClient - org.apache.activemq.artemis.jms.example.QueueExample + org.apache.activemq.artemis.jms.example.MessageListenerExample diff --git a/examples/protocols/openwire/message-listener/readme.md b/examples/protocols/openwire/message-listener/readme.md index 04c43d34f8..b82e6f7894 100644 --- a/examples/protocols/openwire/message-listener/readme.md +++ b/examples/protocols/openwire/message-listener/readme.md @@ -1,5 +1,5 @@ -# JMS Queue Message Listener for OpenWire +# OpenWire JMS Message Listener Example To run the example, simply type **mvn verify** from this directory, or **mvn -PnoServer verify** if you want to start and create the broker manually. -This example shows how to use a MessageListener with the OpenWire client \ No newline at end of file +This example shows how to use a MessageListener with the OpenWire client. \ No newline at end of file diff --git a/examples/protocols/openwire/message-listener/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java b/examples/protocols/openwire/message-listener/src/main/java/org/apache/activemq/artemis/jms/example/MessageListenerExample.java similarity index 95% rename from examples/protocols/openwire/message-listener/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java rename to examples/protocols/openwire/message-listener/src/main/java/org/apache/activemq/artemis/jms/example/MessageListenerExample.java index cfb0acab79..61f444de16 100644 --- a/examples/protocols/openwire/message-listener/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java +++ b/examples/protocols/openwire/message-listener/src/main/java/org/apache/activemq/artemis/jms/example/MessageListenerExample.java @@ -30,10 +30,7 @@ import java.util.concurrent.TimeUnit; import org.apache.activemq.ActiveMQConnectionFactory; -/** - * A simple JMS Queue example that creates a producer and consumer on a queue and sends then receives a message. - */ -public class QueueExample { +public class MessageListenerExample { public static void main(final String[] args) throws Exception { Connection connection = null; diff --git a/examples/protocols/openwire/message-recovery/pom.xml b/examples/protocols/openwire/message-recovery/pom.xml index 62bf8e4d86..2481834c7b 100644 --- a/examples/protocols/openwire/message-recovery/pom.xml +++ b/examples/protocols/openwire/message-recovery/pom.xml @@ -29,7 +29,7 @@ under the License. message-recovery jar - ActiveMQ Artemis JMS Queue Example for openwire + ActiveMQ Artemis OpenWire JMS Message Recovery Example ${project.basedir}/../../../.. @@ -79,7 +79,7 @@ under the License. runClient - org.apache.activemq.artemis.jms.example.QueueExample + org.apache.activemq.artemis.jms.example.MessageRecoveryExample ${basedir}/target/server0 diff --git a/examples/protocols/openwire/message-recovery/readme.md b/examples/protocols/openwire/message-recovery/readme.md index a276fa20ab..0df251c797 100644 --- a/examples/protocols/openwire/message-recovery/readme.md +++ b/examples/protocols/openwire/message-recovery/readme.md @@ -1,5 +1,5 @@ -# JMS Queue Message Listener for OpenWire +# OpenWire JMS Message Recovery Example This example will start and stop the broker within the example. -This example shows how to use send messages to a queue, and having these messages recovered from the journal. \ No newline at end of file +This example shows how to use send messages to a queue and having these messages recovered from the journal when the broker is restarted. \ No newline at end of file diff --git a/examples/protocols/openwire/message-recovery/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java b/examples/protocols/openwire/message-recovery/src/main/java/org/apache/activemq/artemis/jms/example/MessageRecoveryExample.java similarity index 90% rename from examples/protocols/openwire/message-recovery/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java rename to examples/protocols/openwire/message-recovery/src/main/java/org/apache/activemq/artemis/jms/example/MessageRecoveryExample.java index 4ecbb50933..75b01fbcdc 100644 --- a/examples/protocols/openwire/message-recovery/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java +++ b/examples/protocols/openwire/message-recovery/src/main/java/org/apache/activemq/artemis/jms/example/MessageRecoveryExample.java @@ -31,16 +31,13 @@ import java.util.concurrent.TimeUnit; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.artemis.util.ServerUtil; -/** - * A simple JMS Queue example that creates a producer and consumer on a queue and sends then receives a message. - */ -public class QueueExample { +public class MessageRecoveryExample { public static void main(final String[] args) throws Exception { Connection connection = null; Process server0 = null; try { - server0 = ServerUtil.startServer(args[0], QueueExample.class.getSimpleName() + "0", 0, 5000); + server0 = ServerUtil.startServer(args[0], MessageRecoveryExample.class.getSimpleName() + "0", 0, 5000); ConnectionFactory cf = new ActiveMQConnectionFactory(); @@ -66,7 +63,7 @@ public class QueueExample { ServerUtil.killServer(server0); - server0 = ServerUtil.startServer(args[0], QueueExample.class.getSimpleName() + "0", 0, 5000); + server0 = ServerUtil.startServer(args[0], MessageRecoveryExample.class.getSimpleName() + "0", 0, 5000); ServerUtil.waitForServerToStart(0, 5000); diff --git a/examples/protocols/openwire/queue/pom.xml b/examples/protocols/openwire/queue/pom.xml index facd57424e..becdc5f14f 100644 --- a/examples/protocols/openwire/queue/pom.xml +++ b/examples/protocols/openwire/queue/pom.xml @@ -29,7 +29,7 @@ under the License. queue-openwire jar - ActiveMQ Artemis JMS Queue Example for openwire + ActiveMQ Artemis OpenWire JMS Queue Example ${project.basedir}/../../../.. diff --git a/examples/protocols/openwire/queue/readme.md b/examples/protocols/openwire/queue/readme.md index 4d77c34c36..7f4f0b9ad3 100644 --- a/examples/protocols/openwire/queue/readme.md +++ b/examples/protocols/openwire/queue/readme.md @@ -1,13 +1,9 @@ -# JMS Queue Example for OpenWire +# OpenWire JMS Queue Example To run the example, simply type **mvn verify** from this directory, or **mvn -PnoServer verify** if you want to start and create the broker manually. -This example shows you how to send and receive a message to a JMS Queue using ActiveMQ Artemis. +This example shows you how to send and receive a message to a JMS queue using ActiveMQ Artemis. This example does exactly the same as the "queue" example however using the OpenWire client. -Queues are a standard part of JMS, please consult the JMS 1.1 specification for full details. - -A Queue is used to send messages point to point, from a producer to a consumer. The queue guarantees message ordering between these 2 points. - -Notice this example is using pretty much a default stock configuration \ No newline at end of file +Notice this example is using the default configuration. \ No newline at end of file diff --git a/examples/protocols/stomp/stomp-dual-authentication/pom.xml b/examples/protocols/stomp/stomp-dual-authentication/pom.xml index b9f3883c9c..ffcc34e897 100644 --- a/examples/protocols/stomp/stomp-dual-authentication/pom.xml +++ b/examples/protocols/stomp/stomp-dual-authentication/pom.xml @@ -80,13 +80,10 @@ under the License. runClient - org.apache.activemq.artemis.jms.example.StompDualAuthenticationExample - ${project.basedir}/target/server0/etc/client-side-keystore.jks - secureexample - ${project.basedir}/target/server0/etc/client-side-truststore.jks - secureexample - + ${project.build.outputDirectory}/activemq/server0/ + + org.apache.activemq.artemis.jms.example.StompDualAuthenticationExample diff --git a/examples/protocols/stomp/stomp-dual-authentication/src/main/java/org/apache/activemq/artemis/jms/example/StompDualAuthenticationExample.java b/examples/protocols/stomp/stomp-dual-authentication/src/main/java/org/apache/activemq/artemis/jms/example/StompDualAuthenticationExample.java index 75d015c6bd..dd5259d17b 100644 --- a/examples/protocols/stomp/stomp-dual-authentication/src/main/java/org/apache/activemq/artemis/jms/example/StompDualAuthenticationExample.java +++ b/examples/protocols/stomp/stomp-dual-authentication/src/main/java/org/apache/activemq/artemis/jms/example/StompDualAuthenticationExample.java @@ -42,17 +42,18 @@ public class StompDualAuthenticationExample { private static final String END_OF_FRAME = "\u0000"; public static void main(final String[] args) throws Exception { - // set up SSL keystores for Stomp connection - System.setProperty("javax.net.ssl.keyStore", args[0]); - System.setProperty("javax.net.ssl.keyStorePassword", args[1]); - System.setProperty("javax.net.ssl.trustStore", args[2]); - System.setProperty("javax.net.ssl.trustStorePassword", args[3]); Connection connection = null; InitialContext initialContext = null; Security.addProvider(new Provider()); try { + // set up SSL keystores for Stomp connection + System.setProperty("javax.net.ssl.trustStore", args[0] + "client-side-truststore.jks"); + System.setProperty("javax.net.ssl.trustStorePassword", "secureexample"); + System.setProperty("javax.net.ssl.keyStore", args[0] + "client-side-keystore.jks"); + System.setProperty("javax.net.ssl.keyStorePassword", "secureexample"); + // Step 1. Create an SSL socket to connect to the broker SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault(); SSLSocket socket = (SSLSocket) sslsocketfactory.createSocket("localhost", 5500); @@ -114,6 +115,11 @@ public class StompDualAuthenticationExample { if (connection != null) { connection.close(); } + + System.clearProperty("javax.net.ssl.trustStore"); + System.clearProperty("javax.net.ssl.trustStorePassword"); + System.clearProperty("javax.net.ssl.keyStore"); + System.clearProperty("javax.net.ssl.keyStorePassword"); } } diff --git a/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml b/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml index cf0bb4c139..1bba774894 100644 --- a/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml +++ b/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml @@ -31,7 +31,7 @@ under the License. tcp://localhost:61616 - tcp://localhost:5500?sslEnabled=true;needClientAuth=true;keyStorePath=${data.dir}/../etc/server-side-keystore.jks;keyStorePassword=secureexample;trustStorePath=${data.dir}/../etc/server-side-truststore.jks;trustStorePassword=secureexample + tcp://localhost:5500?sslEnabled=true;needClientAuth=true;keyStorePath=server-side-keystore.jks;keyStorePassword=secureexample;trustStorePath=server-side-truststore.jks;trustStorePassword=secureexample @@ -47,7 +47,7 @@ under the License.
- +
diff --git a/examples/protocols/stomp/stomp-jms/pom.xml b/examples/protocols/stomp/stomp-jms/pom.xml index a1541e9462..2b38bc17ab 100644 --- a/examples/protocols/stomp/stomp-jms/pom.xml +++ b/examples/protocols/stomp/stomp-jms/pom.xml @@ -29,7 +29,7 @@ under the License. stomp-jms jar - ActiveMQ Artemis JMS Stomp JMS Example + ActiveMQ Artemis Stomp JMS Example ${project.basedir}/../../../.. diff --git a/examples/protocols/stomp/stomp-jms/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java b/examples/protocols/stomp/stomp-jms/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java index 838a7e42ad..020b14c7fe 100644 --- a/examples/protocols/stomp/stomp-jms/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java +++ b/examples/protocols/stomp/stomp-jms/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java @@ -43,7 +43,7 @@ public class StompExample { connection.start(); - System.out.println("Waiting 20 seconds"); + System.out.println("Waiting 10 seconds"); Thread.sleep(10000); // increase this and it will fail System.out.println("waited"); diff --git a/examples/protocols/stomp/stomp-jms/src/main/resources/activemq/server0/broker.xml b/examples/protocols/stomp/stomp-jms/src/main/resources/activemq/server0/broker.xml new file mode 100644 index 0000000000..7bb1f3c3e2 --- /dev/null +++ b/examples/protocols/stomp/stomp-jms/src/main/resources/activemq/server0/broker.xml @@ -0,0 +1,44 @@ + + + + + + ./data/messaging/bindings + + ./data/messaging/journal + + ./data/messaging/largemessages + + ./data/messaging/paging + + + tcp://localhost:61616?anycastPrefix=/queue/ + + + + + + + + + + + + diff --git a/examples/protocols/stomp/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java b/examples/protocols/stomp/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java index 9515ae9a3b..e2eebfd1a1 100644 --- a/examples/protocols/stomp/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java +++ b/examples/protocols/stomp/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java @@ -46,8 +46,6 @@ public class StompExample { // Step 2. Send a CONNECT frame to connect to the server String connectFrame = "CONNECT\n" + - "login: guest\n" + - "passcode: guest\n" + "request-id: 1\n" + "\n" + END_OF_FRAME; diff --git a/examples/protocols/stomp/stomp/src/main/resources/activemq/server0/broker.xml b/examples/protocols/stomp/stomp/src/main/resources/activemq/server0/broker.xml new file mode 100644 index 0000000000..8a33c10244 --- /dev/null +++ b/examples/protocols/stomp/stomp/src/main/resources/activemq/server0/broker.xml @@ -0,0 +1,53 @@ + + + + + + ./data/messaging/bindings + + ./data/messaging/journal + + ./data/messaging/largemessages + + ./data/messaging/paging + + + tcp://localhost:61616?protocols=CORE + tcp://localhost:61613?protocols=STOMP + + + + + + + + + + + + + + ANYCAST + ANYCAST + + + + + diff --git a/examples/protocols/stomp/stomp1.1/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java b/examples/protocols/stomp/stomp1.1/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java index c14b861af9..d07c4ef1d2 100644 --- a/examples/protocols/stomp/stomp1.1/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java +++ b/examples/protocols/stomp/stomp1.1/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java @@ -48,8 +48,6 @@ public class StompExample { String connectFrame = "CONNECT\n" + "accept-version:1.1\n" + "host:localhost\n" + - "login:guest\n" + - "passcode:guest\n" + "request-id:1\n" + "\n" + END_OF_FRAME; @@ -63,6 +61,7 @@ public class StompExample { String text = "Hello World from Stomp 1.1 !"; String message = "SEND\n" + "destination:exampleQueue\n" + + "destination-type:ANYCAST\n" + "\n" + text + END_OF_FRAME; diff --git a/examples/protocols/stomp/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java b/examples/protocols/stomp/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java index 3a8e37abf0..2effdc7926 100644 --- a/examples/protocols/stomp/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java +++ b/examples/protocols/stomp/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java @@ -48,8 +48,6 @@ public class StompExample { String connectFrame = "CONNECT\n" + "accept-version:1.2\n" + "host:localhost\n" + - "login:guest\n" + - "passcode:guest\n" + "request-id:1\n" + "\n" + END_OF_FRAME; @@ -63,6 +61,7 @@ public class StompExample { String text = "Hello World from Stomp 1.2 !"; String message = "SEND\n" + "destination:exampleQueue\n" + + "destination-type:ANYCAST\n" + "\n" + text + END_OF_FRAME;