From a102983d7aa01d44c76c44100cbf9af30c977fa5 Mon Sep 17 00:00:00 2001 From: jbertram Date: Mon, 8 Dec 2014 22:31:39 -0600 Subject: [PATCH] ACTIVEMQ6-51 Example server bootstrapping --- activemq-maven-plugin/pom.xml | 61 +++++ .../apache/activemq/maven/ActiveMQClient.java | 27 ++ .../activemq/maven/ActiveMQClientPlugin.java | 72 +++++ .../activemq/maven/ActiveMQStartPlugin.java | 228 ++++++++++++++++ .../activemq/maven/ActiveMQStopPlugin.java | 78 ++++++ .../activemq/maven/InVMNodeManagerServer.java | 73 +++++ .../org/apache/activemq/maven/PluginUtil.java | 50 ++++ .../activemq/maven/TestClusterManager.java | 52 ++++ .../maven/TestClusterManagerMBean.java | 29 ++ .../org/apache/activemq/maven/TestNode.java | 49 ++++ .../activemq/server/ActiveMQBootstrap.java | 258 ++++++++++++++++++ .../server/SpawnedActiveMQBootstrap.java | 41 +++ .../activemq/server/SpawnedVMSupport.java | 257 +++++++++++++++++ examples/core/perf/pom.xml | 4 +- examples/core/vertx-connector/pom.xml | 2 +- .../common/example/ActiveMQExample.java | 16 +- examples/jms/aerogear/pom.xml | 2 +- examples/jms/aerogear/readme.html | 8 +- .../activemq/jms/example/AerogearExample.java | 2 +- .../server0/activemq-configuration.xml | 17 +- .../activemq}/server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties} | 3 +- examples/jms/applet/pom.xml | 4 +- .../jms/example/HttpStaticFileServer.java | 4 +- .../example/HttpStaticFileServerHandler.java | 36 +-- .../HttpStaticFileServerPipelineFactory.java | 12 +- .../server0/activemq-configuration.xml | 7 - .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../jms/application-layer-failover/pom.xml | 14 +- .../ApplicationLayerFailoverExample.java | 9 +- .../server0/activemq-configuration.xml | 9 - .../server0}/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 9 - .../activemq/server1}/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 examples/jms/bridge/pom.xml | 8 +- .../activemq/jms/example/BridgeExample.java | 18 +- .../server0/activemq-configuration.xml | 5 - .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 9 - .../server1/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 examples/jms/browser/pom.xml | 2 +- .../jms/example/QueueBrowserExample.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties} | 3 +- examples/jms/client-kickoff/pom.xml | 2 +- .../jms/example/ClientKickoffExample.java | 2 +- .../server0/activemq-configuration.xml | 7 - .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties} | 0 .../jms/client-side-failoverlistener/pom.xml | 14 +- .../client-side-failoverlistener/readme.html | 2 +- .../ClientSideFailoverListerExample.java | 2 +- .../server0/activemq-configuration.xml | 0 .../server0}/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../activemq/server1}/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 7 + .../jms/client-side-load-balancing/pom.xml | 28 +- .../ClientSideLoadBalancingExample.java | 2 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../server1/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 .../server2/activemq-configuration.xml | 0 .../server2/activemq-jms.xml | 0 .../server2/activemq-users.xml | 0 .../src/main/resources/jndi.properties} | 3 +- .../clustered-durable-subscription/pom.xml | 18 +- .../ClusteredDurableSubscriptionExample.java | 14 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../server1/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 examples/jms/clustered-grouping/pom.xml | 16 +- .../jms/example/ClusteredGroupingExample.java | 25 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../server1/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 .../server2/activemq-configuration.xml | 0 .../server2/activemq-jms.xml | 0 .../server2/activemq-users.xml | 0 examples/jms/clustered-jgroups/pom.xml | 10 +- .../jms/example/ClusteredJgroupsExample.java | 13 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../activemq}/server0/client-jndi.properties | 0 .../server0/test-jgroups-file_ping.xml | 0 .../server1/activemq-configuration.xml | 0 .../server1/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 .../server1/client-jndi.properties | 0 .../server1/test-jgroups-file_ping.xml | 0 examples/jms/clustered-queue/pom.xml | 10 +- .../jms/example/ClusteredQueueExample.java | 13 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../server1/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 examples/jms/clustered-standalone/pom.xml | 16 +- .../example/ClusteredStandaloneExample.java | 35 +-- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../server1}/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 .../server2/activemq-configuration.xml | 0 .../server2}/activemq-jms.xml | 1 - .../server2/activemq-users.xml | 0 .../jms/clustered-static-discovery/pom.xml | 22 +- .../example/StaticClusteredQueueExample.java | 10 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../server1/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 .../server2/activemq-configuration.xml | 0 .../server2/activemq-jms.xml | 0 .../server2/activemq-users.xml | 0 .../server3/activemq-configuration.xml | 0 .../server3/activemq-jms.xml | 0 .../server3/activemq-users.xml | 0 examples/jms/clustered-static-oneway/pom.xml | 16 +- .../example/ClusterStaticOnewayExample.java | 8 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../server1/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 .../server2/activemq-configuration.xml | 0 .../server2/activemq-jms.xml | 0 .../server2/activemq-users.xml | 0 examples/jms/clustered-topic/pom.xml | 10 +- .../jms/example/ClusteredTopicExample.java | 13 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../server1/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 .../jms/colocated-failover-scale-down/pom.xml | 10 +- .../ColocatedFailoverScaleDownExample.java | 18 +- .../server0/activemq-configuration.xml | 11 + .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 11 + .../server1/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 examples/jms/colocated-failover/pom.xml | 14 +- .../jms/example/ColocatedFailoverExample.java | 18 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../server1/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 examples/jms/consumer-rate-limit/pom.xml | 2 +- .../jms/example/ConsumerRateLimitExample.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../activemq}/server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 4 + examples/jms/dead-letter/pom.xml | 2 +- .../jms/example/DeadLetterExample.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 4 + examples/jms/delayed-redelivery/pom.xml | 2 +- .../jms/example/DelayedRedeliveryExample.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/divert/pom.xml | 10 +- .../activemq/jms/example/DivertExample.java | 16 +- .../server0/activemq-configuration.xml | 6 - .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 9 - .../server1/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 examples/jms/durable-subscription/pom.xml | 2 +- .../example/DurableSubscriptionExample.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/embedded-simple/pom.xml | 2 +- .../activemq/jms/example/EmbeddedExample.java | 9 + .../main/resources/activemq-configuration.xml | 7 - .../activemq/jms/example/EmbeddedExample.java | 12 +- examples/jms/expiry/pom.xml | 2 +- .../activemq/jms/example/ExpiryExample.java | 2 +- .../server0/activemq-configuration.xml | 9 - .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../expiry/src/main/resources/jndi.properties | 4 + examples/jms/ha-policy-autobackup/pom.xml | 8 +- .../example/HAPolicyAutoBackupExample.java | 22 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../activemq/server1}/activemq-jms.xml | 0 .../server1/activemq-users.xml | 0 examples/jms/http-transport/pom.xml | 2 +- .../jms/example/HttpTransportExample.java | 2 +- .../server0/activemq-configuration.xml | 10 +- .../activemq}/server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../server0/activemq-configuration.xml | 46 ---- .../src/main/resources/jndi.properties | 3 + .../instantiate-connection-factory/pom.xml | 2 +- .../server0/activemq-configuration.xml | 9 +- .../server0/activemq-jms.xml | 4 +- .../server0/activemq-users.xml | 0 .../server0/activemq-configuration.xml | 45 --- examples/jms/interceptor/pom.xml | 2 +- .../jms/example/InterceptorExample.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../activemq}/server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/jaas/pom.xml | 3 +- .../activemq/jms/example/JAASExample.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../activemq}/server0/activemq-jms.xml | 0 .../server0/activemq-configuration.xml | 43 --- .../jaas/src/main/resources/jndi.properties | 3 + examples/jms/jms-auto-closeable/pom.xml | 5 +- .../jms/example/JMSAutoCloseableExample.java | 2 +- .../server0/activemq-configuration.xml | 9 - .../activemq}/server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/jms-bridge/pom.xml | 10 +- .../jms/example/JMSBridgeExample.java | 12 +- .../server0/activemq-configuration.xml | 7 - .../server0/activemq-jms.xml | 0 .../server0}/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 11 - .../server1/activemq-jms.xml | 0 .../activemq/server1}/activemq-users.xml | 0 examples/jms/jms-completion-listener/pom.xml | 5 +- .../example/JMSCompletionListenerExample.java | 2 +- .../server0/activemq-configuration.xml | 34 +++ .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/jms-context/pom.xml | 5 +- .../jms/example/JMSContextExample.java | 2 +- .../server0/activemq-configuration.xml | 34 +++ .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../server0/activemq-configuration.xml | 43 --- .../src/main/resources/jndi.properties | 3 + examples/jms/jms-shared-consumer/pom.xml | 2 +- .../jms/example/JMSSharedConsumerExample.java | 2 +- .../server0/activemq-configuration.xml | 9 - .../server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/jmx/pom.xml | 5 +- .../activemq/jms/example/JMXExample.java | 2 +- .../server0/activemq-configuration.xml | 7 - .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../jmx/src/main/resources/jndi.properties | 3 + examples/jms/large-message/pom.xml | 5 +- .../jms/example/LargeMessageExample.java | 8 +- .../server0/activemq-configuration.xml | 34 +++ .../activemq/server0}/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/last-value-queue/pom.xml | 5 +- .../jms/example/LastValueQueueExample.java | 2 +- .../server0/activemq-configuration.xml | 16 +- .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../server0/activemq-configuration.xml | 50 ---- .../src/main/resources/jndi.properties | 3 + examples/jms/management-notifications/pom.xml | 5 +- .../ManagementNotificationExample.java | 2 +- .../server0/activemq-configuration.xml | 6 - .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 4 + examples/jms/management/pom.xml | 5 +- .../jms/example/ManagementExample.java | 2 +- .../server0/activemq-configuration.xml | 6 - .../activemq/server0}/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/message-counters/pom.xml | 5 +- .../jms/example/MessageCounterExample.java | 2 +- .../server0/activemq-configuration.xml | 7 - .../server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 4 + examples/jms/message-group/pom.xml | 5 +- .../jms/example/MessageGroupExample.java | 2 +- .../server0/activemq-configuration.xml | 34 +++ .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/message-group2/pom.xml | 5 +- .../jms/example/MessageGroup2Example.java | 2 +- .../server0/activemq-configuration.xml | 34 +++ .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 4 + examples/jms/message-priority/pom.xml | 5 +- .../jms/example/MessagePriorityExample.java | 2 +- .../server0/activemq-configuration.xml | 34 +++ .../activemq/server0}/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../server0/activemq-configuration.xml | 42 --- .../src/main/resources/jndi.properties | 3 + .../jms/multiple-failover-failback/pom.xml | 21 +- .../MultipleFailoverFailbackExample.java | 2 +- .../server0/activemq-configuration.xml | 0 .../activemq}/server0/activemq-jms.xml | 0 .../server0}/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../activemq}/server1/activemq-jms.xml | 0 .../server1}/activemq-users.xml | 0 .../server2/activemq-configuration.xml | 0 .../activemq}/server2/activemq-jms.xml | 0 .../activemq/server2}/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 7 + examples/jms/multiple-failover/pom.xml | 21 +- .../jms/example/MultipleFailoverExample.java | 3 +- .../server0/activemq-configuration.xml | 0 .../activemq}/server0/activemq-jms.xml | 0 .../server0}/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../activemq/server1}/activemq-jms.xml | 0 .../server1}/activemq-users.xml | 0 .../server2/activemq-configuration.xml | 0 .../activemq/server2}/activemq-jms.xml | 0 .../activemq/server2}/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 7 + examples/jms/no-consumer-buffering/pom.xml | 5 +- .../example/NoConsumerBufferingExample.java | 2 +- .../server0/activemq-configuration.xml | 34 +++ .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../server0/activemq-configuration.xml | 43 --- .../src/main/resources/jndi.properties | 4 + examples/jms/non-transaction-failover/pom.xml | 20 +- .../NonTransactionFailoverExample.java | 2 +- .../server0/activemq-configuration.xml | 0 .../activemq}/server0/activemq-jms.xml | 0 .../server0}/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../activemq/server1}/activemq-jms.xml | 0 .../activemq/server1}/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 7 + examples/jms/openwire/pom.xml | 5 +- .../server0/activemq-configuration.xml | 0 .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 examples/jms/paging/pom.xml | 5 +- .../activemq/jms/example/PagingExample.java | 4 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../paging/src/main/resources/jndi.properties | 4 + examples/jms/perf/pom.xml | 4 +- .../apache/activemq/jms/example/PerfBase.java | 48 +--- .../activemq/jms/example/PerfListener.java | 10 +- .../activemq/jms/example/PerfSender.java | 10 +- .../server0/activemq-configuration.xml} | 12 +- .../server0/activemq-jms.xml | 0 .../server0/activemq-configuration.xml | 34 --- .../perf/src/main/resources/jndi.properties | 3 + .../perf/src/main/resources/perf.properties | 2 +- examples/jms/pre-acknowledge/pom.xml | 2 +- .../jms/example/PreacknowledgeExample.java | 2 +- .../server0/activemq-configuration.xml | 9 - .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/producer-rate-limit/pom.xml | 5 +- .../jms/example/ProducerRateLimitExample.java | 2 +- .../server0/activemq-configuration.xml | 9 - .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 4 + examples/jms/proton-cpp/pom.xml | 4 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 examples/jms/proton-j/pom.xml | 2 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 examples/jms/proton-ruby/pom.xml | 2 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../jms/queue-message-redistribution/pom.xml | 10 +- .../QueueMessageRedistributionExample.java | 13 +- .../server0/activemq-configuration.xml | 0 .../activemq}/server0/activemq-jms.xml | 0 .../server0}/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../activemq/server1}/activemq-jms.xml | 0 .../activemq/server1}/activemq-users.xml | 0 examples/jms/queue-requestor/pom.xml | 5 +- .../jms/example/QueueRequestorExample.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../activemq/server0}/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/queue-selector/pom.xml | 5 +- .../jms/example/QueueSelectorExample.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/queue/pom.xml | 6 +- .../activemq/jms/example/QueueExample.java | 2 +- .../server0/activemq-configuration.xml | 34 +++ .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../server0/activemq-configuration.xml | 43 --- .../queue/src/main/resources/jndi.properties | 3 + examples/jms/reattach-node/pom.xml | 7 +- .../activemq/jms/example/ReattachExample.java | 24 +- .../server0/activemq-configuration.xml | 0 .../activemq}/server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 8 + .../jms/replicated-failback-static/pom.xml | 14 +- .../ReplicatedFailbackStaticExample.java | 4 +- .../server0/activemq-configuration.xml | 1 - .../activemq/server0}/activemq-jms.xml | 0 .../server0}/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../activemq/server1}/activemq-jms.xml | 0 .../activemq/server1}/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 7 + examples/jms/replicated-failback/pom.xml | 14 +- .../example/ReplicatedFailbackExample.java | 4 +- .../server0/activemq-configuration.xml | 1 - .../activemq/server0}/activemq-jms.xml | 0 .../server0}/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../activemq/server1}/activemq-jms.xml | 0 .../activemq/server1}/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 7 + .../jms/replicated-multiple-failover/pom.xml | 21 +- .../ReplicatedMultipleFailoverExample.java | 6 +- .../server0/activemq-configuration.xml | 0 .../activemq}/server0/activemq-jms.xml | 0 .../server0}/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 4 - .../activemq}/server1/activemq-jms.xml | 0 .../server1}/activemq-users.xml | 0 .../server2/activemq-configuration.xml | 4 - .../activemq/server2}/activemq-jms.xml | 0 .../activemq/server2}/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 7 + .../replicated-transaction-failover/pom.xml | 14 +- .../ReplicatedTransactionFailoverExample.java | 4 +- .../server0/activemq-configuration.xml | 0 .../activemq}/server0/activemq-jms.xml | 0 .../server0}/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 4 - .../activemq/server1}/activemq-jms.xml | 0 .../activemq/server1}/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 7 + examples/jms/request-reply/pom.xml | 5 +- .../jms/example/RequestReplyExample.java | 4 +- .../server0/activemq-configuration.xml | 9 - .../activemq/server0}/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 7 + ...hornetq-client.xml => activemq-client.xml} | 0 .../{hornetq-rest.xml => activemq-rest.xml} | 0 ...hornetq-client.xml => activemq-client.xml} | 0 ...hornetq-client.xml => activemq-client.xml} | 0 examples/jms/scale-down/pom.xml | 14 +- .../jms/example/ScaleDownExample.java | 26 +- .../server0/activemq-configuration.xml | 4 - .../activemq}/server0/activemq-jms.xml | 0 .../server0}/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../activemq/server1}/activemq-jms.xml | 0 .../activemq/server1}/activemq-users.xml | 0 examples/jms/scheduled-message/pom.xml | 5 +- .../jms/example/ScheduledMessageExample.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/security/pom.xml | 5 +- .../activemq/jms/example/SecurityExample.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../server0/activemq-jms.xml | 0 .../server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 5 + examples/jms/send-acknowledgements/pom.xml | 5 +- .../example/SendAcknowledgementsExample.java | 2 +- .../server0/activemq-configuration.xml | 34 +++ .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../server0/activemq-configuration.xml | 43 --- .../src/main/resources/jndi.properties | 4 + examples/jms/spring-integration/pom.xml | 5 +- .../main/resources/activemq-configuration.xml | 7 - .../src/main/resources/spring-jms-beans.xml | 38 ++- examples/jms/ssl-enabled/pom.xml | 5 +- .../activemq/jms/example/SSLExample.java | 2 +- .../server0/activemq-configuration.xml | 39 +++ .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../server0/activemq.example.keystore | Bin 0 -> 1273 bytes .../server0/activemq.example.truststore | Bin 0 -> 866 bytes .../server0/activemq-configuration.xml | 53 ---- .../hornetq/server0/hornetq.example.keystore | Bin 1259 -> 0 bytes .../server0/hornetq.example.truststore | Bin 852 -> 0 bytes .../src/main/resources/jndi.properties | 3 + examples/jms/static-selector-jms/pom.xml | 2 +- .../jms/example/StaticSelectorJMSExample.java | 7 +- .../server0/activemq-configuration.xml | 8 - .../server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../server0/activemq-configuration.xml | 42 --- .../src/main/resources/jndi.properties | 3 + examples/jms/static-selector/pom.xml | 5 +- examples/jms/static-selector/readme.html | 2 +- .../jms/example/StaticSelectorExample.java | 7 +- .../server0/activemq-configuration.xml | 15 +- .../activemq/server0/activemq-jms.xml} | 0 .../activemq}/server0/activemq-users.xml | 0 .../server0/activemq-configuration.xml | 49 ---- .../src/main/resources/jndi.properties | 3 + examples/jms/stomp-websockets/pom.xml | 4 +- .../jms/example/StompWebSocketExample.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties} | 1 + examples/jms/stomp/pom.xml | 5 +- .../activemq/jms/example/StompExample.java | 2 +- .../server0/activemq-configuration.xml | 9 - .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../stomp/src/main/resources/jndi.properties | 3 + examples/jms/stomp1.1/pom.xml | 5 +- .../activemq/jms/example/StompExample.java | 2 +- .../server0/activemq-configuration.xml | 9 - .../activemq/server0}/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/stomp1.2/pom.xml | 5 +- .../activemq/jms/example/StompExample.java | 2 +- .../server0/activemq-configuration.xml | 9 - .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/stop-server-failover/pom.xml | 8 +- .../example/StopServerFailoverExample.java | 4 +- .../server0/activemq-configuration.xml | 0 .../activemq/server0}/activemq-jms.xml | 0 .../server0}/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../activemq/server1}/activemq-jms.xml | 0 .../activemq/server1}/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 7 + examples/jms/symmetric-cluster/pom.xml | 24 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../server0}/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../server1/activemq-jms.xml | 0 .../server1}/activemq-users.xml | 0 .../server2/activemq-configuration.xml | 0 .../server2/activemq-jms.xml | 0 .../server2}/activemq-users.xml | 0 .../server3/activemq-configuration.xml | 0 .../server3/activemq-jms.xml | 0 .../server3}/activemq-users.xml | 0 .../server4/activemq-configuration.xml | 0 .../server4/activemq-jms.xml | 0 .../server4}/activemq-users.xml | 0 .../server5/activemq-configuration.xml | 0 .../server5/activemq-jms.xml | 0 .../activemq/server5}/activemq-users.xml | 0 examples/jms/temp-queue/pom.xml | 5 +- .../jms/example/TemporaryQueueExample.java | 2 +- .../server0/activemq-configuration.xml | 0 .../server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/topic-hierarchies/pom.xml | 5 +- .../jms/example/TopicHierarchyExample.java | 2 +- .../server0/activemq-configuration.xml | 9 - .../server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties} | 0 examples/jms/topic-selector-example1/pom.xml | 5 +- .../jms/example/TopicSelectorExample1.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/topic-selector-example2/pom.xml | 5 +- .../jms/example/TopicSelectorExample2.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/topic/pom.xml | 2 +- .../activemq/jms/example/TopicExample.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../topic/src/main/resources/jndi.properties | 3 + examples/jms/transaction-failover/pom.xml | 14 +- .../example/TransactionFailoverExample.java | 4 +- .../server0/activemq-configuration.xml | 0 .../activemq}/server0/activemq-jms.xml | 0 .../server0}/activemq-users.xml | 0 .../server1/activemq-configuration.xml | 0 .../activemq/server1}/activemq-jms.xml | 0 .../activemq/server1}/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 7 + examples/jms/transactional/pom.xml | 5 +- .../jms/example/TransactionalExample.java | 2 +- .../server0/activemq-configuration.xml | 8 - .../activemq/server0/activemq-jms.xml | 8 + .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/xa-heuristic/pom.xml | 5 +- .../jms/example/XAHeuristicExample.java | 2 +- .../server0/activemq-configuration.xml | 34 +++ .../activemq}/server0/activemq-jms.xml | 0 .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/xa-receive/pom.xml | 5 +- .../jms/example/XAReceiveExample.java | 2 +- .../server0/activemq-configuration.xml | 34 +++ .../activemq}/server0/activemq-jms.xml | 1 - .../activemq}/server0/activemq-users.xml | 0 .../src/main/resources/jndi.properties | 3 + examples/jms/xa-send/pom.xml | 5 +- .../activemq/jms/example/XASendExample.java | 2 +- .../server0/activemq-configuration.xml | 34 +++ .../activemq}/server0/activemq-jms.xml | 2 +- .../activemq}/server0/activemq-users.xml | 0 .../server0/activemq-configuration.xml | 42 --- .../src/main/resources/jndi.properties | 3 + examples/jms/xa-with-jta/pom.xml | 10 +- .../jms/example/XAwithJTAExample.java | 2 +- .../server0/activemq-configuration.xml | 34 +++ .../activemq/server0/activemq-jms.xml | 8 + .../activemq/server0/activemq-users.xml} | 0 .../server0/activemq-configuration.xml | 42 --- .../src/main/resources/jndi.properties | 3 + examples/soak/normal/pom.xml | 6 +- pom.xml | 7 +- 688 files changed, 2698 insertions(+), 1837 deletions(-) create mode 100644 activemq-maven-plugin/pom.xml create mode 100644 activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQClient.java create mode 100644 activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQClientPlugin.java create mode 100644 activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQStartPlugin.java create mode 100644 activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQStopPlugin.java create mode 100644 activemq-maven-plugin/src/main/java/org/apache/activemq/maven/InVMNodeManagerServer.java create mode 100644 activemq-maven-plugin/src/main/java/org/apache/activemq/maven/PluginUtil.java create mode 100644 activemq-maven-plugin/src/main/java/org/apache/activemq/maven/TestClusterManager.java create mode 100644 activemq-maven-plugin/src/main/java/org/apache/activemq/maven/TestClusterManagerMBean.java create mode 100644 activemq-maven-plugin/src/main/java/org/apache/activemq/maven/TestNode.java create mode 100644 activemq-maven-plugin/src/main/java/org/apache/activemq/server/ActiveMQBootstrap.java create mode 100644 activemq-maven-plugin/src/main/java/org/apache/activemq/server/SpawnedActiveMQBootstrap.java create mode 100644 activemq-maven-plugin/src/main/java/org/apache/activemq/server/SpawnedVMSupport.java rename examples/jms/aerogear/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (81%) rename examples/jms/{application-layer-failover/src/main/resources/hornetq => aerogear/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/aerogear/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/{delayed-redelivery/src/main/resources/hornetq/server0/client-jndi.properties => aerogear/src/main/resources/jndi.properties} (50%) rename examples/jms/applet/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/applet/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/applet/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/application-layer-failover/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (82%) rename examples/jms/application-layer-failover/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-jms.xml (100%) rename examples/jms/application-layer-failover/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/application-layer-failover/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (82%) rename examples/jms/{client-side-failoverlistener/src/main/resources/hornetq/server0 => application-layer-failover/src/main/resources/activemq/server1}/activemq-jms.xml (100%) rename examples/jms/application-layer-failover/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/bridge/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (92%) rename examples/jms/bridge/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/bridge/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/bridge/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (84%) rename examples/jms/bridge/src/main/resources/{hornetq => activemq}/server1/activemq-jms.xml (100%) rename examples/jms/bridge/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/browser/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/browser/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/browser/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/{perf/src/main/resources/client.jndi.properties => browser/src/main/resources/jndi.properties} (50%) rename examples/jms/client-kickoff/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (81%) rename examples/jms/client-kickoff/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/client-kickoff/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/{clustered-jgroups/src/main/resources/hornetq/server0/client-jndi.properties => client-kickoff/src/main/resources/jndi.properties} (100%) rename examples/jms/client-side-failoverlistener/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/client-side-failoverlistener/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-jms.xml (100%) rename examples/jms/client-side-failoverlistener/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/client-side-failoverlistener/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/{consumer-rate-limit/src/main/resources/hornetq/server0 => client-side-failoverlistener/src/main/resources/activemq/server1}/activemq-jms.xml (100%) rename examples/jms/client-side-failoverlistener/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) create mode 100644 examples/jms/client-side-failoverlistener/src/main/resources/jndi.properties rename examples/jms/client-side-load-balancing/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/client-side-load-balancing/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/client-side-load-balancing/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/client-side-load-balancing/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/client-side-load-balancing/src/main/resources/{hornetq => activemq}/server1/activemq-jms.xml (100%) rename examples/jms/client-side-load-balancing/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/client-side-load-balancing/src/main/resources/{hornetq => activemq}/server2/activemq-configuration.xml (100%) rename examples/jms/client-side-load-balancing/src/main/resources/{hornetq => activemq}/server2/activemq-jms.xml (100%) rename examples/jms/client-side-load-balancing/src/main/resources/{hornetq => activemq}/server2/activemq-users.xml (100%) rename examples/jms/{topic/src/main/resources/hornetq/server0/client-jndi.properties => client-side-load-balancing/src/main/resources/jndi.properties} (50%) rename examples/jms/clustered-durable-subscription/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/clustered-durable-subscription/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/clustered-durable-subscription/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/clustered-durable-subscription/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/clustered-durable-subscription/src/main/resources/{hornetq => activemq}/server1/activemq-jms.xml (100%) rename examples/jms/clustered-durable-subscription/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/clustered-grouping/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/clustered-grouping/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/clustered-grouping/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/clustered-grouping/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/clustered-grouping/src/main/resources/{hornetq => activemq}/server1/activemq-jms.xml (100%) rename examples/jms/clustered-grouping/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/clustered-grouping/src/main/resources/{hornetq => activemq}/server2/activemq-configuration.xml (100%) rename examples/jms/clustered-grouping/src/main/resources/{hornetq => activemq}/server2/activemq-jms.xml (100%) rename examples/jms/clustered-grouping/src/main/resources/{hornetq => activemq}/server2/activemq-users.xml (100%) rename examples/jms/clustered-jgroups/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/clustered-jgroups/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/clustered-jgroups/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/{consumer-rate-limit/src/main/resources/hornetq => clustered-jgroups/src/main/resources/activemq}/server0/client-jndi.properties (100%) rename examples/jms/clustered-jgroups/src/main/resources/{hornetq => activemq}/server0/test-jgroups-file_ping.xml (100%) rename examples/jms/clustered-jgroups/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/clustered-jgroups/src/main/resources/{hornetq => activemq}/server1/activemq-jms.xml (100%) rename examples/jms/clustered-jgroups/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/clustered-jgroups/src/main/resources/{hornetq => activemq}/server1/client-jndi.properties (100%) rename examples/jms/clustered-jgroups/src/main/resources/{hornetq => activemq}/server1/test-jgroups-file_ping.xml (100%) rename examples/jms/clustered-queue/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/clustered-queue/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/clustered-queue/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/clustered-queue/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/clustered-queue/src/main/resources/{hornetq => activemq}/server1/activemq-jms.xml (100%) rename examples/jms/clustered-queue/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/clustered-standalone/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/clustered-standalone/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/clustered-standalone/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/clustered-standalone/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/clustered-standalone/src/main/resources/{hornetq/server2 => activemq/server1}/activemq-jms.xml (100%) rename examples/jms/clustered-standalone/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/clustered-standalone/src/main/resources/{hornetq => activemq}/server2/activemq-configuration.xml (100%) rename examples/jms/clustered-standalone/src/main/resources/{hornetq/server1 => activemq/server2}/activemq-jms.xml (95%) rename examples/jms/clustered-standalone/src/main/resources/{hornetq => activemq}/server2/activemq-users.xml (100%) rename examples/jms/clustered-static-discovery/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/clustered-static-discovery/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/clustered-static-discovery/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/clustered-static-discovery/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/clustered-static-discovery/src/main/resources/{hornetq => activemq}/server1/activemq-jms.xml (100%) rename examples/jms/clustered-static-discovery/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/clustered-static-discovery/src/main/resources/{hornetq => activemq}/server2/activemq-configuration.xml (100%) rename examples/jms/clustered-static-discovery/src/main/resources/{hornetq => activemq}/server2/activemq-jms.xml (100%) rename examples/jms/clustered-static-discovery/src/main/resources/{hornetq => activemq}/server2/activemq-users.xml (100%) rename examples/jms/clustered-static-discovery/src/main/resources/{hornetq => activemq}/server3/activemq-configuration.xml (100%) rename examples/jms/clustered-static-discovery/src/main/resources/{hornetq => activemq}/server3/activemq-jms.xml (100%) rename examples/jms/clustered-static-discovery/src/main/resources/{hornetq => activemq}/server3/activemq-users.xml (100%) rename examples/jms/clustered-static-oneway/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/clustered-static-oneway/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/clustered-static-oneway/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/clustered-static-oneway/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/clustered-static-oneway/src/main/resources/{hornetq => activemq}/server1/activemq-jms.xml (100%) rename examples/jms/clustered-static-oneway/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/clustered-static-oneway/src/main/resources/{hornetq => activemq}/server2/activemq-configuration.xml (100%) rename examples/jms/clustered-static-oneway/src/main/resources/{hornetq => activemq}/server2/activemq-jms.xml (100%) rename examples/jms/clustered-static-oneway/src/main/resources/{hornetq => activemq}/server2/activemq-users.xml (100%) rename examples/jms/clustered-topic/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/clustered-topic/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/clustered-topic/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/clustered-topic/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/clustered-topic/src/main/resources/{hornetq => activemq}/server1/activemq-jms.xml (100%) rename examples/jms/clustered-topic/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/colocated-failover-scale-down/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (86%) rename examples/jms/colocated-failover-scale-down/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/colocated-failover-scale-down/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/colocated-failover-scale-down/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (86%) rename examples/jms/colocated-failover-scale-down/src/main/resources/{hornetq => activemq}/server1/activemq-jms.xml (100%) rename examples/jms/colocated-failover-scale-down/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/colocated-failover/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/colocated-failover/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/colocated-failover/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/colocated-failover/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/colocated-failover/src/main/resources/{hornetq => activemq}/server1/activemq-jms.xml (100%) rename examples/jms/colocated-failover/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/{message-group/src/main/resources/hornetq => consumer-rate-limit/src/main/resources/activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/{interceptor/src/main/resources/hornetq => consumer-rate-limit/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/consumer-rate-limit/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/consumer-rate-limit/src/main/resources/jndi.properties rename examples/jms/dead-letter/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (88%) rename examples/jms/dead-letter/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/dead-letter/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/dead-letter/src/main/resources/jndi.properties rename examples/jms/delayed-redelivery/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (87%) rename examples/jms/delayed-redelivery/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/delayed-redelivery/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/delayed-redelivery/src/main/resources/jndi.properties rename examples/jms/divert/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (93%) rename examples/jms/divert/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/divert/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/divert/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (83%) rename examples/jms/divert/src/main/resources/{hornetq => activemq}/server1/activemq-jms.xml (100%) rename examples/jms/divert/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/durable-subscription/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (86%) rename examples/jms/durable-subscription/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/durable-subscription/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/durable-subscription/src/main/resources/jndi.properties rename examples/jms/expiry/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (87%) rename examples/jms/expiry/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/expiry/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/expiry/src/main/resources/jndi.properties rename examples/jms/ha-policy-autobackup/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/ha-policy-autobackup/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/ha-policy-autobackup/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/ha-policy-autobackup/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/{http-transport/src/main/resources/hornetq/server0 => ha-policy-autobackup/src/main/resources/activemq/server1}/activemq-jms.xml (100%) rename examples/jms/ha-policy-autobackup/src/main/resources/{hornetq => activemq}/server1/activemq-users.xml (100%) rename examples/jms/{large-message/src/main/resources/hornetq => http-transport/src/main/resources/activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/{last-value-queue/src/main/resources/hornetq => http-transport/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/http-transport/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) delete mode 100644 examples/jms/http-transport/src/main/resources/hornetq/server0/activemq-configuration.xml create mode 100644 examples/jms/http-transport/src/main/resources/jndi.properties rename examples/jms/{consumer-rate-limit/src/main/resources/hornetq => instantiate-connection-factory/src/main/resources/activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/instantiate-connection-factory/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (73%) rename examples/jms/instantiate-connection-factory/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) delete mode 100644 examples/jms/instantiate-connection-factory/src/main/resources/hornetq/server0/activemq-configuration.xml rename examples/jms/interceptor/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (87%) rename examples/jms/{jaas/src/main/resources/hornetq => interceptor/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/interceptor/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/interceptor/src/main/resources/jndi.properties rename examples/jms/{message-group2/src/main/resources/hornetq => jaas/src/main/resources/activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/{jms-auto-closeable/src/main/resources/hornetq => jaas/src/main/resources/activemq}/server0/activemq-jms.xml (100%) delete mode 100644 examples/jms/jaas/src/main/resources/hornetq/server0/activemq-configuration.xml create mode 100644 examples/jms/jaas/src/main/resources/jndi.properties rename examples/jms/jms-auto-closeable/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/{jms-completion-listener/src/main/resources/hornetq => jms-auto-closeable/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/jms-auto-closeable/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/jms-auto-closeable/src/main/resources/jndi.properties rename examples/jms/jms-bridge/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (82%) rename examples/jms/jms-bridge/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/jms-bridge/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-users.xml (100%) rename examples/jms/jms-bridge/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (74%) rename examples/jms/jms-bridge/src/main/resources/{hornetq => activemq}/server1/activemq-jms.xml (100%) rename examples/jms/{jms-completion-listener/src/main/resources/hornetq/server0 => jms-bridge/src/main/resources/activemq/server1}/activemq-users.xml (100%) create mode 100644 examples/jms/jms-completion-listener/src/main/resources/activemq/server0/activemq-configuration.xml rename examples/jms/{large-message/src/main/resources/hornetq => jms-completion-listener/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{jms-context/src/main/resources/hornetq => jms-completion-listener/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/jms-completion-listener/src/main/resources/jndi.properties create mode 100644 examples/jms/jms-context/src/main/resources/activemq/server0/activemq-configuration.xml rename examples/jms/{management/src/main/resources/hornetq => jms-context/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{jms-shared-consumer/src/main/resources/hornetq => jms-context/src/main/resources/activemq}/server0/activemq-users.xml (100%) delete mode 100644 examples/jms/jms-context/src/main/resources/hornetq/server0/activemq-configuration.xml create mode 100644 examples/jms/jms-context/src/main/resources/jndi.properties rename examples/jms/jms-shared-consumer/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/jms-shared-consumer/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{jmx/src/main/resources/hornetq => jms-shared-consumer/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/jms-shared-consumer/src/main/resources/jndi.properties rename examples/jms/jmx/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (87%) rename examples/jms/{multiple-failover-failback/src/main/resources/hornetq => jmx/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{large-message/src/main/resources/hornetq => jmx/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/jmx/src/main/resources/jndi.properties create mode 100644 examples/jms/large-message/src/main/resources/activemq/server0/activemq-configuration.xml rename examples/jms/{multiple-failover-failback/src/main/resources/hornetq/server1 => large-message/src/main/resources/activemq/server0}/activemq-jms.xml (100%) rename examples/jms/{last-value-queue/src/main/resources/hornetq => large-message/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/large-message/src/main/resources/jndi.properties rename examples/jms/{jms-completion-listener/src/main/resources/hornetq => last-value-queue/src/main/resources/activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/{message-group2/src/main/resources/hornetq => last-value-queue/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{management/src/main/resources/hornetq => last-value-queue/src/main/resources/activemq}/server0/activemq-users.xml (100%) delete mode 100644 examples/jms/last-value-queue/src/main/resources/hornetq/server0/activemq-configuration.xml create mode 100644 examples/jms/last-value-queue/src/main/resources/jndi.properties rename examples/jms/management-notifications/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (91%) rename examples/jms/management-notifications/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/management-notifications/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/management-notifications/src/main/resources/jndi.properties rename examples/jms/management/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (91%) rename examples/jms/{multiple-failover-failback/src/main/resources/hornetq/server2 => management/src/main/resources/activemq/server0}/activemq-jms.xml (100%) rename examples/jms/{message-counters/src/main/resources/hornetq => management/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/management/src/main/resources/jndi.properties rename examples/jms/message-counters/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (91%) rename examples/jms/message-counters/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{message-group/src/main/resources/hornetq => message-counters/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/message-counters/src/main/resources/jndi.properties create mode 100644 examples/jms/message-group/src/main/resources/activemq/server0/activemq-configuration.xml rename examples/jms/{message-priority/src/main/resources/hornetq => message-group/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{message-group2/src/main/resources/hornetq => message-group/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/message-group/src/main/resources/jndi.properties create mode 100644 examples/jms/message-group2/src/main/resources/activemq/server0/activemq-configuration.xml rename examples/jms/{queue-message-redistribution/src/main/resources/hornetq => message-group2/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{message-priority/src/main/resources/hornetq => message-group2/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/message-group2/src/main/resources/jndi.properties create mode 100644 examples/jms/message-priority/src/main/resources/activemq/server0/activemq-configuration.xml rename examples/jms/{queue-message-redistribution/src/main/resources/hornetq/server1 => message-priority/src/main/resources/activemq/server0}/activemq-jms.xml (100%) rename examples/jms/{multiple-failover-failback/src/main/resources/hornetq => message-priority/src/main/resources/activemq}/server0/activemq-users.xml (100%) delete mode 100644 examples/jms/message-priority/src/main/resources/hornetq/server0/activemq-configuration.xml create mode 100644 examples/jms/message-priority/src/main/resources/jndi.properties rename examples/jms/multiple-failover-failback/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/{multiple-failover/src/main/resources/hornetq => multiple-failover-failback/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/multiple-failover-failback/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-users.xml (100%) rename examples/jms/multiple-failover-failback/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/{multiple-failover/src/main/resources/hornetq => multiple-failover-failback/src/main/resources/activemq}/server1/activemq-jms.xml (100%) rename examples/jms/multiple-failover-failback/src/main/resources/{hornetq/server2 => activemq/server1}/activemq-users.xml (100%) rename examples/jms/multiple-failover-failback/src/main/resources/{hornetq => activemq}/server2/activemq-configuration.xml (100%) rename examples/jms/{multiple-failover/src/main/resources/hornetq => multiple-failover-failback/src/main/resources/activemq}/server2/activemq-jms.xml (100%) rename examples/jms/{multiple-failover/src/main/resources/hornetq/server0 => multiple-failover-failback/src/main/resources/activemq/server2}/activemq-users.xml (100%) create mode 100644 examples/jms/multiple-failover-failback/src/main/resources/jndi.properties rename examples/jms/multiple-failover/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/{no-consumer-buffering/src/main/resources/hornetq => multiple-failover/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/multiple-failover/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-users.xml (100%) rename examples/jms/multiple-failover/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/{non-transaction-failover/src/main/resources/hornetq/server0 => multiple-failover/src/main/resources/activemq/server1}/activemq-jms.xml (100%) rename examples/jms/multiple-failover/src/main/resources/{hornetq/server2 => activemq/server1}/activemq-users.xml (100%) rename examples/jms/multiple-failover/src/main/resources/{hornetq => activemq}/server2/activemq-configuration.xml (100%) rename examples/jms/{non-transaction-failover/src/main/resources/hornetq/server1 => multiple-failover/src/main/resources/activemq/server2}/activemq-jms.xml (100%) rename examples/jms/{no-consumer-buffering/src/main/resources/hornetq/server0 => multiple-failover/src/main/resources/activemq/server2}/activemq-users.xml (100%) create mode 100644 examples/jms/multiple-failover/src/main/resources/jndi.properties create mode 100644 examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/activemq-configuration.xml rename examples/jms/{openwire/src/main/resources/hornetq => no-consumer-buffering/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{non-transaction-failover/src/main/resources/hornetq => no-consumer-buffering/src/main/resources/activemq}/server0/activemq-users.xml (100%) delete mode 100644 examples/jms/no-consumer-buffering/src/main/resources/hornetq/server0/activemq-configuration.xml create mode 100644 examples/jms/no-consumer-buffering/src/main/resources/jndi.properties rename examples/jms/non-transaction-failover/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/{pre-acknowledge/src/main/resources/hornetq => non-transaction-failover/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/non-transaction-failover/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-users.xml (100%) rename examples/jms/non-transaction-failover/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/{producer-rate-limit/src/main/resources/hornetq/server0 => non-transaction-failover/src/main/resources/activemq/server1}/activemq-jms.xml (100%) rename examples/jms/{openwire/src/main/resources/hornetq/server0 => non-transaction-failover/src/main/resources/activemq/server1}/activemq-users.xml (100%) create mode 100644 examples/jms/non-transaction-failover/src/main/resources/jndi.properties rename examples/jms/openwire/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/{queue-requestor/src/main/resources/hornetq => openwire/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{paging/src/main/resources/hornetq => openwire/src/main/resources/activemq}/server0/activemq-users.xml (100%) rename examples/jms/paging/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/paging/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{pre-acknowledge/src/main/resources/hornetq => paging/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/paging/src/main/resources/jndi.properties rename examples/jms/perf/src/main/resources/{hornetq/server0/hornetq-configuration-messaging-lab.xml => activemq/server0/activemq-configuration.xml} (70%) rename examples/jms/perf/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) delete mode 100644 examples/jms/perf/src/main/resources/hornetq/server0/activemq-configuration.xml create mode 100644 examples/jms/perf/src/main/resources/jndi.properties rename examples/jms/pre-acknowledge/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (86%) rename examples/jms/{queue/src/main/resources/hornetq => pre-acknowledge/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{producer-rate-limit/src/main/resources/hornetq => pre-acknowledge/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/pre-acknowledge/src/main/resources/jndi.properties rename examples/jms/producer-rate-limit/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/{replicated-failback-static/src/main/resources/hornetq => producer-rate-limit/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{proton-cpp/src/main/resources/hornetq => producer-rate-limit/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/producer-rate-limit/src/main/resources/jndi.properties rename examples/jms/proton-cpp/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/proton-cpp/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{proton-j/src/main/resources/hornetq => proton-cpp/src/main/resources/activemq}/server0/activemq-users.xml (100%) rename examples/jms/proton-j/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/proton-j/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{queue-message-redistribution/src/main/resources/hornetq => proton-j/src/main/resources/activemq}/server0/activemq-users.xml (100%) rename examples/jms/proton-ruby/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/proton-ruby/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/proton-ruby/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) rename examples/jms/queue-message-redistribution/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/{queue-selector/src/main/resources/hornetq => queue-message-redistribution/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/queue-message-redistribution/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-users.xml (100%) rename examples/jms/queue-message-redistribution/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/{reattach-node/src/main/resources/hornetq/server0 => queue-message-redistribution/src/main/resources/activemq/server1}/activemq-jms.xml (100%) rename examples/jms/{queue-requestor/src/main/resources/hornetq/server0 => queue-message-redistribution/src/main/resources/activemq/server1}/activemq-users.xml (100%) rename examples/jms/{request-reply/src/main/resources/hornetq => queue-requestor/src/main/resources/activemq}/server0/activemq-configuration.xml (88%) rename examples/jms/{replicated-failback-static/src/main/resources/hornetq/server1 => queue-requestor/src/main/resources/activemq/server0}/activemq-jms.xml (100%) rename examples/jms/{queue-selector/src/main/resources/hornetq => queue-requestor/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/queue-requestor/src/main/resources/jndi.properties rename examples/jms/queue-selector/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/{request-reply/src/main/resources/hornetq => queue-selector/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{queue/src/main/resources/hornetq => queue-selector/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/queue-selector/src/main/resources/jndi.properties create mode 100644 examples/jms/queue/src/main/resources/activemq/server0/activemq-configuration.xml rename examples/jms/{replicated-failback/src/main/resources/hornetq => queue/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{replicated-failback-static/src/main/resources/hornetq => queue/src/main/resources/activemq}/server0/activemq-users.xml (100%) delete mode 100644 examples/jms/queue/src/main/resources/hornetq/server0/activemq-configuration.xml create mode 100644 examples/jms/queue/src/main/resources/jndi.properties rename examples/jms/reattach-node/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/{scale-down/src/main/resources/hornetq => reattach-node/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/reattach-node/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/reattach-node/src/main/resources/jndi.properties rename examples/jms/replicated-failback-static/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (98%) rename examples/jms/{replicated-failback/src/main/resources/hornetq/server1 => replicated-failback-static/src/main/resources/activemq/server0}/activemq-jms.xml (100%) rename examples/jms/replicated-failback-static/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-users.xml (100%) rename examples/jms/replicated-failback-static/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/{replicated-multiple-failover/src/main/resources/hornetq/server0 => replicated-failback-static/src/main/resources/activemq/server1}/activemq-jms.xml (100%) rename examples/jms/{replicated-failback/src/main/resources/hornetq/server0 => replicated-failback-static/src/main/resources/activemq/server1}/activemq-users.xml (100%) create mode 100644 examples/jms/replicated-failback-static/src/main/resources/jndi.properties rename examples/jms/replicated-failback/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (98%) rename examples/jms/{replicated-multiple-failover/src/main/resources/hornetq/server1 => replicated-failback/src/main/resources/activemq/server0}/activemq-jms.xml (100%) rename examples/jms/replicated-failback/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-users.xml (100%) rename examples/jms/replicated-failback/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/{replicated-multiple-failover/src/main/resources/hornetq/server2 => replicated-failback/src/main/resources/activemq/server1}/activemq-jms.xml (100%) rename examples/jms/{replicated-multiple-failover/src/main/resources/hornetq/server0 => replicated-failback/src/main/resources/activemq/server1}/activemq-users.xml (100%) create mode 100644 examples/jms/replicated-failback/src/main/resources/jndi.properties rename examples/jms/replicated-multiple-failover/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/{replicated-transaction-failover/src/main/resources/hornetq => replicated-multiple-failover/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/replicated-multiple-failover/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-users.xml (100%) rename examples/jms/replicated-multiple-failover/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (92%) rename examples/jms/{replicated-transaction-failover/src/main/resources/hornetq => replicated-multiple-failover/src/main/resources/activemq}/server1/activemq-jms.xml (100%) rename examples/jms/replicated-multiple-failover/src/main/resources/{hornetq/server2 => activemq/server1}/activemq-users.xml (100%) rename examples/jms/replicated-multiple-failover/src/main/resources/{hornetq => activemq}/server2/activemq-configuration.xml (92%) rename examples/jms/{send-acknowledgements/src/main/resources/hornetq/server0 => replicated-multiple-failover/src/main/resources/activemq/server2}/activemq-jms.xml (100%) rename examples/jms/{replicated-transaction-failover/src/main/resources/hornetq/server0 => replicated-multiple-failover/src/main/resources/activemq/server2}/activemq-users.xml (100%) create mode 100644 examples/jms/replicated-multiple-failover/src/main/resources/jndi.properties rename examples/jms/replicated-transaction-failover/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/{ssl-enabled/src/main/resources/hornetq => replicated-transaction-failover/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/replicated-transaction-failover/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-users.xml (100%) rename examples/jms/replicated-transaction-failover/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (92%) rename examples/jms/{stomp/src/main/resources/hornetq/server0 => replicated-transaction-failover/src/main/resources/activemq/server1}/activemq-jms.xml (100%) rename examples/jms/{request-reply/src/main/resources/hornetq/server0 => replicated-transaction-failover/src/main/resources/activemq/server1}/activemq-users.xml (100%) create mode 100644 examples/jms/replicated-transaction-failover/src/main/resources/jndi.properties rename examples/jms/{queue-requestor/src/main/resources/hornetq => request-reply/src/main/resources/activemq}/server0/activemq-configuration.xml (88%) rename examples/jms/{scale-down/src/main/resources/hornetq/server1 => request-reply/src/main/resources/activemq/server0}/activemq-jms.xml (100%) rename examples/jms/{scale-down/src/main/resources/hornetq => request-reply/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/request-reply/src/main/resources/jndi.properties rename examples/jms/rest/dup-send/src/main/resources/{hornetq-client.xml => activemq-client.xml} (100%) rename examples/jms/rest/dup-send/src/main/resources/{hornetq-rest.xml => activemq-rest.xml} (100%) rename examples/jms/rest/jms-to-rest/src/main/resources/{hornetq-client.xml => activemq-client.xml} (100%) rename examples/jms/rest/push/src/main/resources/{hornetq-client.xml => activemq-client.xml} (100%) rename examples/jms/scale-down/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (94%) rename examples/jms/{scheduled-message/src/main/resources/hornetq => scale-down/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/scale-down/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-users.xml (100%) rename examples/jms/scale-down/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/{static-selector/src/main/resources/hornetq/server0 => scale-down/src/main/resources/activemq/server1}/activemq-jms.xml (100%) rename examples/jms/{scheduled-message/src/main/resources/hornetq/server0 => scale-down/src/main/resources/activemq/server1}/activemq-users.xml (100%) rename examples/jms/{transactional/src/main/resources/hornetq => scheduled-message/src/main/resources/activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/{transactional/src/main/resources/hornetq => scheduled-message/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{send-acknowledgements/src/main/resources/hornetq => scheduled-message/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/scheduled-message/src/main/resources/jndi.properties rename examples/jms/security/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (90%) rename examples/jms/security/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/security/src/main/resources/{hornetq => activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/security/src/main/resources/jndi.properties create mode 100644 examples/jms/send-acknowledgements/src/main/resources/activemq/server0/activemq-configuration.xml rename examples/jms/{stomp1.1/src/main/resources/hornetq => send-acknowledgements/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{ssl-enabled/src/main/resources/hornetq => send-acknowledgements/src/main/resources/activemq}/server0/activemq-users.xml (100%) delete mode 100644 examples/jms/send-acknowledgements/src/main/resources/hornetq/server0/activemq-configuration.xml create mode 100644 examples/jms/send-acknowledgements/src/main/resources/jndi.properties create mode 100644 examples/jms/ssl-enabled/src/main/resources/activemq/server0/activemq-configuration.xml rename examples/jms/{stomp1.2/src/main/resources/hornetq => ssl-enabled/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{static-selector-jms/src/main/resources/hornetq => ssl-enabled/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/ssl-enabled/src/main/resources/activemq/server0/activemq.example.keystore create mode 100644 examples/jms/ssl-enabled/src/main/resources/activemq/server0/activemq.example.truststore delete mode 100644 examples/jms/ssl-enabled/src/main/resources/hornetq/server0/activemq-configuration.xml delete mode 100644 examples/jms/ssl-enabled/src/main/resources/hornetq/server0/hornetq.example.keystore delete mode 100644 examples/jms/ssl-enabled/src/main/resources/hornetq/server0/hornetq.example.truststore create mode 100644 examples/jms/ssl-enabled/src/main/resources/jndi.properties rename examples/jms/{xa-heuristic/src/main/resources/hornetq => static-selector-jms/src/main/resources/activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/static-selector-jms/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{static-selector/src/main/resources/hornetq => static-selector-jms/src/main/resources/activemq}/server0/activemq-users.xml (100%) delete mode 100644 examples/jms/static-selector-jms/src/main/resources/hornetq/server0/activemq-configuration.xml create mode 100644 examples/jms/static-selector-jms/src/main/resources/jndi.properties rename examples/jms/{scheduled-message/src/main/resources/hornetq => static-selector/src/main/resources/activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/{message-group/src/main/resources/hornetq/server0/hornetq-jms.xml => static-selector/src/main/resources/activemq/server0/activemq-jms.xml} (100%) rename examples/jms/{stomp-websockets/src/main/resources/hornetq => static-selector/src/main/resources/activemq}/server0/activemq-users.xml (100%) delete mode 100644 examples/jms/static-selector/src/main/resources/hornetq/server0/activemq-configuration.xml create mode 100644 examples/jms/static-selector/src/main/resources/jndi.properties rename examples/jms/stomp-websockets/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (88%) rename examples/jms/stomp-websockets/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{stomp/src/main/resources/hornetq => stomp-websockets/src/main/resources/activemq}/server0/activemq-users.xml (100%) rename examples/jms/{durable-subscription/src/main/resources/hornetq/server0/client-jndi.properties => stomp-websockets/src/main/resources/jndi.properties} (86%) rename examples/jms/stomp/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (89%) rename examples/jms/{stop-server-failover/src/main/resources/hornetq => stomp/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{stomp1.1/src/main/resources/hornetq => stomp/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/stomp/src/main/resources/jndi.properties rename examples/jms/stomp1.1/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (89%) rename examples/jms/{stop-server-failover/src/main/resources/hornetq/server1 => stomp1.1/src/main/resources/activemq/server0}/activemq-jms.xml (100%) rename examples/jms/{stomp1.2/src/main/resources/hornetq => stomp1.1/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/stomp1.1/src/main/resources/jndi.properties rename examples/jms/stomp1.2/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (89%) rename examples/jms/{transaction-failover/src/main/resources/hornetq => stomp1.2/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{stop-server-failover/src/main/resources/hornetq => stomp1.2/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/stomp1.2/src/main/resources/jndi.properties rename examples/jms/stop-server-failover/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/{transaction-failover/src/main/resources/hornetq/server1 => stop-server-failover/src/main/resources/activemq/server0}/activemq-jms.xml (100%) rename examples/jms/stop-server-failover/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-users.xml (100%) rename examples/jms/stop-server-failover/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/{xa-heuristic/src/main/resources/hornetq/server0 => stop-server-failover/src/main/resources/activemq/server1}/activemq-jms.xml (100%) rename examples/jms/{symmetric-cluster/src/main/resources/hornetq/server0 => stop-server-failover/src/main/resources/activemq/server1}/activemq-users.xml (100%) create mode 100644 examples/jms/stop-server-failover/src/main/resources/jndi.properties rename examples/jms/symmetric-cluster/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-users.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq => activemq}/server1/activemq-jms.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq/server2 => activemq/server1}/activemq-users.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq => activemq}/server2/activemq-configuration.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq => activemq}/server2/activemq-jms.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq/server3 => activemq/server2}/activemq-users.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq => activemq}/server3/activemq-configuration.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq => activemq}/server3/activemq-jms.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq/server4 => activemq/server3}/activemq-users.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq => activemq}/server4/activemq-configuration.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq => activemq}/server4/activemq-jms.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq/server5 => activemq/server4}/activemq-users.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq => activemq}/server5/activemq-configuration.xml (100%) rename examples/jms/symmetric-cluster/src/main/resources/{hornetq => activemq}/server5/activemq-jms.xml (100%) rename examples/jms/{temp-queue/src/main/resources/hornetq/server0 => symmetric-cluster/src/main/resources/activemq/server5}/activemq-users.xml (100%) rename examples/jms/temp-queue/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/temp-queue/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{topic-hierarchies/src/main/resources/hornetq => temp-queue/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/temp-queue/src/main/resources/jndi.properties rename examples/jms/topic-hierarchies/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/topic-hierarchies/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{topic-selector-example1/src/main/resources/hornetq => topic-hierarchies/src/main/resources/activemq}/server0/activemq-users.xml (100%) rename examples/jms/{dead-letter/src/main/resources/hornetq/server0/client-jndi.properties => topic-hierarchies/src/main/resources/jndi.properties} (100%) rename examples/jms/topic-selector-example1/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/topic-selector-example1/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{topic-selector-example2/src/main/resources/hornetq => topic-selector-example1/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/topic-selector-example1/src/main/resources/jndi.properties rename examples/jms/{topic/src/main/resources/hornetq => topic-selector-example2/src/main/resources/activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/topic-selector-example2/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{topic/src/main/resources/hornetq => topic-selector-example2/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/topic-selector-example2/src/main/resources/jndi.properties rename examples/jms/{topic-selector-example2/src/main/resources/hornetq => topic/src/main/resources/activemq}/server0/activemq-configuration.xml (85%) rename examples/jms/topic/src/main/resources/{hornetq => activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{transaction-failover/src/main/resources/hornetq => topic/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/topic/src/main/resources/jndi.properties rename examples/jms/transaction-failover/src/main/resources/{hornetq => activemq}/server0/activemq-configuration.xml (100%) rename examples/jms/{xa-receive/src/main/resources/hornetq => transaction-failover/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/transaction-failover/src/main/resources/{hornetq/server1 => activemq/server0}/activemq-users.xml (100%) rename examples/jms/transaction-failover/src/main/resources/{hornetq => activemq}/server1/activemq-configuration.xml (100%) rename examples/jms/{xa-send/src/main/resources/hornetq/server0 => transaction-failover/src/main/resources/activemq/server1}/activemq-jms.xml (100%) rename examples/jms/{transactional/src/main/resources/hornetq/server0 => transaction-failover/src/main/resources/activemq/server1}/activemq-users.xml (100%) create mode 100644 examples/jms/transaction-failover/src/main/resources/jndi.properties rename examples/jms/{xa-receive/src/main/resources/hornetq => transactional/src/main/resources/activemq}/server0/activemq-configuration.xml (85%) create mode 100644 examples/jms/transactional/src/main/resources/activemq/server0/activemq-jms.xml rename examples/jms/{xa-heuristic/src/main/resources/hornetq => transactional/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/transactional/src/main/resources/jndi.properties create mode 100644 examples/jms/xa-heuristic/src/main/resources/activemq/server0/activemq-configuration.xml rename examples/jms/{xa-with-jta/src/main/resources/hornetq => xa-heuristic/src/main/resources/activemq}/server0/activemq-jms.xml (100%) rename examples/jms/{xa-receive/src/main/resources/hornetq => xa-heuristic/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/xa-heuristic/src/main/resources/jndi.properties create mode 100644 examples/jms/xa-receive/src/main/resources/activemq/server0/activemq-configuration.xml rename examples/jms/{jmx/src/main/resources/hornetq => xa-receive/src/main/resources/activemq}/server0/activemq-jms.xml (95%) rename examples/jms/{xa-send/src/main/resources/hornetq => xa-receive/src/main/resources/activemq}/server0/activemq-users.xml (100%) create mode 100644 examples/jms/xa-receive/src/main/resources/jndi.properties create mode 100644 examples/jms/xa-send/src/main/resources/activemq/server0/activemq-configuration.xml rename examples/jms/{aerogear/src/main/resources/hornetq => xa-send/src/main/resources/activemq}/server0/activemq-jms.xml (87%) rename examples/jms/{xa-with-jta/src/main/resources/hornetq => xa-send/src/main/resources/activemq}/server0/activemq-users.xml (100%) delete mode 100644 examples/jms/xa-send/src/main/resources/hornetq/server0/activemq-configuration.xml create mode 100644 examples/jms/xa-send/src/main/resources/jndi.properties create mode 100644 examples/jms/xa-with-jta/src/main/resources/activemq/server0/activemq-configuration.xml create mode 100644 examples/jms/xa-with-jta/src/main/resources/activemq/server0/activemq-jms.xml rename examples/jms/{jms-bridge/src/main/resources/hornetq/server0/hornetq-users.xml => xa-with-jta/src/main/resources/activemq/server0/activemq-users.xml} (100%) delete mode 100644 examples/jms/xa-with-jta/src/main/resources/hornetq/server0/activemq-configuration.xml create mode 100644 examples/jms/xa-with-jta/src/main/resources/jndi.properties diff --git a/activemq-maven-plugin/pom.xml b/activemq-maven-plugin/pom.xml new file mode 100644 index 0000000000..2b3fac559b --- /dev/null +++ b/activemq-maven-plugin/pom.xml @@ -0,0 +1,61 @@ + + 4.0.0 + + + org.apache.activemq + activemq-pom + 6.0.0-SNAPSHOT + + + activemq-maven-plugin + maven-plugin + ActiveMQ6 Maven Plugin + + + ${project.basedir}/.. + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + org.apache.maven.plugins + maven-dependency-plugin + 2.0 + + + org.apache.activemq + activemq-server + ${project.version} + + + org.apache.activemq + activemq-jms-server + ${project.version} + + + io.netty + netty-all + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.0 + + true + 1.6 + 1.6 + + + + + + diff --git a/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQClient.java b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQClient.java new file mode 100644 index 0000000000..8327e540da --- /dev/null +++ b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQClient.java @@ -0,0 +1,27 @@ +/** + * 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.maven; + +/** + * @author Andy Taylor + * Date: 8/18/11 + * Time: 2:35 PM + */ +public interface ActiveMQClient +{ + void run(); +} diff --git a/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQClientPlugin.java b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQClientPlugin.java new file mode 100644 index 0000000000..b964f4b4d9 --- /dev/null +++ b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQClientPlugin.java @@ -0,0 +1,72 @@ +/** + * 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.maven; + +import java.lang.reflect.Method; +import java.util.Properties; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; + +/** + * @author Andy Taylor + * + * Allows a Java Client to be run which must hve a static main(String[] args) method + */ + +/** + * @phase verify + * @goal runClient + */ +public class ActiveMQClientPlugin extends AbstractMojo +{ + + /** + * @parameter + */ + String clientClass; + + /** + * @parameter + */ + String[] args; + + /** + * @parameter + */ + private Properties systemProperties; + + public void execute() throws MojoExecutionException, MojoFailureException + { + try + { + if (systemProperties != null && !systemProperties.isEmpty()) + { + System.getProperties().putAll(systemProperties); + } + Class aClass = Class.forName(clientClass); + Method method = aClass.getDeclaredMethod("main", new Class[]{String[].class}); + method.invoke(null, new Object[]{args}); + } + catch (Exception e) + { + e.printStackTrace(); + throw new MojoFailureException(e.getMessage()); + } + } +} diff --git a/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQStartPlugin.java b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQStartPlugin.java new file mode 100644 index 0000000000..5bc91aa373 --- /dev/null +++ b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQStartPlugin.java @@ -0,0 +1,228 @@ +/** + * 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.maven; + +import javax.management.MBeanServer; +import javax.management.ObjectName; +import java.io.File; +import java.lang.management.ManagementFactory; +import java.util.Arrays; +import java.util.Properties; + +import org.apache.activemq.server.ActiveMQBootstrap; +import org.apache.activemq.server.SpawnedActiveMQBootstrap; +import org.apache.activemq.server.SpawnedVMSupport; +import org.apache.activemq.spi.core.security.ActiveMQSecurityManager; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.codehaus.classworlds.ClassRealm; +import org.codehaus.classworlds.ClassWorld; + + +/** + * @author Andy Taylor + */ + +/** + * @phase verify + * @goal start + */ +public class ActiveMQStartPlugin extends AbstractMojo + +{ + /** + * The plugin descriptor + */ + private PluginDescriptor descriptor; + + + /** + * @parameter default-value=false + */ + private Boolean waitOnStart; + + /** + * @parameter + */ + private String configurationDir; + + /** + * @parameter + */ + private String nodeId; + + /** + * @parameter default-value=false; + */ + private Boolean fork; + + /** + * @parameter default-value=false + */ + private Boolean debug; + + /** + * @parameter + */ + private Properties systemProperties; + + /** + * @parameter default-value=STARTED:: + */ + private String serverStartString; + + /** + * @parameter + */ + private ActiveMQSecurityManager securityManager; + + /** + * registers a TestClusterMBean for test clients to use. + */ + private boolean testClusterManager; + + public void execute() throws MojoExecutionException, MojoFailureException + { + if (testClusterManager) + { + try + { + createClusterManagerMBean(); + } + catch (Exception e) + { + throw new MojoExecutionException("Failed to create cluster manager mbean", e); + } + } + + if (systemProperties != null && !systemProperties.isEmpty()) + { + System.getProperties() + .putAll(systemProperties); + } + + String workingPath = new File(".").getAbsolutePath(); + + try + { + registerNode(nodeId, workingPath, configurationDir); + } + catch (Exception e1) + { + throw new MojoExecutionException("Failed to create cluster manager mbean", e1); + } + + if (fork) + { + try + { + PluginDescriptor pd = (PluginDescriptor) getPluginContext().get("pluginDescriptor"); + final Process p = SpawnedVMSupport.spawnVM(pd.getArtifacts(), + "ActiveMQServer_" + (nodeId != null ? nodeId : ""), + SpawnedActiveMQBootstrap.class.getName(), + systemProperties, + true, + serverStartString, + "FAILED::", + ".", + configurationDir, + debug, + configurationDir, + "" + waitOnStart, + nodeId); + Runtime.getRuntime().addShutdownHook(new Thread() + { + @Override + public void run() + { + //just to be on the safe side + p.destroy(); + } + }); + if (waitOnStart) + { + p.waitFor(); + } + } + catch (Throwable e) + { + e.printStackTrace(); + throw new MojoExecutionException(e.getMessage()); + } + } + else + { + ActiveMQBootstrap bootstrap = new ActiveMQBootstrap(configurationDir, waitOnStart, nodeId, securityManager); + if (configurationDir != null) + { + extendPluginClasspath(configurationDir); + } + try + { + bootstrap.execute(); + } + catch (Exception e) + { + throw new MojoExecutionException(e.getMessage(), e); + } + } + } + + private void registerNode(String nodeId, String workingPath, + String hornetqConfigurationDir) throws Exception + { + TestClusterManagerMBean control = PluginUtil.getTestClusterManager(); + if (control != null) + { + control.registerNode(nodeId, workingPath, hornetqConfigurationDir); + } + } + + private void createClusterManagerMBean() throws Exception + { + MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); + ObjectName name = ObjectName.getInstance("hornetq:module=test,type=TestClusterManager"); + mbeanServer.registerMBean(new TestClusterManager(), name); + } + + public void extendPluginClasspath(String element) throws MojoExecutionException + { + ClassWorld world = new ClassWorld(); + ClassRealm realm; + try + { + realm = world.newRealm( + "maven.plugin." + getClass().getSimpleName() + ((nodeId == null) ? "" : nodeId), + Thread.currentThread() + .getContextClassLoader() + ); + File elementFile = new File(element); + getLog().debug("Adding element to plugin classpath" + elementFile.getPath()); + realm.addConstituent(elementFile.toURI() + .toURL()); + } + catch (Exception ex) + { + throw new MojoExecutionException(ex.toString(), ex); + } + System.out.println(Arrays.toString(realm.getConstituents())); + Thread.currentThread() + .setContextClassLoader(realm.getClassLoader()); + } +} diff --git a/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQStopPlugin.java b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQStopPlugin.java new file mode 100644 index 0000000000..b6b374bed6 --- /dev/null +++ b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/ActiveMQStopPlugin.java @@ -0,0 +1,78 @@ +/** + * 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.maven; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; + +import java.io.File; +import java.io.IOException; + +/** + * @author Andy Taylor + * Date: 8/18/11 + * Time: 12:25 PM + */ + +/** + * @phase verify + * @goal stop + */ +public class ActiveMQStopPlugin extends AbstractMojo +{ + + /** + * @parameter + */ + private String configurationDir; + + public void execute() throws MojoExecutionException, MojoFailureException + { + try + { + String dirName = configurationDir != null ? configurationDir : "."; + final File file = new File(dirName + "/" + "/STOP_ME"); + file.createNewFile(); + long time = System.currentTimeMillis(); + while (System.currentTimeMillis() < time + 60000) + { + if (!file.exists()) + { + break; + } + try + { + Thread.sleep(200); + } + catch (InterruptedException e) + { + //ignore + } + } + if (file.exists()) + { + throw new MojoExecutionException("looks like the server hasn't been stopped"); + } + } + catch (IOException e) + { + e.printStackTrace(); + throw new MojoExecutionException(e.getMessage()); + } + } +} diff --git a/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/InVMNodeManagerServer.java b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/InVMNodeManagerServer.java new file mode 100644 index 0000000000..97d3f372f2 --- /dev/null +++ b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/InVMNodeManagerServer.java @@ -0,0 +1,73 @@ +/** + * 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.maven; + +import javax.management.MBeanServer; + +import org.apache.activemq.core.config.Configuration; +import org.apache.activemq.core.server.NodeManager; +import org.apache.activemq.core.server.impl.ActiveMQServerImpl; +import org.apache.activemq.spi.core.security.ActiveMQSecurityManager; + +public final class InVMNodeManagerServer extends ActiveMQServerImpl +{ + final NodeManager nodeManager; + + public InVMNodeManagerServer(final NodeManager nodeManager) + { + super(); + this.nodeManager = nodeManager; + } + + public InVMNodeManagerServer(final Configuration configuration, final NodeManager nodeManager) + { + super(configuration); + this.nodeManager = nodeManager; + } + + public InVMNodeManagerServer(final Configuration configuration, + final MBeanServer mbeanServer, + final NodeManager nodeManager) + { + super(configuration, mbeanServer); + this.nodeManager = nodeManager; + } + + public InVMNodeManagerServer(final Configuration configuration, + final ActiveMQSecurityManager securityManager, + final NodeManager nodeManager) + { + super(configuration, securityManager); + this.nodeManager = nodeManager; + } + + public InVMNodeManagerServer(final Configuration configuration, + final MBeanServer mbeanServer, + final ActiveMQSecurityManager securityManager, + final NodeManager nodeManager) + { + super(configuration, mbeanServer, securityManager); + this.nodeManager = nodeManager; + } + + @Override + protected NodeManager createNodeManager(final String directory, boolean replicatingBackup) + { + return nodeManager; + } + +} diff --git a/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/PluginUtil.java b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/PluginUtil.java new file mode 100644 index 0000000000..a066f4f98b --- /dev/null +++ b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/PluginUtil.java @@ -0,0 +1,50 @@ +/** + * 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.maven; + +import javax.management.MBeanServerConnection; +import javax.management.MBeanServerInvocationHandler; +import javax.management.ObjectName; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; +import java.util.HashMap; + +public class PluginUtil +{ + public static TestClusterManagerMBean getTestClusterManager() + { + final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3000/jmxrmi"; + try + { + JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap()); + ObjectName name = ObjectName.getInstance("activemq:module=test,type=TestClusterManager"); + MBeanServerConnection mbsc = connector.getMBeanServerConnection(); + TestClusterManagerMBean clusterControl = MBeanServerInvocationHandler.newProxyInstance(mbsc, + name, + TestClusterManagerMBean.class, + false); + clusterControl.getNumNodes();//serves as a validation. + return clusterControl; + } + catch (Exception e) + { + return null; + } + } + +} diff --git a/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/TestClusterManager.java b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/TestClusterManager.java new file mode 100644 index 0000000000..b03fa589af --- /dev/null +++ b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/TestClusterManager.java @@ -0,0 +1,52 @@ +/** + * 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.maven; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class TestClusterManager implements TestClusterManagerMBean +{ + private List testNodes = new ArrayList(); + + @Override + public int getNumNodes() + { + synchronized (testNodes) + { + return testNodes.size(); + } + } + + @Override + public void registerNode(String nodeId, String workingDir, + String hornetqConfigurationDir) + { + synchronized (testNodes) + { + testNodes.add(new TestNode(nodeId, workingDir, hornetqConfigurationDir)); + } + } + + @Override + public void killNode(int i) throws IOException + { + TestNode node = testNodes.get(i); + node.kill(); + } +} diff --git a/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/TestClusterManagerMBean.java b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/TestClusterManagerMBean.java new file mode 100644 index 0000000000..001e7a8942 --- /dev/null +++ b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/TestClusterManagerMBean.java @@ -0,0 +1,29 @@ +/** + * 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.maven; + +import java.io.IOException; + +public interface TestClusterManagerMBean +{ + int getNumNodes(); + + void registerNode(String nodeId, String workingDir, + String hornetqConfigurationDirt); + + void killNode(int i) throws IOException; +} diff --git a/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/TestNode.java b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/TestNode.java new file mode 100644 index 0000000000..ba31c50463 --- /dev/null +++ b/activemq-maven-plugin/src/main/java/org/apache/activemq/maven/TestNode.java @@ -0,0 +1,49 @@ +/** + * 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.maven; + +import java.io.File; +import java.io.IOException; + +public class TestNode +{ + String nodeId; + String workingDir; + String configDir; + + public TestNode(String nodeId, String workingDir, + String configDir) + { + this.nodeId = nodeId; + this.workingDir = workingDir; + this.configDir = configDir; + } + + public void kill() throws IOException + { + File file = new File(configDir, "KILL_ME"); + file.createNewFile(); + try + { + Thread.sleep(3000); + } + catch (InterruptedException e) + { + } + } + +} diff --git a/activemq-maven-plugin/src/main/java/org/apache/activemq/server/ActiveMQBootstrap.java b/activemq-maven-plugin/src/main/java/org/apache/activemq/server/ActiveMQBootstrap.java new file mode 100644 index 0000000000..49b16c89b4 --- /dev/null +++ b/activemq-maven-plugin/src/main/java/org/apache/activemq/server/ActiveMQBootstrap.java @@ -0,0 +1,258 @@ +/** + * 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.server; + +import java.io.File; +import java.lang.management.ManagementFactory; +import java.util.HashMap; +import java.util.Map; +import java.util.Timer; +import java.util.TimerTask; + +import org.apache.activemq.core.config.Configuration; +import org.apache.activemq.core.config.HAPolicyConfiguration; +import org.apache.activemq.core.config.impl.ConfigurationImpl; +import org.apache.activemq.core.config.impl.FileConfiguration; +import org.apache.activemq.core.server.ActiveMQServer; +import org.apache.activemq.core.server.JournalType; +import org.apache.activemq.core.server.NodeManager; +import org.apache.activemq.core.server.impl.ActiveMQServerImpl; +import org.apache.activemq.core.server.impl.InVMNodeManager; +import org.apache.activemq.jms.server.JMSServerManager; +import org.apache.activemq.jms.server.impl.JMSServerManagerImpl; +import org.apache.activemq.maven.InVMNodeManagerServer; +import org.apache.activemq.spi.core.security.ActiveMQSecurityManager; +import org.apache.activemq.spi.core.security.ActiveMQSecurityManagerImpl; + +/** + * This will bootstrap the HornetQ Server and also the naming server if required + * + * @author Andy Taylor + */ +public class ActiveMQBootstrap +{ + private final String configurationDir; + + private final Boolean waitOnStart; + + private final String nodeId; + + private static Map managerMap = new HashMap(); + + private boolean spawned = false; + + private ActiveMQServer server; + + private Configuration configuration; + + private JMSServerManager manager; + + private ActiveMQSecurityManager securityManager; + + + public ActiveMQBootstrap(String configurationDir, Boolean waitOnStart, String nodeId, ActiveMQSecurityManager securityManager) + { + this.configurationDir = configurationDir; + this.waitOnStart = waitOnStart; + this.nodeId = nodeId; + this.securityManager = securityManager; + } + + public ActiveMQBootstrap(String[] args) + { + this.configurationDir = args[0]; + this.waitOnStart = Boolean.valueOf(args[1]); + this.nodeId = args[2]; + spawned = true; + } + + public void execute() throws Exception + { + try + { + if (configurationDir != null) + { + //extendPluginClasspath(configurationDir); + configuration = new FileConfiguration(); + File file = new File(configurationDir + "/" + "activemq-configuration.xml"); + ((FileConfiguration) configuration).setConfigurationUrl(file.toURI().toURL().toExternalForm()); + ((FileConfiguration) configuration).start(); + } + else + { + configuration = new ConfigurationImpl(); + configuration.setJournalType(JournalType.NIO); + } + + createServer(configuration); + + if (waitOnStart) + { + String dirName = System.getProperty("activemq.config.dir", "."); + final File file = new File(dirName + "/STOP_ME"); + if (file.exists()) + { + file.delete(); + } + + while (!file.exists()) + { + Thread.sleep(500); + } + + manager.stop(); + file.delete(); + } + else + { + String dirName = configurationDir != null ? configurationDir : "."; + final File stopFile = new File(dirName + "/STOP_ME"); + if (stopFile.exists()) + { + stopFile.delete(); + } + final File killFile = new File(dirName + "/KILL_ME"); + if (killFile.exists()) + { + killFile.delete(); + } + final File restartFile = new File(dirName + "/RESTART_ME"); + if (restartFile.exists()) + { + restartFile.delete(); + } + final Timer timer = new Timer("ActiveMQ Server Shutdown Timer", true); + timer.scheduleAtFixedRate(new ServerStopTimerTask(stopFile, killFile, restartFile, timer), 500, 500); + } + } + catch (Exception e) + { + e.printStackTrace(); + throw new Exception(e.getMessage()); + } + } + + private void createServer(Configuration configuration) throws Exception + { + if (nodeId != null && !nodeId.equals("") && !nodeId.equals("null")) + { + InVMNodeManager nodeManager = (InVMNodeManager) managerMap.get(nodeId); + if (nodeManager == null) + { + boolean replicatedBackup = configuration.getHAPolicyConfiguration().getType() == HAPolicyConfiguration.TYPE.REPLICA; + nodeManager = new InVMNodeManager(replicatedBackup, configuration.getJournalDirectory()); + managerMap.put(nodeId, nodeManager); + } + server = new InVMNodeManagerServer(configuration, ManagementFactory.getPlatformMBeanServer(), + securityManager != null ? securityManager : new ActiveMQSecurityManagerImpl(), nodeManager); + } + else + { + server = new ActiveMQServerImpl(configuration, ManagementFactory.getPlatformMBeanServer(), + securityManager != null ? securityManager : new ActiveMQSecurityManagerImpl()); + } + + manager = new JMSServerManagerImpl(server); + manager.start(); + } + + private class ServerStopTimerTask extends TimerTask + { + private final File stopFile; + private final Timer timer; + private final File killFile; + private final File restartFile; + + public ServerStopTimerTask(File stopFile, File killFile, File restartFile, Timer timer) + { + this.stopFile = stopFile; + this.killFile = killFile; + this.restartFile = restartFile; + this.timer = timer; + } + + @Override + public void run() + { + if (stopFile.exists()) + { + try + { + timer.cancel(); + } + finally + { + try + { + if (manager != null) + { + manager.stop(); + manager = null; + } + server = null; + stopFile.delete(); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + if (spawned) + { + Runtime.getRuntime() + .halt(666); + } + } + else if (killFile.exists()) + { + try + { + if (!spawned) + { + manager.getActiveMQServer() + .stop(true); + manager.stop(); + manager = null; + server = null; + killFile.delete(); + } + else + { + killFile.delete(); + Runtime.getRuntime().halt(777); + } + } + catch (Exception e) + { + e.printStackTrace(); + } + } + else if (restartFile.exists()) + { + try + { + createServer(configuration); + restartFile.delete(); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } +} diff --git a/activemq-maven-plugin/src/main/java/org/apache/activemq/server/SpawnedActiveMQBootstrap.java b/activemq-maven-plugin/src/main/java/org/apache/activemq/server/SpawnedActiveMQBootstrap.java new file mode 100644 index 0000000000..8ce850566b --- /dev/null +++ b/activemq-maven-plugin/src/main/java/org/apache/activemq/server/SpawnedActiveMQBootstrap.java @@ -0,0 +1,41 @@ +/** + * 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.server; + +/** + * @author Andy Taylor + * 5/14/12 + * + * This class will be spawned in a new vm and will call the bootstrap + */ +public class SpawnedActiveMQBootstrap +{ + public static void main(final String[] args) + { + ActiveMQBootstrap bootstrap; + try + { + bootstrap = new ActiveMQBootstrap(args); + bootstrap.execute(); + System.out.println("STARTED::"); + } + catch (Throwable e) + { + System.out.println("FAILED::" + e.getMessage()); + } + } +} diff --git a/activemq-maven-plugin/src/main/java/org/apache/activemq/server/SpawnedVMSupport.java b/activemq-maven-plugin/src/main/java/org/apache/activemq/server/SpawnedVMSupport.java new file mode 100644 index 0000000000..55782d2352 --- /dev/null +++ b/activemq-maven-plugin/src/main/java/org/apache/activemq/server/SpawnedVMSupport.java @@ -0,0 +1,257 @@ +/** + * 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.server; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import org.apache.maven.artifact.DefaultArtifact; + +/** + * @author Ovidiu Feodorov + * @author Jeff Mesnil + * @author Clebert Suconic + */ +public class SpawnedVMSupport +{ + public static Process spawnVM(List arts, + final String logName, + final String className, + final Properties properties, + final boolean logOutput, + final String success, + final String failure, + final String workDir, + final String configDir, + boolean debug, + final String... args) throws Exception + { + StringBuffer sb = new StringBuffer(); + + sb.append("java") + .append(' '); + StringBuffer props = new StringBuffer(); + if (properties != null) + { + for (Map.Entry entry : properties.entrySet()) + { + props.append("-D") + .append(entry.getKey()) + .append("=") + .append(entry.getValue()) + .append(" "); + } + } + String vmarg = props.toString(); + String osName = System.getProperty("os.name"); + osName = (osName != null) ? osName.toLowerCase() : ""; + boolean isWindows = osName.contains("win"); + if (isWindows) + { + vmarg = vmarg.replaceAll("/", "\\\\"); + } + sb.append(vmarg) + .append(" "); + String pathSeparater = System.getProperty("path.separator"); + StringBuilder classpath = new StringBuilder(); + for (DefaultArtifact artifact : arts) + { + classpath.append(artifact.getFile() + .getAbsolutePath()) + .append(pathSeparater); + } + classpath.append(configDir) + .append(pathSeparater); + + if (isWindows) + { + sb.append("-cp") + .append(" \"") + .append(classpath.toString()) + .append("\" "); + } + else + { + sb.append("-cp") + .append(" ") + .append(classpath.toString()) + .append(" "); + } + + // FIXME - not good to assume path separator + String libPath = "-Djava.library.path=" + System.getProperty("java.library.path", "./native/bin"); + if (isWindows) + { + libPath = libPath.replaceAll("/", "\\\\"); + libPath = "\"" + libPath + "\""; + } + sb.append("-Djava.library.path=") + .append(libPath) + .append(" "); + if (debug) + { + sb.append("-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 "); + } + + sb.append(className) + .append(' '); + + for (String arg : args) + { + sb.append(arg) + .append(' '); + } + + String commandLine = sb.toString(); + + //SpawnedVMSupport.log.trace("command line: " + commandLine); + + Process process = Runtime.getRuntime() + .exec(commandLine, null, new File(workDir)); + + //SpawnedVMSupport.log.trace("process: " + process); + + CountDownLatch latch = new CountDownLatch(1); + + ProcessLogger outputLogger = new ProcessLogger(logOutput, + process.getInputStream(), + logName, + false, + success, + failure, + latch); + outputLogger.start(); + + // Adding a reader to System.err, so the VM won't hang on a System.err.println as identified on this forum thread: + // http://www.jboss.org/index.html?module=bb&op=viewtopic&t=151815 + ProcessLogger errorLogger = new ProcessLogger(true, + process.getErrorStream(), + logName, + true, + success, + failure, + latch); + errorLogger.start(); + + if (!latch.await(60, TimeUnit.SECONDS)) + { + process.destroy(); + throw new RuntimeException("Timed out waiting for server to start"); + } + + if (outputLogger.failed || errorLogger.failed) + { + try + { + process.destroy(); + } + catch (Throwable e) + { + } + throw new RuntimeException("server failed to start"); + } + return process; + } + + /** + * Redirect the input stream to a logger (as debug logs) + */ + static class ProcessLogger extends Thread + { + private final InputStream is; + + private final String logName; + + private final boolean print; + + private final boolean sendToErr; + + private final String success; + + private final String failure; + + private final CountDownLatch latch; + + boolean failed = false; + + ProcessLogger(final boolean print, + final InputStream is, + final String logName, + final boolean sendToErr, + final String success, + final String failure, + final CountDownLatch latch) throws ClassNotFoundException + { + this.is = is; + this.print = print; + this.logName = logName; + this.sendToErr = sendToErr; + this.success = success; + this.failure = failure; + this.latch = latch; + setDaemon(false); + } + + @Override + public void run() + { + try + { + InputStreamReader isr = new InputStreamReader(is); + BufferedReader br = new BufferedReader(isr); + String line; + while ((line = br.readLine()) != null) + { + if (line.startsWith(success)) + { + failed = false; + latch.countDown(); + } + else if (line.startsWith(failure)) + { + failed = true; + latch.countDown(); + } + if (print) + { + if (sendToErr) + { + System.err.println(logName + " err:" + line); + } + else + { + System.out.println(logName + " out:" + line); + } + } + } + } + catch (IOException e) + { + // ok, stream closed + } + + } + } +} diff --git a/examples/core/perf/pom.xml b/examples/core/perf/pom.xml index 6db15e94c2..67c938834c 100644 --- a/examples/core/perf/pom.xml +++ b/examples/core/perf/pom.xml @@ -63,7 +63,7 @@ true - ${basedir}/target/classes/server0 + ${basedir}/target/classes/server0 build.directory @@ -75,7 +75,7 @@ false - ${basedir}/target/classes/server0 + ${basedir}/target/classes/server0 diff --git a/examples/core/vertx-connector/pom.xml b/examples/core/vertx-connector/pom.xml index c12f66aa8c..937c49aaea 100644 --- a/examples/core/vertx-connector/pom.xml +++ b/examples/core/vertx-connector/pom.xml @@ -161,7 +161,7 @@ false - ${basedir}/target/classes/server0 + ${basedir}/target/classes/server0 diff --git a/examples/jms/activemq-jms-examples-common/src/main/java/org/apache/activemq/common/example/ActiveMQExample.java b/examples/jms/activemq-jms-examples-common/src/main/java/org/apache/activemq/common/example/ActiveMQExample.java index 86059b6330..6527893aa4 100644 --- a/examples/jms/activemq-jms-examples-common/src/main/java/org/apache/activemq/common/example/ActiveMQExample.java +++ b/examples/jms/activemq-jms-examples-common/src/main/java/org/apache/activemq/common/example/ActiveMQExample.java @@ -43,12 +43,11 @@ import org.apache.activemq.jms.client.ActiveMQConnectionFactory; */ public abstract class ActiveMQExample { - protected static final Logger log = Logger.getLogger(ActiveMQExample.class - .getName()); + protected static final Logger log = Logger.getLogger(ActiveMQExample.class.getName()); protected boolean failure = false; - private String[] args; + protected String[] args; public abstract boolean runExample() throws Exception; @@ -176,17 +175,6 @@ public abstract class ActiveMQExample } } - protected InitialContext getContext(final int serverId) throws Exception - { - ActiveMQExample.log.info("using " + args[serverId] + " for jndi"); - Properties props = new Properties(); - props.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); - props.put("java.naming.provider.url", args[serverId]); - props.put("queue.queue/exampleQueue", "exampleQueue"); - props.put("topic.topic/exampleTopic", "exampleTopic"); - return new InitialContext(props); - } - protected int getServer(Connection connection) { ClientSession session = ((ActiveMQConnection) connection).getInitialSession(); diff --git a/examples/jms/aerogear/pom.xml b/examples/jms/aerogear/pom.xml index 516d13f5de..558f395363 100644 --- a/examples/jms/aerogear/pom.xml +++ b/examples/jms/aerogear/pom.xml @@ -125,7 +125,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/aerogear/readme.html b/examples/jms/aerogear/readme.html index cd3c15bba6..f05abcede6 100644 --- a/examples/jms/aerogear/readme.html +++ b/examples/jms/aerogear/readme.html @@ -65,8 +65,8 @@
            
    <queues>
-       <queue name="jms.queue.aerogearQueue">
-           <address>jms.queue.aerogearQueue</address>
+       <queue name="jms.queue.exampleQueue">
+           <address>jms.queue.exampleQueue</address>
        </queue>
    </queues>
 
@@ -74,7 +74,7 @@
        <connector-service name="aerogear-connector">
            <factory-class>org.apache.activemq.integration.aerogear.AeroGearConnectorServiceFactory</factory-class>
            <param key="endpoint" value="${endpoint}"/>
-           <param key="queue" value="jms.queue.aerogearQueue"/>
+           <param key="queue" value="jms.queue.exampleQueue"/>
            <param key="application-id" value="${applicationid}"/>
            <param key="master-secret" value="${mastersecret}"/>
        </connector-service>
@@ -105,7 +105,7 @@
   

Now lets look at a snippet of code we used to send the message for our JMS client

       
-  Queue queue = (Queue)initialContext.lookup("/queue/aerogearQueue");
+  Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
 
   // Step 3. Perform a lookup on the Connection Factory
   ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
diff --git a/examples/jms/aerogear/src/main/java/org/apache/activemq/jms/example/AerogearExample.java b/examples/jms/aerogear/src/main/java/org/apache/activemq/jms/example/AerogearExample.java
index 1c4ec67143..2c47863ad9 100644
--- a/examples/jms/aerogear/src/main/java/org/apache/activemq/jms/example/AerogearExample.java
+++ b/examples/jms/aerogear/src/main/java/org/apache/activemq/jms/example/AerogearExample.java
@@ -48,7 +48,7 @@ public class AerogearExample extends ActiveMQExample
       try
       {
          // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = getContext(0);
+         initialContext = new InitialContext();
 
          // Step 2. Perfom a lookup on the queue
          Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
diff --git a/examples/jms/aerogear/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/aerogear/src/main/resources/activemq/server0/activemq-configuration.xml
similarity index 81%
rename from examples/jms/aerogear/src/main/resources/hornetq/server0/activemq-configuration.xml
rename to examples/jms/aerogear/src/main/resources/activemq/server0/activemq-configuration.xml
index b3596f3442..b891603b69 100644
--- a/examples/jms/aerogear/src/main/resources/hornetq/server0/activemq-configuration.xml
+++ b/examples/jms/aerogear/src/main/resources/activemq/server0/activemq-configuration.xml
@@ -9,15 +9,6 @@
    ${build.directory}/server0/data/messaging/largemessages
 
    ${build.directory}/server0/data/messaging/paging
-
-
-   
-
-   
-      
-         org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory
-      
-   
    
    
    
@@ -29,8 +20,8 @@
     
     
-        
-            
jms.queue.aerogearQueue
+ +
jms.queue.exampleQueue
@@ -38,7 +29,7 @@ org.apache.activemq.integration.aerogear.AeroGearConnectorServiceFactory - + @@ -48,7 +39,7 @@ - + diff --git a/examples/jms/application-layer-failover/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/aerogear/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/application-layer-failover/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/aerogear/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/aerogear/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/aerogear/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/aerogear/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/aerogear/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/client-jndi.properties b/examples/jms/aerogear/src/main/resources/jndi.properties similarity index 50% rename from examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/client-jndi.properties rename to examples/jms/aerogear/src/main/resources/jndi.properties index 6940f75d77..d9b5c6ae23 100644 --- a/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/client-jndi.properties +++ b/examples/jms/aerogear/src/main/resources/jndi.properties @@ -1,2 +1,3 @@ java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory -java.naming.provider.url=tcp://localhost:5445 \ No newline at end of file +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/applet/pom.xml b/examples/jms/applet/pom.xml index 4a2a26115a..a15d5f9f7b 100644 --- a/examples/jms/applet/pom.xml +++ b/examples/jms/applet/pom.xml @@ -40,7 +40,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -67,7 +67,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/applet/src/main/java/org/apache/activemq/jms/example/HttpStaticFileServer.java b/examples/jms/applet/src/main/java/org/apache/activemq/jms/example/HttpStaticFileServer.java index 25c900be0f..362681966c 100644 --- a/examples/jms/applet/src/main/java/org/apache/activemq/jms/example/HttpStaticFileServer.java +++ b/examples/jms/applet/src/main/java/org/apache/activemq/jms/example/HttpStaticFileServer.java @@ -20,8 +20,8 @@ import java.net.InetSocketAddress; import java.util.concurrent.Executors; import org.apache.activemq.common.example.ActiveMQExample; -import org.jboss.netty.bootstrap.ServerBootstrap; -import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory; +import io.netty.bootstrap.ServerBootstrap; +import io.netty.channel.socket.nio.NioServerSocketChannelFactory; /** * A HttpServer diff --git a/examples/jms/applet/src/main/java/org/apache/activemq/jms/example/HttpStaticFileServerHandler.java b/examples/jms/applet/src/main/java/org/apache/activemq/jms/example/HttpStaticFileServerHandler.java index 744f4230e8..6443ef9a79 100644 --- a/examples/jms/applet/src/main/java/org/apache/activemq/jms/example/HttpStaticFileServerHandler.java +++ b/examples/jms/applet/src/main/java/org/apache/activemq/jms/example/HttpStaticFileServerHandler.java @@ -22,24 +22,24 @@ import java.io.RandomAccessFile; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; -import org.jboss.netty.buffer.ChannelBuffers; -import org.jboss.netty.channel.Channel; -import org.jboss.netty.channel.ChannelFuture; -import org.jboss.netty.channel.ChannelFutureListener; -import org.jboss.netty.channel.ChannelHandlerContext; -import org.jboss.netty.channel.ChannelPipelineCoverage; -import org.jboss.netty.channel.ExceptionEvent; -import org.jboss.netty.channel.MessageEvent; -import org.jboss.netty.channel.SimpleChannelUpstreamHandler; -import org.jboss.netty.handler.codec.frame.TooLongFrameException; -import org.jboss.netty.handler.codec.http.DefaultHttpResponse; -import org.jboss.netty.handler.codec.http.HttpHeaders; -import org.jboss.netty.handler.codec.http.HttpMethod; -import org.jboss.netty.handler.codec.http.HttpRequest; -import org.jboss.netty.handler.codec.http.HttpResponse; -import org.jboss.netty.handler.codec.http.HttpResponseStatus; -import org.jboss.netty.handler.codec.http.HttpVersion; -import org.jboss.netty.handler.stream.ChunkedFile; +import io.netty.buffer.ChannelBuffers; +import io.netty.channel.Channel; +import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelPipelineCoverage; +import io.netty.channel.ExceptionEvent; +import io.netty.channel.MessageEvent; +import io.netty.channel.SimpleChannelUpstreamHandler; +import io.netty.handler.codec.frame.TooLongFrameException; +import io.netty.handler.codec.http.DefaultHttpResponse; +import io.netty.handler.codec.http.HttpHeaders; +import io.netty.handler.codec.http.HttpMethod; +import io.netty.handler.codec.http.HttpRequest; +import io.netty.handler.codec.http.HttpResponse; +import io.netty.handler.codec.http.HttpResponseStatus; +import io.netty.handler.codec.http.HttpVersion; +import io.netty.handler.stream.ChunkedFile; /** * A HttpStaticFileServerHandler diff --git a/examples/jms/applet/src/main/java/org/apache/activemq/jms/example/HttpStaticFileServerPipelineFactory.java b/examples/jms/applet/src/main/java/org/apache/activemq/jms/example/HttpStaticFileServerPipelineFactory.java index 22ae149359..d4744f3675 100644 --- a/examples/jms/applet/src/main/java/org/apache/activemq/jms/example/HttpStaticFileServerPipelineFactory.java +++ b/examples/jms/applet/src/main/java/org/apache/activemq/jms/example/HttpStaticFileServerPipelineFactory.java @@ -16,12 +16,12 @@ */ package org.apache.activemq.jms.example; -import org.jboss.netty.channel.ChannelPipeline; -import org.jboss.netty.channel.ChannelPipelineFactory; -import org.jboss.netty.channel.Channels; -import org.jboss.netty.handler.codec.http.HttpRequestDecoder; -import org.jboss.netty.handler.codec.http.HttpResponseEncoder; -import org.jboss.netty.handler.stream.ChunkedWriteHandler; +import io.netty.channel.ChannelPipeline; +import io.netty.channel.ChannelPipelineFactory; +import io.netty.channel.Channels; +import io.netty.handler.codec.http.HttpRequestDecoder; +import io.netty.handler.codec.http.HttpResponseEncoder; +import io.netty.handler.stream.ChunkedWriteHandler; /** * A HttpStaticFileServerPipelineFactory diff --git a/examples/jms/applet/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/applet/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/applet/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/applet/src/main/resources/activemq/server0/activemq-configuration.xml index ea0fb023e7..7e6a27debc 100644 --- a/examples/jms/applet/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/applet/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,13 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/applet/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/applet/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/applet/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/applet/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/applet/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/applet/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/applet/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/applet/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/application-layer-failover/pom.xml b/examples/jms/application-layer-failover/pom.xml index c9cfb1af89..08fe255287 100644 --- a/examples/jms/application-layer-failover/pom.xml +++ b/examples/jms/application-layer-failover/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -45,10 +45,8 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 - INFO: HQ221034 + ${basedir}/target/classes/activemq/server1 + INFO: AMQ221001 true @@ -77,7 +75,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -86,7 +84,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 @@ -129,7 +127,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/jms/example/ApplicationLayerFailoverExample.java b/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/jms/example/ApplicationLayerFailoverExample.java index 2887e4caab..0c6e02385c 100644 --- a/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/jms/example/ApplicationLayerFailoverExample.java +++ b/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/jms/example/ApplicationLayerFailoverExample.java @@ -16,6 +16,9 @@ */ package org.apache.activemq.jms.example; +import java.lang.Object; +import java.lang.String; +import java.util.Hashtable; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -149,7 +152,11 @@ public class ApplicationLayerFailoverExample extends ActiveMQExample private void createJMSObjects(final int server) throws Exception { // Step 1. Get an initial context for looking up JNDI from the server - initialContext = getContext(server); + Hashtable properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", "tcp://127.0.0.1:" + (5445 + server)); + properties.put("queue.queue/exampleQueue", "exampleQueue"); + initialContext = new InitialContext(properties); // Step 2. Look-up the JMS Queue object from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/application-layer-failover/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/application-layer-failover/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 82% rename from examples/jms/application-layer-failover/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/application-layer-failover/src/main/resources/activemq/server0/activemq-configuration.xml index a6671632d6..acd98cbbc2 100644 --- a/examples/jms/application-layer-failover/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/application-layer-failover/src/main/resources/activemq/server0/activemq-configuration.xml @@ -2,16 +2,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd"> - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory diff --git a/examples/jms/application-layer-failover/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/application-layer-failover/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/application-layer-failover/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/application-layer-failover/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/application-layer-failover/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/application-layer-failover/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/application-layer-failover/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/application-layer-failover/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/application-layer-failover/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/application-layer-failover/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 82% rename from examples/jms/application-layer-failover/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/application-layer-failover/src/main/resources/activemq/server1/activemq-configuration.xml index 7845578c1f..74fe0a6795 100644 --- a/examples/jms/application-layer-failover/src/main/resources/hornetq/server1/activemq-configuration.xml +++ b/examples/jms/application-layer-failover/src/main/resources/activemq/server1/activemq-configuration.xml @@ -3,15 +3,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd"> - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/application-layer-failover/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/application-layer-failover/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/application-layer-failover/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/application-layer-failover/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/application-layer-failover/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/application-layer-failover/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/bridge/pom.xml b/examples/jms/bridge/pom.xml index 0c7b49c0da..1189fc0924 100644 --- a/examples/jms/bridge/pom.xml +++ b/examples/jms/bridge/pom.xml @@ -41,7 +41,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -52,7 +52,7 @@ 1199 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -81,7 +81,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -90,7 +90,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/bridge/src/main/java/org/apache/activemq/jms/example/BridgeExample.java b/examples/jms/bridge/src/main/java/org/apache/activemq/jms/example/BridgeExample.java index fcf8719da6..4f235b3fad 100644 --- a/examples/jms/bridge/src/main/java/org/apache/activemq/jms/example/BridgeExample.java +++ b/examples/jms/bridge/src/main/java/org/apache/activemq/jms/example/BridgeExample.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.jms.example; +import java.util.Hashtable; + import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.Message; @@ -55,11 +57,15 @@ public class BridgeExample extends ActiveMQExample { // Step 1 - we create an initial context for looking up JNDI on node 0 - ic0 = getContext(0); + Hashtable properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", "tcp://127.0.0.1:5445"); + properties.put("queue.queue/sausage-factory", "sausage-factory"); + ic0 = new InitialContext(properties); // Step 2 - we look up the sausage-factory queue from node 0 - Queue sausageFactory = (Queue)ic0.lookup("queue/exampleQueue"); + Queue sausageFactory = (Queue)ic0.lookup("queue/sausage-factory"); // Step 3 - we look up a JMS ConnectionFactory object from node 0 @@ -67,11 +73,15 @@ public class BridgeExample extends ActiveMQExample // Step 4 - we create an initial context for looking up JNDI on node 1 - ic1 = getContext(1); + properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", "tcp://127.0.0.1:5446"); + properties.put("queue.queue/mincing-machine", "mincing-machine"); + ic1 = new InitialContext(properties); // Step 5 - we look up the mincing-machine queue on node 1 - Queue mincingMachine = (Queue)ic1.lookup("queue/exampleQueue1"); + Queue mincingMachine = (Queue)ic1.lookup("queue/mincing-machine"); // Step 6 - we look up a JMS ConnectionFactory object from node 1 diff --git a/examples/jms/bridge/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/bridge/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 92% rename from examples/jms/bridge/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/bridge/src/main/resources/activemq/server0/activemq-configuration.xml index 0611367505..9256360a14 100644 --- a/examples/jms/bridge/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/bridge/src/main/resources/activemq/server0/activemq-configuration.xml @@ -12,11 +12,6 @@ - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory diff --git a/examples/jms/bridge/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/bridge/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/bridge/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/bridge/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/bridge/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/bridge/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/bridge/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/bridge/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/bridge/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/bridge/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 84% rename from examples/jms/bridge/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/bridge/src/main/resources/activemq/server1/activemq-configuration.xml index 58ab92e497..91b6131efd 100644 --- a/examples/jms/bridge/src/main/resources/hornetq/server1/activemq-configuration.xml +++ b/examples/jms/bridge/src/main/resources/activemq/server1/activemq-configuration.xml @@ -9,15 +9,6 @@ ${build.directory}/server1/data/messaging/largemessages ${build.directory}/server1/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - diff --git a/examples/jms/bridge/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/bridge/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/bridge/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/bridge/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/bridge/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/bridge/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/bridge/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/bridge/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/browser/pom.xml b/examples/jms/browser/pom.xml index ffcd9471c0..5056aaa44e 100644 --- a/examples/jms/browser/pom.xml +++ b/examples/jms/browser/pom.xml @@ -94,7 +94,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory diff --git a/examples/jms/browser/src/main/java/org/apache/activemq/jms/example/QueueBrowserExample.java b/examples/jms/browser/src/main/java/org/apache/activemq/jms/example/QueueBrowserExample.java index 52e7fe19d9..729ea8d470 100644 --- a/examples/jms/browser/src/main/java/org/apache/activemq/jms/example/QueueBrowserExample.java +++ b/examples/jms/browser/src/main/java/org/apache/activemq/jms/example/QueueBrowserExample.java @@ -52,7 +52,7 @@ public class QueueBrowserExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/browser/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/browser/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/browser/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/browser/src/main/resources/activemq/server0/activemq-configuration.xml index aee59c8602..7939debfbb 100644 --- a/examples/jms/browser/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/browser/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/browser/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/browser/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/browser/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/browser/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/browser/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/browser/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/browser/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/browser/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/perf/src/main/resources/client.jndi.properties b/examples/jms/browser/src/main/resources/jndi.properties similarity index 50% rename from examples/jms/perf/src/main/resources/client.jndi.properties rename to examples/jms/browser/src/main/resources/jndi.properties index 6940f75d77..d9b5c6ae23 100644 --- a/examples/jms/perf/src/main/resources/client.jndi.properties +++ b/examples/jms/browser/src/main/resources/jndi.properties @@ -1,2 +1,3 @@ java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory -java.naming.provider.url=tcp://localhost:5445 \ No newline at end of file +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/client-kickoff/pom.xml b/examples/jms/client-kickoff/pom.xml index 3e0a2ed974..fb79158df5 100644 --- a/examples/jms/client-kickoff/pom.xml +++ b/examples/jms/client-kickoff/pom.xml @@ -125,7 +125,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/client-kickoff/src/main/java/org/apache/activemq/jms/example/ClientKickoffExample.java b/examples/jms/client-kickoff/src/main/java/org/apache/activemq/jms/example/ClientKickoffExample.java index 80957f754a..c9864c378a 100644 --- a/examples/jms/client-kickoff/src/main/java/org/apache/activemq/jms/example/ClientKickoffExample.java +++ b/examples/jms/client-kickoff/src/main/java/org/apache/activemq/jms/example/ClientKickoffExample.java @@ -57,7 +57,7 @@ public class ClientKickoffExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perform a lookup on the Connection Factory QueueConnectionFactory cf = (QueueConnectionFactory)initialContext.lookup("ConnectionFactory"); diff --git a/examples/jms/client-kickoff/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/client-kickoff/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 81% rename from examples/jms/client-kickoff/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/client-kickoff/src/main/resources/activemq/server0/activemq-configuration.xml index df1ebc8e5b..b2cbb37989 100644 --- a/examples/jms/client-kickoff/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/client-kickoff/src/main/resources/activemq/server0/activemq-configuration.xml @@ -12,13 +12,6 @@ true - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/client-kickoff/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/client-kickoff/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/client-kickoff/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/client-kickoff/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/client-kickoff/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/client-kickoff/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/client-kickoff/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/client-kickoff/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/clustered-jgroups/src/main/resources/hornetq/server0/client-jndi.properties b/examples/jms/client-kickoff/src/main/resources/jndi.properties similarity index 100% rename from examples/jms/clustered-jgroups/src/main/resources/hornetq/server0/client-jndi.properties rename to examples/jms/client-kickoff/src/main/resources/jndi.properties diff --git a/examples/jms/client-side-failoverlistener/pom.xml b/examples/jms/client-side-failoverlistener/pom.xml index 402cced9bc..bbc4b680ca 100644 --- a/examples/jms/client-side-failoverlistener/pom.xml +++ b/examples/jms/client-side-failoverlistener/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -55,9 +55,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -79,10 +77,6 @@ org.apache.activemq.jms.example.ClientSideFailoverListerExample - - tcp://localhost:5445 - tcp://localhost:5446 - exampleConfigDir @@ -97,7 +91,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -106,7 +100,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/client-side-failoverlistener/readme.html b/examples/jms/client-side-failoverlistener/readme.html index 6f8f0737a6..eee1da419e 100644 --- a/examples/jms/client-side-failoverlistener/readme.html +++ b/examples/jms/client-side-failoverlistener/readme.html @@ -11,7 +11,7 @@

This example demonstrates how you can listen on failover event on the client side.

In this example there are two nodes running in a cluster, both server will be running for start, - but after a while the first server will crash. This will trigger an fail oever event.

+ but after a while the first server will crash. This will trigger an fail-over event.

Example step-by-step

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

diff --git a/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/jms/example/ClientSideFailoverListerExample.java b/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/jms/example/ClientSideFailoverListerExample.java index 46b7b631c4..07f2fe82d6 100644 --- a/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/jms/example/ClientSideFailoverListerExample.java +++ b/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/jms/example/ClientSideFailoverListerExample.java @@ -55,7 +55,7 @@ public class ClientSideFailoverListerExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from server 0 - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look-up the JMS Queue object from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/jndi.properties b/examples/jms/client-side-failoverlistener/src/main/resources/jndi.properties new file mode 100644 index 0000000000..4aa3c294af --- /dev/null +++ b/examples/jms/client-side-failoverlistener/src/main/resources/jndi.properties @@ -0,0 +1,7 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue +connection.ConnectionFactory.ha=true +connection.ConnectionFactory.retryInterval=1000 +connection.ConnectionFactory.retryIntervalMultiplier=1.0 +connection.ConnectionFactory.reconnectAttempts=-1 \ No newline at end of file diff --git a/examples/jms/client-side-load-balancing/pom.xml b/examples/jms/client-side-load-balancing/pom.xml index 9ce2b28046..2ef08c4b9e 100644 --- a/examples/jms/client-side-load-balancing/pom.xml +++ b/examples/jms/client-side-load-balancing/pom.xml @@ -36,16 +36,12 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory ${basedir}/target/ - - udp-address - ${udp-address} - @@ -55,9 +51,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -77,19 +71,13 @@ start - 1299 - 1298 - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 true build.directory ${basedir}/target/ - - udp-address - ${udp-address} - @@ -100,10 +88,6 @@ org.apache.activemq.jms.example.ClientSideLoadBalancingExample - - tcp://localhost:5445 - tcp://localhost:5446 - exampleConfigDir @@ -118,7 +102,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -127,7 +111,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 @@ -136,7 +120,7 @@ stop - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 diff --git a/examples/jms/client-side-load-balancing/src/main/java/org/apache/activemq/jms/example/ClientSideLoadBalancingExample.java b/examples/jms/client-side-load-balancing/src/main/java/org/apache/activemq/jms/example/ClientSideLoadBalancingExample.java index be1895a94f..15361074ef 100644 --- a/examples/jms/client-side-load-balancing/src/main/java/org/apache/activemq/jms/example/ClientSideLoadBalancingExample.java +++ b/examples/jms/client-side-load-balancing/src/main/java/org/apache/activemq/jms/example/ClientSideLoadBalancingExample.java @@ -56,7 +56,7 @@ public class ClientSideLoadBalancingExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from server 0 - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look-up the JMS Queue object from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/client-side-load-balancing/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/client-side-load-balancing/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/client-side-load-balancing/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/client-side-load-balancing/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/client-side-load-balancing/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/client-side-load-balancing/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server2/activemq-configuration.xml b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/activemq-configuration.xml similarity index 100% rename from examples/jms/client-side-load-balancing/src/main/resources/hornetq/server2/activemq-configuration.xml rename to examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/activemq-configuration.xml diff --git a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server2/activemq-jms.xml b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/activemq-jms.xml similarity index 100% rename from examples/jms/client-side-load-balancing/src/main/resources/hornetq/server2/activemq-jms.xml rename to examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/activemq-jms.xml diff --git a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server2/activemq-users.xml b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/activemq-users.xml similarity index 100% rename from examples/jms/client-side-load-balancing/src/main/resources/hornetq/server2/activemq-users.xml rename to examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/activemq-users.xml diff --git a/examples/jms/topic/src/main/resources/hornetq/server0/client-jndi.properties b/examples/jms/client-side-load-balancing/src/main/resources/jndi.properties similarity index 50% rename from examples/jms/topic/src/main/resources/hornetq/server0/client-jndi.properties rename to examples/jms/client-side-load-balancing/src/main/resources/jndi.properties index 6940f75d77..3bc732f8da 100644 --- a/examples/jms/topic/src/main/resources/hornetq/server0/client-jndi.properties +++ b/examples/jms/client-side-load-balancing/src/main/resources/jndi.properties @@ -1,2 +1,3 @@ java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory -java.naming.provider.url=tcp://localhost:5445 \ No newline at end of file +java.naming.provider.url=udp://231.7.7.7:9876 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/clustered-durable-subscription/pom.xml b/examples/jms/clustered-durable-subscription/pom.xml index 73d6727a50..72290b8411 100644 --- a/examples/jms/clustered-durable-subscription/pom.xml +++ b/examples/jms/clustered-durable-subscription/pom.xml @@ -36,16 +36,12 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory ${basedir}/target/ - - udp-address - ${udp-address} - @@ -55,19 +51,13 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true build.directory ${basedir}/target/ - - udp-address - ${udp-address} - @@ -96,7 +86,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -105,7 +95,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/jms/example/ClusteredDurableSubscriptionExample.java b/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/jms/example/ClusteredDurableSubscriptionExample.java index 01d1c47747..4b39f6cb28 100644 --- a/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/jms/example/ClusteredDurableSubscriptionExample.java +++ b/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/jms/example/ClusteredDurableSubscriptionExample.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.jms.example; +import java.util.Hashtable; + import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.MessageConsumer; @@ -56,7 +58,11 @@ public class ClusteredDurableSubscriptionExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from server 0 - ic0 = getContext(0); + Hashtable properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[0]); + properties.put("topic.topic/exampleTopic", "exampleTopic"); + ic0 = new InitialContext(properties); // Step 2. Look-up the JMS Topic object from JNDI Topic topic = (Topic)ic0.lookup("topic/exampleTopic"); @@ -65,7 +71,11 @@ public class ClusteredDurableSubscriptionExample extends ActiveMQExample ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory"); // Step 4. Get an initial context for looking up JNDI from server 1 - ic1 = getContext(1); + + properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[1]); + ic1 = new InitialContext(properties); // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1 ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("ConnectionFactory"); diff --git a/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/clustered-grouping/pom.xml b/examples/jms/clustered-grouping/pom.xml index f3a3fa60d9..6448daec3a 100644 --- a/examples/jms/clustered-grouping/pom.xml +++ b/examples/jms/clustered-grouping/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -55,9 +55,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -77,9 +75,7 @@ start - 1299 - 1298 - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 true @@ -119,7 +115,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -128,7 +124,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 @@ -137,7 +133,7 @@ stop - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 diff --git a/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/jms/example/ClusteredGroupingExample.java b/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/jms/example/ClusteredGroupingExample.java index 91421cf4d6..e5ead040e3 100644 --- a/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/jms/example/ClusteredGroupingExample.java +++ b/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/jms/example/ClusteredGroupingExample.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.jms.example; +import java.util.Hashtable; + import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.MessageConsumer; @@ -58,7 +60,11 @@ public class ClusteredGroupingExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from server 0 - ic0 = getContext(0); + Hashtable properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[0]); + properties.put("queue.queue/exampleQueue", "exampleQueue"); + ic0 = new InitialContext(properties); // Step 2. Look-up the JMS Queue object from JNDI Queue queue = (Queue)ic0.lookup("queue/exampleQueue"); @@ -67,15 +73,21 @@ public class ClusteredGroupingExample extends ActiveMQExample ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory"); // Step 4. Get an initial context for looking up JNDI from server 1 - ic1 = getContext(1); + properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[1]); + ic1 = new InitialContext(properties); // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1 ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("ConnectionFactory"); - // Step 4. Get an initial context for looking up JNDI from server 1 - ic2 = getContext(2); + // Step 4. Get an initial context for looking up JNDI from server 2 + properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[2]); + ic2 = new InitialContext(properties); - // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1 + // Step 5. Look-up a JMS Connection Factory object from JNDI on server 2 ConnectionFactory cf2 = (ConnectionFactory)ic2.lookup("ConnectionFactory"); // Step 6. We create a JMS Connection connection0 which is a connection to server 0 @@ -93,7 +105,7 @@ public class ClusteredGroupingExample extends ActiveMQExample // Step 10. We create a JMS Session on server 1 Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE); - // Step 11. We create a JMS Session on server 1 + // Step 11. We create a JMS Session on server 2 Session session2 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE); // Step 12. We start the connections to ensure delivery occurs on them @@ -200,5 +212,4 @@ public class ClusteredGroupingExample extends ActiveMQExample } } } - } diff --git a/examples/jms/clustered-grouping/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/clustered-grouping/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/clustered-grouping/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/clustered-grouping/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/clustered-grouping/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/clustered-grouping/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/clustered-grouping/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/clustered-grouping/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/clustered-grouping/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/clustered-grouping/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/clustered-grouping/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/clustered-grouping/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/clustered-grouping/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/clustered-grouping/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/clustered-grouping/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/clustered-grouping/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/clustered-grouping/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/clustered-grouping/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/clustered-grouping/src/main/resources/hornetq/server2/activemq-configuration.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server2/activemq-configuration.xml similarity index 100% rename from examples/jms/clustered-grouping/src/main/resources/hornetq/server2/activemq-configuration.xml rename to examples/jms/clustered-grouping/src/main/resources/activemq/server2/activemq-configuration.xml diff --git a/examples/jms/clustered-grouping/src/main/resources/hornetq/server2/activemq-jms.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server2/activemq-jms.xml similarity index 100% rename from examples/jms/clustered-grouping/src/main/resources/hornetq/server2/activemq-jms.xml rename to examples/jms/clustered-grouping/src/main/resources/activemq/server2/activemq-jms.xml diff --git a/examples/jms/clustered-grouping/src/main/resources/hornetq/server2/activemq-users.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server2/activemq-users.xml similarity index 100% rename from examples/jms/clustered-grouping/src/main/resources/hornetq/server2/activemq-users.xml rename to examples/jms/clustered-grouping/src/main/resources/activemq/server2/activemq-users.xml diff --git a/examples/jms/clustered-jgroups/pom.xml b/examples/jms/clustered-jgroups/pom.xml index aca8a25a3f..c4dc5bbe65 100644 --- a/examples/jms/clustered-jgroups/pom.xml +++ b/examples/jms/clustered-jgroups/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -53,9 +53,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true - diff --git a/examples/jms/clustered-standalone/src/main/resources/hornetq/server2/activemq-users.xml b/examples/jms/clustered-standalone/src/main/resources/activemq/server2/activemq-users.xml similarity index 100% rename from examples/jms/clustered-standalone/src/main/resources/hornetq/server2/activemq-users.xml rename to examples/jms/clustered-standalone/src/main/resources/activemq/server2/activemq-users.xml diff --git a/examples/jms/clustered-static-discovery/pom.xml b/examples/jms/clustered-static-discovery/pom.xml index 5245a17724..b1dd84709d 100644 --- a/examples/jms/clustered-static-discovery/pom.xml +++ b/examples/jms/clustered-static-discovery/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -45,9 +45,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -57,9 +55,7 @@ start - 1299 - 1298 - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 true @@ -69,9 +65,7 @@ start - 1399 - 1398 - ${basedir}/target/classes/activemq/server3 + ${basedir}/target/classes/activemq/server3 true @@ -102,7 +96,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -111,7 +105,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 @@ -120,7 +114,7 @@ stop - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 @@ -129,7 +123,7 @@ stop - ${basedir}/target/classes/activemq/server3 + ${basedir}/target/classes/activemq/server3 diff --git a/examples/jms/clustered-static-discovery/src/main/java/org/apache/activemq/jms/example/StaticClusteredQueueExample.java b/examples/jms/clustered-static-discovery/src/main/java/org/apache/activemq/jms/example/StaticClusteredQueueExample.java index 868d611a28..f724c92683 100644 --- a/examples/jms/clustered-static-discovery/src/main/java/org/apache/activemq/jms/example/StaticClusteredQueueExample.java +++ b/examples/jms/clustered-static-discovery/src/main/java/org/apache/activemq/jms/example/StaticClusteredQueueExample.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.jms.example; +import java.util.Hashtable; + import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.MessageConsumer; @@ -57,8 +59,12 @@ public class StaticClusteredQueueExample extends ActiveMQExample try { - // Step 1. Get an initial context for looking up JNDI from server 0 - ic0 = getContext(3); + // Step 1. Get an initial context for looking up JNDI from server 3 + Hashtable properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[3]); + properties.put("queue.queue/exampleQueue", "exampleQueue"); + ic0 = new InitialContext(properties); // Step 2. Look-up the JMS Queue object from JNDI Queue queue = (Queue)ic0.lookup("queue/exampleQueue"); diff --git a/examples/jms/clustered-static-discovery/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/clustered-static-discovery/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/clustered-static-discovery/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/clustered-static-discovery/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/clustered-static-discovery/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/clustered-static-discovery/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/clustered-static-discovery/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/clustered-static-discovery/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/clustered-static-discovery/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/clustered-static-discovery/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/clustered-static-discovery/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/clustered-static-discovery/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/clustered-static-discovery/src/main/resources/hornetq/server2/activemq-configuration.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/activemq-configuration.xml similarity index 100% rename from examples/jms/clustered-static-discovery/src/main/resources/hornetq/server2/activemq-configuration.xml rename to examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/activemq-configuration.xml diff --git a/examples/jms/clustered-static-discovery/src/main/resources/hornetq/server2/activemq-jms.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/activemq-jms.xml similarity index 100% rename from examples/jms/clustered-static-discovery/src/main/resources/hornetq/server2/activemq-jms.xml rename to examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/activemq-jms.xml diff --git a/examples/jms/clustered-static-discovery/src/main/resources/hornetq/server2/activemq-users.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/activemq-users.xml similarity index 100% rename from examples/jms/clustered-static-discovery/src/main/resources/hornetq/server2/activemq-users.xml rename to examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/activemq-users.xml diff --git a/examples/jms/clustered-static-discovery/src/main/resources/hornetq/server3/activemq-configuration.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/activemq-configuration.xml similarity index 100% rename from examples/jms/clustered-static-discovery/src/main/resources/hornetq/server3/activemq-configuration.xml rename to examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/activemq-configuration.xml diff --git a/examples/jms/clustered-static-discovery/src/main/resources/hornetq/server3/activemq-jms.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/activemq-jms.xml similarity index 100% rename from examples/jms/clustered-static-discovery/src/main/resources/hornetq/server3/activemq-jms.xml rename to examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/activemq-jms.xml diff --git a/examples/jms/clustered-static-discovery/src/main/resources/hornetq/server3/activemq-users.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/activemq-users.xml similarity index 100% rename from examples/jms/clustered-static-discovery/src/main/resources/hornetq/server3/activemq-users.xml rename to examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/activemq-users.xml diff --git a/examples/jms/clustered-static-oneway/pom.xml b/examples/jms/clustered-static-oneway/pom.xml index 0722ddf1c6..fc672cb934 100644 --- a/examples/jms/clustered-static-oneway/pom.xml +++ b/examples/jms/clustered-static-oneway/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -45,9 +45,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -57,9 +55,7 @@ start - 1299 - 1298 - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 true @@ -89,7 +85,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -98,7 +94,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 @@ -107,7 +103,7 @@ stop - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 diff --git a/examples/jms/clustered-static-oneway/src/main/java/org/apache/activemq/jms/example/ClusterStaticOnewayExample.java b/examples/jms/clustered-static-oneway/src/main/java/org/apache/activemq/jms/example/ClusterStaticOnewayExample.java index 2eab7aee88..c88d2e4135 100644 --- a/examples/jms/clustered-static-oneway/src/main/java/org/apache/activemq/jms/example/ClusterStaticOnewayExample.java +++ b/examples/jms/clustered-static-oneway/src/main/java/org/apache/activemq/jms/example/ClusterStaticOnewayExample.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.jms.example; +import java.util.Hashtable; + import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.MessageConsumer; @@ -56,7 +58,11 @@ public class ClusterStaticOnewayExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from server 0 - ic0 = getContext(0); + Hashtable properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[0]); + properties.put("queue.queue/exampleQueue", "exampleQueue"); + ic0 = new InitialContext(properties); // Step 2. Look-up the JMS Queue object from JNDI Queue queue = (Queue)ic0.lookup("queue/exampleQueue"); diff --git a/examples/jms/clustered-static-oneway/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/clustered-static-oneway/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/clustered-static-oneway/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/clustered-static-oneway/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/clustered-static-oneway/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/clustered-static-oneway/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/clustered-static-oneway/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/clustered-static-oneway/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/clustered-static-oneway/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/clustered-static-oneway/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/clustered-static-oneway/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/clustered-static-oneway/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/clustered-static-oneway/src/main/resources/hornetq/server2/activemq-configuration.xml b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/activemq-configuration.xml similarity index 100% rename from examples/jms/clustered-static-oneway/src/main/resources/hornetq/server2/activemq-configuration.xml rename to examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/activemq-configuration.xml diff --git a/examples/jms/clustered-static-oneway/src/main/resources/hornetq/server2/activemq-jms.xml b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/activemq-jms.xml similarity index 100% rename from examples/jms/clustered-static-oneway/src/main/resources/hornetq/server2/activemq-jms.xml rename to examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/activemq-jms.xml diff --git a/examples/jms/clustered-static-oneway/src/main/resources/hornetq/server2/activemq-users.xml b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/activemq-users.xml similarity index 100% rename from examples/jms/clustered-static-oneway/src/main/resources/hornetq/server2/activemq-users.xml rename to examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/activemq-users.xml diff --git a/examples/jms/clustered-topic/pom.xml b/examples/jms/clustered-topic/pom.xml index 18d9fb54f0..e5a31fb0fa 100644 --- a/examples/jms/clustered-topic/pom.xml +++ b/examples/jms/clustered-topic/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -55,9 +55,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -96,7 +94,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -105,7 +103,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/clustered-topic/src/main/java/org/apache/activemq/jms/example/ClusteredTopicExample.java b/examples/jms/clustered-topic/src/main/java/org/apache/activemq/jms/example/ClusteredTopicExample.java index eb5160358f..ca98789f3a 100644 --- a/examples/jms/clustered-topic/src/main/java/org/apache/activemq/jms/example/ClusteredTopicExample.java +++ b/examples/jms/clustered-topic/src/main/java/org/apache/activemq/jms/example/ClusteredTopicExample.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.jms.example; +import java.util.Hashtable; + import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.MessageConsumer; @@ -54,7 +56,11 @@ public class ClusteredTopicExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from server 0 - ic0 = getContext(0); + Hashtable properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[0]); + properties.put("topic.topic/exampleTopic", "exampleTopic"); + ic0 = new InitialContext(properties); // Step 2. Look-up the JMS Topic object from JNDI Topic topic = (Topic)ic0.lookup("topic/exampleTopic"); @@ -63,7 +69,10 @@ public class ClusteredTopicExample extends ActiveMQExample ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory"); // Step 4. Get an initial context for looking up JNDI from server 1 - ic1 = getContext(1); + properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[1]); + ic1 = new InitialContext(properties); // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1 ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("ConnectionFactory"); diff --git a/examples/jms/clustered-topic/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/clustered-topic/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/clustered-topic/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/clustered-topic/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/clustered-topic/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/clustered-topic/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/clustered-topic/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/clustered-topic/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/clustered-topic/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/clustered-topic/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/clustered-topic/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/clustered-topic/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/clustered-topic/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/clustered-topic/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/clustered-topic/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/clustered-topic/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/clustered-topic/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/clustered-topic/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/clustered-topic/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/clustered-topic/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/clustered-topic/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/clustered-topic/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/clustered-topic/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/clustered-topic/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/colocated-failover-scale-down/pom.xml b/examples/jms/colocated-failover-scale-down/pom.xml index f128ea7bea..51e45e1841 100644 --- a/examples/jms/colocated-failover-scale-down/pom.xml +++ b/examples/jms/colocated-failover-scale-down/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 udp-address @@ -51,9 +51,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -88,7 +86,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -97,7 +95,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/colocated-failover-scale-down/src/main/java/org/apache/activemq/jms/example/ColocatedFailoverScaleDownExample.java b/examples/jms/colocated-failover-scale-down/src/main/java/org/apache/activemq/jms/example/ColocatedFailoverScaleDownExample.java index b65279b6ea..f5e5a2977b 100644 --- a/examples/jms/colocated-failover-scale-down/src/main/java/org/apache/activemq/jms/example/ColocatedFailoverScaleDownExample.java +++ b/examples/jms/colocated-failover-scale-down/src/main/java/org/apache/activemq/jms/example/ColocatedFailoverScaleDownExample.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.jms.example; +import java.util.Hashtable; + import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.MessageConsumer; @@ -54,8 +56,20 @@ public class ColocatedFailoverScaleDownExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI for both servers - initialContext1 = getContext(1); - initialContext = getContext(0); + Hashtable properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[1]); + initialContext1 = new InitialContext(properties); + + properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[0]); + properties.put("queue.queue/exampleQueue", "exampleQueue"); + properties.put("connection.ConnectionFactory.ha", true); + properties.put("connection.ConnectionFactory.retryInterval", 1000); + properties.put("connection.ConnectionFactory.retryIntervalMultiplier", 1.0); + properties.put("connection.ConnectionFactory.reconnectAttempts", -1); + initialContext = new InitialContext(properties); // Step 2. Look up the JMS resources from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/colocated-failover-scale-down/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 86% rename from examples/jms/colocated-failover-scale-down/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/activemq-configuration.xml index ce79e01e95..0c32a5ec97 100644 --- a/examples/jms/colocated-failover-scale-down/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/activemq-configuration.xml @@ -94,6 +94,17 @@
+ + + + + + + + + + +
\ No newline at end of file diff --git a/examples/jms/colocated-failover-scale-down/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/colocated-failover-scale-down/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/colocated-failover-scale-down/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/colocated-failover-scale-down/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/colocated-failover-scale-down/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 86% rename from examples/jms/colocated-failover-scale-down/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/activemq-configuration.xml index 0ee6388eee..e83e68c02b 100644 --- a/examples/jms/colocated-failover-scale-down/src/main/resources/hornetq/server1/activemq-configuration.xml +++ b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/activemq-configuration.xml @@ -95,6 +95,17 @@ + + + + + + + + + + + diff --git a/examples/jms/colocated-failover-scale-down/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/colocated-failover-scale-down/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/colocated-failover-scale-down/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/colocated-failover-scale-down/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/colocated-failover/pom.xml b/examples/jms/colocated-failover/pom.xml index 290ed90669..cec3330377 100644 --- a/examples/jms/colocated-failover/pom.xml +++ b/examples/jms/colocated-failover/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 udp-address @@ -51,9 +51,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -71,8 +69,8 @@ org.apache.activemq.jms.example.ColocatedFailoverExample - tcp://localhost:1099 - tcp://localhost:1199 + tcp://localhost:5445 + tcp://localhost:5446 @@ -88,7 +86,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -97,7 +95,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/colocated-failover/src/main/java/org/apache/activemq/jms/example/ColocatedFailoverExample.java b/examples/jms/colocated-failover/src/main/java/org/apache/activemq/jms/example/ColocatedFailoverExample.java index 29d57a6371..1e912e092f 100644 --- a/examples/jms/colocated-failover/src/main/java/org/apache/activemq/jms/example/ColocatedFailoverExample.java +++ b/examples/jms/colocated-failover/src/main/java/org/apache/activemq/jms/example/ColocatedFailoverExample.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.jms.example; +import java.util.Hashtable; + import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.MessageConsumer; @@ -52,8 +54,20 @@ public class ColocatedFailoverExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI for both servers - initialContext1 = getContext(1); - initialContext = getContext(0); + Hashtable properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[1]); + initialContext1 = new InitialContext(properties); + + properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[0]); + properties.put("queue.queue/exampleQueue", "exampleQueue"); + properties.put("connection.ConnectionFactory.ha", true); + properties.put("connection.ConnectionFactory.retryInterval", 1000); + properties.put("connection.ConnectionFactory.retryIntervalMultiplier", 1.0); + properties.put("connection.ConnectionFactory.reconnectAttempts", -1); + initialContext = new InitialContext(properties); // Step 2. Look up the JMS resources from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/colocated-failover/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/colocated-failover/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/colocated-failover/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/colocated-failover/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/colocated-failover/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/colocated-failover/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/colocated-failover/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/colocated-failover/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/colocated-failover/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/colocated-failover/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/colocated-failover/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/colocated-failover/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/colocated-failover/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/colocated-failover/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/colocated-failover/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/colocated-failover/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/colocated-failover/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/colocated-failover/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/consumer-rate-limit/pom.xml b/examples/jms/consumer-rate-limit/pom.xml index 2b955710ee..5d62a14d97 100644 --- a/examples/jms/consumer-rate-limit/pom.xml +++ b/examples/jms/consumer-rate-limit/pom.xml @@ -102,7 +102,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/consumer-rate-limit/src/main/java/org/apache/activemq/jms/example/ConsumerRateLimitExample.java b/examples/jms/consumer-rate-limit/src/main/java/org/apache/activemq/jms/example/ConsumerRateLimitExample.java index 5bb9da8dbb..4121685afc 100644 --- a/examples/jms/consumer-rate-limit/src/main/java/org/apache/activemq/jms/example/ConsumerRateLimitExample.java +++ b/examples/jms/consumer-rate-limit/src/main/java/org/apache/activemq/jms/example/ConsumerRateLimitExample.java @@ -48,7 +48,7 @@ public class ConsumerRateLimitExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/message-group/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/message-group/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-configuration.xml index 9fa4061b69..52d957087c 100644 --- a/examples/jms/message-group/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/interceptor/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/interceptor/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/consumer-rate-limit/src/main/resources/jndi.properties b/examples/jms/consumer-rate-limit/src/main/resources/jndi.properties new file mode 100644 index 0000000000..21f36b25c3 --- /dev/null +++ b/examples/jms/consumer-rate-limit/src/main/resources/jndi.properties @@ -0,0 +1,4 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.consumerMaxRate=10 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/dead-letter/pom.xml b/examples/jms/dead-letter/pom.xml index 6f7ebc896e..5035c89269 100644 --- a/examples/jms/dead-letter/pom.xml +++ b/examples/jms/dead-letter/pom.xml @@ -102,7 +102,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/dead-letter/src/main/java/org/apache/activemq/jms/example/DeadLetterExample.java b/examples/jms/dead-letter/src/main/java/org/apache/activemq/jms/example/DeadLetterExample.java index 17689558d9..d38cebe730 100644 --- a/examples/jms/dead-letter/src/main/java/org/apache/activemq/jms/example/DeadLetterExample.java +++ b/examples/jms/dead-letter/src/main/java/org/apache/activemq/jms/example/DeadLetterExample.java @@ -49,7 +49,7 @@ public class DeadLetterExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 88% rename from examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-configuration.xml index a2fd28969e..19c89b55f4 100644 --- a/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/dead-letter/src/main/resources/jndi.properties b/examples/jms/dead-letter/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d83e7317ed --- /dev/null +++ b/examples/jms/dead-letter/src/main/resources/jndi.properties @@ -0,0 +1,4 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue +queue.queue/deadLetterQueue=deadLetterQueue \ No newline at end of file diff --git a/examples/jms/delayed-redelivery/pom.xml b/examples/jms/delayed-redelivery/pom.xml index db25002aa9..ba28d9fc32 100644 --- a/examples/jms/delayed-redelivery/pom.xml +++ b/examples/jms/delayed-redelivery/pom.xml @@ -94,7 +94,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory diff --git a/examples/jms/delayed-redelivery/src/main/java/org/apache/activemq/jms/example/DelayedRedeliveryExample.java b/examples/jms/delayed-redelivery/src/main/java/org/apache/activemq/jms/example/DelayedRedeliveryExample.java index 4bfc1ca2ec..886dcff013 100644 --- a/examples/jms/delayed-redelivery/src/main/java/org/apache/activemq/jms/example/DelayedRedeliveryExample.java +++ b/examples/jms/delayed-redelivery/src/main/java/org/apache/activemq/jms/example/DelayedRedeliveryExample.java @@ -52,7 +52,7 @@ public class DelayedRedeliveryExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perform a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 87% rename from examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-configuration.xml index 5998306e4f..1b1e55ca88 100644 --- a/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/delayed-redelivery/src/main/resources/jndi.properties b/examples/jms/delayed-redelivery/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/delayed-redelivery/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/divert/pom.xml b/examples/jms/divert/pom.xml index d987365be1..8f12f9f2c4 100644 --- a/examples/jms/divert/pom.xml +++ b/examples/jms/divert/pom.xml @@ -41,7 +41,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -50,9 +50,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -81,7 +79,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -90,7 +88,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/divert/src/main/java/org/apache/activemq/jms/example/DivertExample.java b/examples/jms/divert/src/main/java/org/apache/activemq/jms/example/DivertExample.java index 94d69ef281..57e4327d99 100644 --- a/examples/jms/divert/src/main/java/org/apache/activemq/jms/example/DivertExample.java +++ b/examples/jms/divert/src/main/java/org/apache/activemq/jms/example/DivertExample.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.jms.example; +import java.util.Hashtable; + import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.Message; @@ -57,7 +59,13 @@ public class DivertExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup on the London server - initialContextLondon = getContext(0); + Hashtable properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[0]); + properties.put("queue.queue/orders", "orders"); + properties.put("topic.topic/priceUpdates", "priceUpdates"); + properties.put("topic.topic/spyTopic", "spyTopic"); + initialContextLondon = new InitialContext(properties); // Step 2. Look-up the queue orderQueue on the London server - this is the queue any orders are sent to Queue orderQueue = (Queue)initialContextLondon.lookup("queue/orders"); @@ -70,7 +78,11 @@ public class DivertExample extends ActiveMQExample Topic spyTopic = (Topic)initialContextLondon.lookup("topic/spyTopic"); // Step 6. Create an initial context to perform the JNDI lookup on the New York server - initialContextNewYork = getContext(1); + properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[1]); + properties.put("topic.topic/newYorkPriceUpdates", "newYorkPriceUpdates"); + initialContextNewYork = new InitialContext(properties); // Step 7. Look-up the topic newYorkPriceUpdates on the New York server - any price updates sent to // priceUpdates on the London server will diff --git a/examples/jms/divert/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/divert/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 93% rename from examples/jms/divert/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/divert/src/main/resources/activemq/server0/activemq-configuration.xml index da10d0ee75..3d7b7b1a8f 100644 --- a/examples/jms/divert/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/divert/src/main/resources/activemq/server0/activemq-configuration.xml @@ -16,13 +16,7 @@ - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory diff --git a/examples/jms/divert/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/divert/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/divert/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/divert/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/divert/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/divert/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/divert/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/divert/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/divert/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/divert/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 83% rename from examples/jms/divert/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/divert/src/main/resources/activemq/server1/activemq-configuration.xml index 661288fd59..1ea7a50058 100644 --- a/examples/jms/divert/src/main/resources/hornetq/server1/activemq-configuration.xml +++ b/examples/jms/divert/src/main/resources/activemq/server1/activemq-configuration.xml @@ -10,15 +10,6 @@ ${build.directory}/server1/data/messaging/paging - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - diff --git a/examples/jms/divert/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/divert/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/divert/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/divert/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/divert/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/divert/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/divert/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/divert/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/durable-subscription/pom.xml b/examples/jms/durable-subscription/pom.xml index 2149c87cdb..542a799c88 100644 --- a/examples/jms/durable-subscription/pom.xml +++ b/examples/jms/durable-subscription/pom.xml @@ -102,7 +102,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/durable-subscription/src/main/java/org/apache/activemq/jms/example/DurableSubscriptionExample.java b/examples/jms/durable-subscription/src/main/java/org/apache/activemq/jms/example/DurableSubscriptionExample.java index 792e82e88b..5c88b0161e 100644 --- a/examples/jms/durable-subscription/src/main/java/org/apache/activemq/jms/example/DurableSubscriptionExample.java +++ b/examples/jms/durable-subscription/src/main/java/org/apache/activemq/jms/example/DurableSubscriptionExample.java @@ -47,7 +47,7 @@ public class DurableSubscriptionExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look-up the JMS topic Topic topic = (Topic)initialContext.lookup("topic/exampleTopic"); diff --git a/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 86% rename from examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-configuration.xml index 017fcc00bc..b00c317d85 100644 --- a/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/durable-subscription/src/main/resources/jndi.properties b/examples/jms/durable-subscription/src/main/resources/jndi.properties new file mode 100644 index 0000000000..0468620e7f --- /dev/null +++ b/examples/jms/durable-subscription/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +topic.topic/exampleTopic=exampleTopic diff --git a/examples/jms/embedded-simple/pom.xml b/examples/jms/embedded-simple/pom.xml index 1b0130726a..df7be67126 100644 --- a/examples/jms/embedded-simple/pom.xml +++ b/examples/jms/embedded-simple/pom.xml @@ -99,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/embedded-simple/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java b/examples/jms/embedded-simple/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java index e41a025a90..05f227cdab 100644 --- a/examples/jms/embedded-simple/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java +++ b/examples/jms/embedded-simple/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java @@ -16,7 +16,9 @@ */ package org.apache.activemq.jms.example; +import java.util.ArrayList; import java.util.Date; +import java.util.List; import javax.jms.Connection; import javax.jms.ConnectionFactory; @@ -28,6 +30,8 @@ import javax.jms.TextMessage; import org.apache.activemq.common.example.ActiveMQExample; import org.apache.activemq.jms.server.embedded.EmbeddedJMS; +import org.apache.activemq.jms.server.JMSServerManager; +import org.apache.activemq.api.jms.JMSFactoryType; /** * This example demonstrates how to run a ActiveMQ embedded with JMS @@ -52,6 +56,11 @@ public class EmbeddedExample extends ActiveMQExample jmsServer.start(); System.out.println("Started Embedded JMS Server"); + JMSServerManager jmsServerManager = jmsServer.getJMSServerManager(); + jmsServerManager.addQueueToJndi("exampleQueue", "queue/exampleQueue"); + List connectors = new ArrayList(); + connectors.add("in-vm"); + jmsServerManager.createConnectionFactory("ConnectionFactory", false, JMSFactoryType.CF, connectors, "ConnectionFactory"); ConnectionFactory cf = (ConnectionFactory)jmsServer.lookup("ConnectionFactory"); Queue queue = (Queue)jmsServer.lookup("queue/exampleQueue"); diff --git a/examples/jms/embedded-simple/src/main/resources/activemq-configuration.xml b/examples/jms/embedded-simple/src/main/resources/activemq-configuration.xml index 7e86c388c6..2db2db3f71 100644 --- a/examples/jms/embedded-simple/src/main/resources/activemq-configuration.xml +++ b/examples/jms/embedded-simple/src/main/resources/activemq-configuration.xml @@ -3,13 +3,6 @@ xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd"> false - - - - - org.apache.activemq.core.remoting.impl.invm.InVMConnectorFactory - - diff --git a/examples/jms/embedded/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java b/examples/jms/embedded/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java index 06fdb14b45..a89c7b4708 100644 --- a/examples/jms/embedded/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java +++ b/examples/jms/embedded/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java @@ -81,11 +81,17 @@ public final class EmbeddedExample extends ActiveMQExample // Step 3. Configure the JMS ConnectionFactory ArrayList connectorNames = new ArrayList(); connectorNames.add("connector"); - ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl("cf", false, connectorNames, "/cf"); + ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl() + .setName("cf") + .setConnectorNames(connectorNames) + .setBindings("cf"); jmsConfig.getConnectionFactoryConfigurations().add(cfConfig); // Step 4. Configure the JMS Queue - JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl("queue1", null, false, "queue/queue1"); + JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl() + .setName("queue1") + .setDurable(false) + .setBindings("queue/queue1"); jmsConfig.getQueueConfigurations().add(queueConfig); // Step 5. Start the JMS Server using the ActiveMQ core server and the JMS configuration @@ -96,7 +102,7 @@ public final class EmbeddedExample extends ActiveMQExample System.out.println("Started Embedded JMS Server"); // Step 6. Lookup JMS resources defined in the configuration - ConnectionFactory cf = (ConnectionFactory)jmsServer.lookup("/cf"); + ConnectionFactory cf = (ConnectionFactory)jmsServer.lookup("cf"); Queue queue = (Queue)jmsServer.lookup("queue/queue1"); // Step 7. Send and receive a message using JMS API diff --git a/examples/jms/expiry/pom.xml b/examples/jms/expiry/pom.xml index 70fc1add13..a437a317fb 100644 --- a/examples/jms/expiry/pom.xml +++ b/examples/jms/expiry/pom.xml @@ -102,7 +102,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/expiry/src/main/java/org/apache/activemq/jms/example/ExpiryExample.java b/examples/jms/expiry/src/main/java/org/apache/activemq/jms/example/ExpiryExample.java index a74467c76e..02e3963101 100644 --- a/examples/jms/expiry/src/main/java/org/apache/activemq/jms/example/ExpiryExample.java +++ b/examples/jms/expiry/src/main/java/org/apache/activemq/jms/example/ExpiryExample.java @@ -48,7 +48,7 @@ public class ExpiryExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/expiry/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/expiry/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 87% rename from examples/jms/expiry/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/expiry/src/main/resources/activemq/server0/activemq-configuration.xml index 7e442351c1..7c2c527c83 100644 --- a/examples/jms/expiry/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/expiry/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,15 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/expiry/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/expiry/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/expiry/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/expiry/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/expiry/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/expiry/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/expiry/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/expiry/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/expiry/src/main/resources/jndi.properties b/examples/jms/expiry/src/main/resources/jndi.properties new file mode 100644 index 0000000000..065794b581 --- /dev/null +++ b/examples/jms/expiry/src/main/resources/jndi.properties @@ -0,0 +1,4 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue +queue.queue/expiryQueue=expiryQueue diff --git a/examples/jms/ha-policy-autobackup/pom.xml b/examples/jms/ha-policy-autobackup/pom.xml index 86f5d4724a..1056602b71 100644 --- a/examples/jms/ha-policy-autobackup/pom.xml +++ b/examples/jms/ha-policy-autobackup/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 udp-address @@ -53,7 +53,7 @@ 1199 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -88,7 +88,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -97,7 +97,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/ha-policy-autobackup/src/main/java/org/apache/activemq/jms/example/HAPolicyAutoBackupExample.java b/examples/jms/ha-policy-autobackup/src/main/java/org/apache/activemq/jms/example/HAPolicyAutoBackupExample.java index 3eebb40ba7..4fbcdcb8e1 100644 --- a/examples/jms/ha-policy-autobackup/src/main/java/org/apache/activemq/jms/example/HAPolicyAutoBackupExample.java +++ b/examples/jms/ha-policy-autobackup/src/main/java/org/apache/activemq/jms/example/HAPolicyAutoBackupExample.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.jms.example; +import java.util.Hashtable; + import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.MessageConsumer; @@ -63,8 +65,24 @@ public class HAPolicyAutoBackupExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from server 0 and 1 - ic0 = getContext(0); - ic1 = getContext(1); + Hashtable properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[0]); + properties.put("queue.queue/exampleQueue", "exampleQueue"); + properties.put("connection.ConnectionFactory.ha", true); + properties.put("connection.ConnectionFactory.retryInterval", 1000); + properties.put("connection.ConnectionFactory.retryIntervalMultiplier", 1.0); + properties.put("connection.ConnectionFactory.reconnectAttempts", -1); + ic0 = new InitialContext(properties); + + properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[1]); + properties.put("connection.ConnectionFactory.ha", true); + properties.put("connection.ConnectionFactory.retryInterval", 1000); + properties.put("connection.ConnectionFactory.retryIntervalMultiplier", 1.0); + properties.put("connection.ConnectionFactory.reconnectAttempts", -1); + ic1 = new InitialContext(properties); // Step 2. Look-up the JMS Queue object from JNDI Queue queue = (Queue) ic0.lookup("queue/exampleQueue"); diff --git a/examples/jms/ha-policy-autobackup/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/ha-policy-autobackup/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/ha-policy-autobackup/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/ha-policy-autobackup/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/ha-policy-autobackup/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/ha-policy-autobackup/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/ha-policy-autobackup/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/ha-policy-autobackup/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/http-transport/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/http-transport/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/ha-policy-autobackup/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/ha-policy-autobackup/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/http-transport/pom.xml b/examples/jms/http-transport/pom.xml index 24a5f541a6..9bc6c63a14 100644 --- a/examples/jms/http-transport/pom.xml +++ b/examples/jms/http-transport/pom.xml @@ -102,7 +102,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory diff --git a/examples/jms/http-transport/src/main/java/org/apache/activemq/jms/example/HttpTransportExample.java b/examples/jms/http-transport/src/main/java/org/apache/activemq/jms/example/HttpTransportExample.java index efba974ca6..914c017ef5 100644 --- a/examples/jms/http-transport/src/main/java/org/apache/activemq/jms/example/HttpTransportExample.java +++ b/examples/jms/http-transport/src/main/java/org/apache/activemq/jms/example/HttpTransportExample.java @@ -47,7 +47,7 @@ public class HttpTransportExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/large-message/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/http-transport/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/large-message/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/http-transport/src/main/resources/activemq/server0/activemq-configuration.xml index 9fa4061b69..5bc2739a41 100644 --- a/examples/jms/large-message/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/http-transport/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,19 +9,13 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + diff --git a/examples/jms/last-value-queue/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/http-transport/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/last-value-queue/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/http-transport/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/http-transport/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/http-transport/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/http-transport/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/http-transport/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/http-transport/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/http-transport/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index 61eab50823..0000000000 --- a/examples/jms/http-transport/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - - - - - - - - - - - - - - - diff --git a/examples/jms/http-transport/src/main/resources/jndi.properties b/examples/jms/http-transport/src/main/resources/jndi.properties new file mode 100644 index 0000000000..fee3aac951 --- /dev/null +++ b/examples/jms/http-transport/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:8080?http-enabled=true +queue.queue/exampleQueue=exampleQueue diff --git a/examples/jms/instantiate-connection-factory/pom.xml b/examples/jms/instantiate-connection-factory/pom.xml index 4b60d79f1a..bb9f409d72 100644 --- a/examples/jms/instantiate-connection-factory/pom.xml +++ b/examples/jms/instantiate-connection-factory/pom.xml @@ -112,7 +112,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/activemq-configuration.xml index daab0a32ab..afaec1c259 100644 --- a/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,19 +9,12 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + diff --git a/examples/jms/instantiate-connection-factory/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/activemq-jms.xml similarity index 73% rename from examples/jms/instantiate-connection-factory/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/activemq-jms.xml index d05e31ef8e..9dd800b679 100644 --- a/examples/jms/instantiate-connection-factory/src/main/resources/hornetq/server0/activemq-jms.xml +++ b/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/activemq-jms.xml @@ -3,8 +3,6 @@ xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - - - + diff --git a/examples/jms/instantiate-connection-factory/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/instantiate-connection-factory/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/instantiate-connection-factory/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/instantiate-connection-factory/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index 1cb9416a19..0000000000 --- a/examples/jms/instantiate-connection-factory/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - - - - - - - - - - - - - - - diff --git a/examples/jms/interceptor/pom.xml b/examples/jms/interceptor/pom.xml index 34dff8ce6f..5ff60f53d9 100644 --- a/examples/jms/interceptor/pom.xml +++ b/examples/jms/interceptor/pom.xml @@ -107,7 +107,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/interceptor/src/main/java/org/apache/activemq/jms/example/InterceptorExample.java b/examples/jms/interceptor/src/main/java/org/apache/activemq/jms/example/InterceptorExample.java index e2b2b40b0e..70f0231598 100644 --- a/examples/jms/interceptor/src/main/java/org/apache/activemq/jms/example/InterceptorExample.java +++ b/examples/jms/interceptor/src/main/java/org/apache/activemq/jms/example/InterceptorExample.java @@ -47,7 +47,7 @@ public class InterceptorExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perform a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/interceptor/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/interceptor/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 87% rename from examples/jms/interceptor/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/interceptor/src/main/resources/activemq/server0/activemq-configuration.xml index 24333604ba..e9dabca135 100644 --- a/examples/jms/interceptor/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/interceptor/src/main/resources/activemq/server0/activemq-configuration.xml @@ -14,14 +14,6 @@ org.apache.activemq.jms.example.SimpleInterceptor - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/jaas/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/interceptor/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/jaas/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/interceptor/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/interceptor/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/interceptor/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/interceptor/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/interceptor/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/interceptor/src/main/resources/jndi.properties b/examples/jms/interceptor/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/interceptor/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/jaas/pom.xml b/examples/jms/jaas/pom.xml index 1ce345b7eb..a6ba21cec7 100644 --- a/examples/jms/jaas/pom.xml +++ b/examples/jms/jaas/pom.xml @@ -39,7 +39,6 @@ org.apache.activemq activemq-maven-plugin - 1.1.0 start @@ -125,7 +124,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/jaas/src/main/java/org/apache/activemq/jms/example/JAASExample.java b/examples/jms/jaas/src/main/java/org/apache/activemq/jms/example/JAASExample.java index 7813924086..be797d19be 100644 --- a/examples/jms/jaas/src/main/java/org/apache/activemq/jms/example/JAASExample.java +++ b/examples/jms/jaas/src/main/java/org/apache/activemq/jms/example/JAASExample.java @@ -48,7 +48,7 @@ public class JAASExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/message-group2/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/jaas/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/message-group2/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/jaas/src/main/resources/activemq/server0/activemq-configuration.xml index 9fa4061b69..52d957087c 100644 --- a/examples/jms/message-group2/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/jaas/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/jms-auto-closeable/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/jaas/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/jms-auto-closeable/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/jaas/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/jaas/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/jaas/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index e0acd1deea..0000000000 --- a/examples/jms/jaas/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - - - - - - - - - - - - - - diff --git a/examples/jms/jaas/src/main/resources/jndi.properties b/examples/jms/jaas/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/jaas/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/jms-auto-closeable/pom.xml b/examples/jms/jms-auto-closeable/pom.xml index d0c49da6f7..084ddf98f2 100644 --- a/examples/jms/jms-auto-closeable/pom.xml +++ b/examples/jms/jms-auto-closeable/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.JMSAutoCloseableExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/jms-auto-closeable/src/main/java/org/apache/activemq/jms/example/JMSAutoCloseableExample.java b/examples/jms/jms-auto-closeable/src/main/java/org/apache/activemq/jms/example/JMSAutoCloseableExample.java index d83277103d..646fdeb8a6 100644 --- a/examples/jms/jms-auto-closeable/src/main/java/org/apache/activemq/jms/example/JMSAutoCloseableExample.java +++ b/examples/jms/jms-auto-closeable/src/main/java/org/apache/activemq/jms/example/JMSAutoCloseableExample.java @@ -40,7 +40,7 @@ public class JMSAutoCloseableExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/jms-auto-closeable/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/jms-auto-closeable/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/activemq-configuration.xml index 9ff5b8ac18..0d65f6944b 100644 --- a/examples/jms/jms-auto-closeable/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,15 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/jms-completion-listener/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/jms-completion-listener/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/jms-auto-closeable/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/jms-auto-closeable/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/jms-auto-closeable/src/main/resources/jndi.properties b/examples/jms/jms-auto-closeable/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/jms-auto-closeable/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/jms-bridge/pom.xml b/examples/jms/jms-bridge/pom.xml index f014b5bc07..67ca1ea7a0 100644 --- a/examples/jms/jms-bridge/pom.xml +++ b/examples/jms/jms-bridge/pom.xml @@ -45,7 +45,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -54,9 +54,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -85,7 +83,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -94,7 +92,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/jms-bridge/src/main/java/org/apache/activemq/jms/example/JMSBridgeExample.java b/examples/jms/jms-bridge/src/main/java/org/apache/activemq/jms/example/JMSBridgeExample.java index 01262517ca..f6ff686c36 100644 --- a/examples/jms/jms-bridge/src/main/java/org/apache/activemq/jms/example/JMSBridgeExample.java +++ b/examples/jms/jms-bridge/src/main/java/org/apache/activemq/jms/example/JMSBridgeExample.java @@ -66,8 +66,8 @@ public class JMSBridgeExample // Step 2. Create and start a JMS Bridge // Note, the Bridge needs a transaction manager, in this instance we will use the JBoss TM JMSBridge jmsBridge = new JMSBridgeImpl( - new JNDIConnectionFactoryFactory(sourceJndiParams, "source/ConnectionFactory"), - new JNDIConnectionFactoryFactory(targetJndiParams, "target/ConnectionFactory"), + new JNDIConnectionFactoryFactory(sourceJndiParams, "ConnectionFactory"), + new JNDIConnectionFactoryFactory(targetJndiParams, "ConnectionFactory"), new JNDIDestinationFactory(sourceJndiParams, "source/topic"), new JNDIDestinationFactory(targetJndiParams, "target/queue"), null, @@ -91,8 +91,8 @@ public class JMSBridgeExample { jmsBridge.start(); // Step 3. Lookup the *source* JMS resources - ConnectionFactory sourceConnectionFactory = (ConnectionFactory)sourceContext.lookup("/client/ConnectionFactory"); - Topic sourceTopic = (Topic)sourceContext.lookup("/source/topic"); + ConnectionFactory sourceConnectionFactory = (ConnectionFactory)sourceContext.lookup("ConnectionFactory"); + Topic sourceTopic = (Topic)sourceContext.lookup("source/topic"); // Step 4. Create a connection, a session and a message producer for the *source* topic sourceConnection = sourceConnectionFactory.createConnection(); @@ -111,7 +111,7 @@ public class JMSBridgeExample sourceConnection.close(); // Step 7. Lookup the *target* JMS resources - ConnectionFactory targetConnectionFactory = (ConnectionFactory)targetContext.lookup("client/ConnectionFactory"); + ConnectionFactory targetConnectionFactory = (ConnectionFactory)targetContext.lookup("ConnectionFactory"); Queue targetQueue = (Queue)targetContext.lookup("target/queue"); // Step 8. Create a connection, a session and a message consumer for the *target* queue @@ -169,6 +169,8 @@ public class JMSBridgeExample Hashtable jndiProps = new Hashtable(); jndiProps.put("java.naming.provider.url", server); jndiProps.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + jndiProps.put("queue.target/queue", "target"); + jndiProps.put("topic.source/topic", "topic"); return jndiProps; } } diff --git a/examples/jms/jms-bridge/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/jms-bridge/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 82% rename from examples/jms/jms-bridge/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/jms-bridge/src/main/resources/activemq/server0/activemq-configuration.xml index 44d57f7059..b1a240c2e7 100644 --- a/examples/jms/jms-bridge/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/jms-bridge/src/main/resources/activemq/server0/activemq-configuration.xml @@ -10,13 +10,6 @@ ${build.directory}/server0/data/messaging/paging - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory diff --git a/examples/jms/jms-bridge/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/jms-bridge/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/jms-bridge/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/jms-bridge/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/jms-bridge/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/jms-bridge/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/jms-bridge/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/jms-bridge/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/jms-bridge/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/jms-bridge/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 74% rename from examples/jms/jms-bridge/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/jms-bridge/src/main/resources/activemq/server1/activemq-configuration.xml index 47e2d2fc01..6240fb1692 100644 --- a/examples/jms/jms-bridge/src/main/resources/hornetq/server1/activemq-configuration.xml +++ b/examples/jms/jms-bridge/src/main/resources/activemq/server1/activemq-configuration.xml @@ -10,17 +10,6 @@ ${build.directory}/server1/data/messaging/paging - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory diff --git a/examples/jms/jms-bridge/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/jms-bridge/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/jms-bridge/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/jms-bridge/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/jms-completion-listener/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/jms-bridge/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/jms-completion-listener/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/jms-bridge/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/jms-completion-listener/pom.xml b/examples/jms/jms-completion-listener/pom.xml index c7909ab498..beb47d21ec 100644 --- a/examples/jms/jms-completion-listener/pom.xml +++ b/examples/jms/jms-completion-listener/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.JMSCompletionListenerExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/jms-completion-listener/src/main/java/org/apache/activemq/jms/example/JMSCompletionListenerExample.java b/examples/jms/jms-completion-listener/src/main/java/org/apache/activemq/jms/example/JMSCompletionListenerExample.java index fdb66fe198..af5b13d769 100644 --- a/examples/jms/jms-completion-listener/src/main/java/org/apache/activemq/jms/example/JMSCompletionListenerExample.java +++ b/examples/jms/jms-completion-listener/src/main/java/org/apache/activemq/jms/example/JMSCompletionListenerExample.java @@ -49,7 +49,7 @@ public class JMSCompletionListenerExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/jms-completion-listener/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/jms-completion-listener/src/main/resources/activemq/server0/activemq-configuration.xml new file mode 100644 index 0000000000..52d957087c --- /dev/null +++ b/examples/jms/jms-completion-listener/src/main/resources/activemq/server0/activemq-configuration.xml @@ -0,0 +1,34 @@ + + + ${build.directory}/server0/data/messaging/bindings + + ${build.directory}/server0/data/messaging/journal + + ${build.directory}/server0/data/messaging/largemessages + + ${build.directory}/server0/data/messaging/paging + + + + + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + + + + + + + + + + + + + + + + + + diff --git a/examples/jms/large-message/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/jms-completion-listener/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/large-message/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/jms-completion-listener/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/jms-context/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/jms-completion-listener/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/jms-context/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/jms-completion-listener/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/jms-completion-listener/src/main/resources/jndi.properties b/examples/jms/jms-completion-listener/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/jms-completion-listener/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/jms-context/pom.xml b/examples/jms/jms-context/pom.xml index 8371058240..1283603fcb 100644 --- a/examples/jms/jms-context/pom.xml +++ b/examples/jms/jms-context/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.JMSContextExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/jms-context/src/main/java/org/apache/activemq/jms/example/JMSContextExample.java b/examples/jms/jms-context/src/main/java/org/apache/activemq/jms/example/JMSContextExample.java index 9a78e7c400..616574baca 100644 --- a/examples/jms/jms-context/src/main/java/org/apache/activemq/jms/example/JMSContextExample.java +++ b/examples/jms/jms-context/src/main/java/org/apache/activemq/jms/example/JMSContextExample.java @@ -44,7 +44,7 @@ public class JMSContextExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/jms-context/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/jms-context/src/main/resources/activemq/server0/activemq-configuration.xml new file mode 100644 index 0000000000..52d957087c --- /dev/null +++ b/examples/jms/jms-context/src/main/resources/activemq/server0/activemq-configuration.xml @@ -0,0 +1,34 @@ + + + ${build.directory}/server0/data/messaging/bindings + + ${build.directory}/server0/data/messaging/journal + + ${build.directory}/server0/data/messaging/largemessages + + ${build.directory}/server0/data/messaging/paging + + + + + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + + + + + + + + + + + + + + + + + + diff --git a/examples/jms/management/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/jms-context/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/management/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/jms-context/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/jms-shared-consumer/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/jms-context/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/jms-shared-consumer/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/jms-context/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/jms-context/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/jms-context/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index e0acd1deea..0000000000 --- a/examples/jms/jms-context/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - - - - - - - - - - - - - - diff --git a/examples/jms/jms-context/src/main/resources/jndi.properties b/examples/jms/jms-context/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/jms-context/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/jms-shared-consumer/pom.xml b/examples/jms/jms-shared-consumer/pom.xml index c59597abed..9e9bcee28c 100644 --- a/examples/jms/jms-shared-consumer/pom.xml +++ b/examples/jms/jms-shared-consumer/pom.xml @@ -102,7 +102,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/jms-shared-consumer/src/main/java/org/apache/activemq/jms/example/JMSSharedConsumerExample.java b/examples/jms/jms-shared-consumer/src/main/java/org/apache/activemq/jms/example/JMSSharedConsumerExample.java index 70c8ec5b38..23d72ca757 100644 --- a/examples/jms/jms-shared-consumer/src/main/java/org/apache/activemq/jms/example/JMSSharedConsumerExample.java +++ b/examples/jms/jms-shared-consumer/src/main/java/org/apache/activemq/jms/example/JMSSharedConsumerExample.java @@ -52,7 +52,7 @@ public class JMSSharedConsumerExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Topic topic = (Topic) initialContext.lookup("topic/exampleTopic"); diff --git a/examples/jms/jms-shared-consumer/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/jms-shared-consumer/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/jms-shared-consumer/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/jms-shared-consumer/src/main/resources/activemq/server0/activemq-configuration.xml index e83d7a443d..b3db2a68e7 100644 --- a/examples/jms/jms-shared-consumer/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/jms-shared-consumer/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,15 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/jms-shared-consumer/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/jms-shared-consumer/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/jms-shared-consumer/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/jms-shared-consumer/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/jmx/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/jms-shared-consumer/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/jmx/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/jms-shared-consumer/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/jms-shared-consumer/src/main/resources/jndi.properties b/examples/jms/jms-shared-consumer/src/main/resources/jndi.properties new file mode 100644 index 0000000000..4faa7906e4 --- /dev/null +++ b/examples/jms/jms-shared-consumer/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +topic.topic/exampleTopic=exampleTopic \ No newline at end of file diff --git a/examples/jms/jmx/pom.xml b/examples/jms/jmx/pom.xml index 88d0ae683e..2fd219fde3 100644 --- a/examples/jms/jmx/pom.xml +++ b/examples/jms/jmx/pom.xml @@ -79,9 +79,6 @@ org.apache.activemq.jms.example.JMXExample - - tcp://localhost:5445 - @@ -130,7 +127,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/jmx/src/main/java/org/apache/activemq/jms/example/JMXExample.java b/examples/jms/jmx/src/main/java/org/apache/activemq/jms/example/JMXExample.java index af7e21f88e..6027479e72 100644 --- a/examples/jms/jmx/src/main/java/org/apache/activemq/jms/example/JMXExample.java +++ b/examples/jms/jmx/src/main/java/org/apache/activemq/jms/example/JMXExample.java @@ -60,7 +60,7 @@ public class JMXExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/jmx/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/jmx/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 87% rename from examples/jms/jmx/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/jmx/src/main/resources/activemq/server0/activemq-configuration.xml index f21d154d52..b698b1ca00 100644 --- a/examples/jms/jmx/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/jmx/src/main/resources/activemq/server0/activemq-configuration.xml @@ -13,13 +13,6 @@ true - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/multiple-failover-failback/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/jmx/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/multiple-failover-failback/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/jmx/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/large-message/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/jmx/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/large-message/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/jmx/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/jmx/src/main/resources/jndi.properties b/examples/jms/jmx/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/jmx/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/large-message/pom.xml b/examples/jms/large-message/pom.xml index 312ca1ae33..33fd123b68 100644 --- a/examples/jms/large-message/pom.xml +++ b/examples/jms/large-message/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.LargeMessageExample - - tcp://localhost:5445 - exampleConfigDir @@ -108,7 +105,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/large-message/src/main/java/org/apache/activemq/jms/example/LargeMessageExample.java b/examples/jms/large-message/src/main/java/org/apache/activemq/jms/example/LargeMessageExample.java index 7ffc7b913d..2b9bf0e061 100644 --- a/examples/jms/large-message/src/main/java/org/apache/activemq/jms/example/LargeMessageExample.java +++ b/examples/jms/large-message/src/main/java/org/apache/activemq/jms/example/LargeMessageExample.java @@ -50,13 +50,13 @@ public class LargeMessageExample extends ActiveMQExample } /** - * The message we will send is size 10GiB, even though we are only running in 50MB of RAM on both + * The message we will send is size 2GiB, even though we are only running in 50MB of RAM on both * client and server. *

* This may take some considerable time to create, send and consume - if it takes too long or you * don't have enough disk space just reduce the file size here */ - private static final long FILE_SIZE = 2L * 1024 * 1024 * 1024; // 10 GiB message + private static final long FILE_SIZE = 2L * 1024 * 1024 * 1024; // 2 GiB message @Override public boolean runExample() throws Exception @@ -67,7 +67,7 @@ public class LargeMessageExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); @@ -137,7 +137,7 @@ public class LargeMessageExample extends ActiveMQExample // Step 11. Now the server is restarted we can recreate the JMS Objects, and start the new connection - initialContext = getContext(0); + initialContext = new InitialContext(); queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/large-message/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/large-message/src/main/resources/activemq/server0/activemq-configuration.xml new file mode 100644 index 0000000000..52d957087c --- /dev/null +++ b/examples/jms/large-message/src/main/resources/activemq/server0/activemq-configuration.xml @@ -0,0 +1,34 @@ + + + ${build.directory}/server0/data/messaging/bindings + + ${build.directory}/server0/data/messaging/journal + + ${build.directory}/server0/data/messaging/largemessages + + ${build.directory}/server0/data/messaging/paging + + + + + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + + + + + + + + + + + + + + + + + + diff --git a/examples/jms/multiple-failover-failback/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/large-message/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/multiple-failover-failback/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/large-message/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/last-value-queue/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/large-message/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/last-value-queue/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/large-message/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/large-message/src/main/resources/jndi.properties b/examples/jms/large-message/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/large-message/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/last-value-queue/pom.xml b/examples/jms/last-value-queue/pom.xml index bfefd5f431..2bcc97ef2a 100644 --- a/examples/jms/last-value-queue/pom.xml +++ b/examples/jms/last-value-queue/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.LastValueQueueExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/last-value-queue/src/main/java/org/apache/activemq/jms/example/LastValueQueueExample.java b/examples/jms/last-value-queue/src/main/java/org/apache/activemq/jms/example/LastValueQueueExample.java index d62ea0b671..be7992adab 100644 --- a/examples/jms/last-value-queue/src/main/java/org/apache/activemq/jms/example/LastValueQueueExample.java +++ b/examples/jms/last-value-queue/src/main/java/org/apache/activemq/jms/example/LastValueQueueExample.java @@ -52,7 +52,7 @@ public class LastValueQueueExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/jms-completion-listener/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/last-value-queue/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/jms-completion-listener/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/last-value-queue/src/main/resources/activemq/server0/activemq-configuration.xml index e0acd1deea..7cc74d77a7 100644 --- a/examples/jms/jms-completion-listener/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/last-value-queue/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,15 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - @@ -40,4 +31,11 @@ + + + + true + + + diff --git a/examples/jms/message-group2/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/last-value-queue/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/message-group2/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/last-value-queue/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/management/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/last-value-queue/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/management/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/last-value-queue/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/last-value-queue/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/last-value-queue/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index 7e8ce42de7..0000000000 --- a/examples/jms/last-value-queue/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - - - - - - - - - - - - - - - - - true - - - - diff --git a/examples/jms/last-value-queue/src/main/resources/jndi.properties b/examples/jms/last-value-queue/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/last-value-queue/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/management-notifications/pom.xml b/examples/jms/management-notifications/pom.xml index 4afe1d4fff..dd70dc0078 100644 --- a/examples/jms/management-notifications/pom.xml +++ b/examples/jms/management-notifications/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.ManagementNotificationExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/management-notifications/src/main/java/org/apache/activemq/jms/example/ManagementNotificationExample.java b/examples/jms/management-notifications/src/main/java/org/apache/activemq/jms/example/ManagementNotificationExample.java index b98f8255d0..de631dcf3a 100644 --- a/examples/jms/management-notifications/src/main/java/org/apache/activemq/jms/example/ManagementNotificationExample.java +++ b/examples/jms/management-notifications/src/main/java/org/apache/activemq/jms/example/ManagementNotificationExample.java @@ -52,7 +52,7 @@ public class ManagementNotificationExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perform a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/management-notifications/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/management-notifications/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 91% rename from examples/jms/management-notifications/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/management-notifications/src/main/resources/activemq/server0/activemq-configuration.xml index 1446182efc..64680fb2d6 100644 --- a/examples/jms/management-notifications/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/management-notifications/src/main/resources/activemq/server0/activemq-configuration.xml @@ -12,12 +12,6 @@ jms.topic.notificationsTopic - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/management-notifications/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/management-notifications/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/management-notifications/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/management-notifications/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/management-notifications/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/management-notifications/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/management-notifications/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/management-notifications/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/management-notifications/src/main/resources/jndi.properties b/examples/jms/management-notifications/src/main/resources/jndi.properties new file mode 100644 index 0000000000..66edf977b9 --- /dev/null +++ b/examples/jms/management-notifications/src/main/resources/jndi.properties @@ -0,0 +1,4 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue +topic.topic/notificationsTopic=notificationsTopic \ No newline at end of file diff --git a/examples/jms/management/pom.xml b/examples/jms/management/pom.xml index 8fecd6f9f6..2668aaacbb 100644 --- a/examples/jms/management/pom.xml +++ b/examples/jms/management/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.ManagementExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/management/src/main/java/org/apache/activemq/jms/example/ManagementExample.java b/examples/jms/management/src/main/java/org/apache/activemq/jms/example/ManagementExample.java index 1ab1ac49ad..fd83ed0e12 100644 --- a/examples/jms/management/src/main/java/org/apache/activemq/jms/example/ManagementExample.java +++ b/examples/jms/management/src/main/java/org/apache/activemq/jms/example/ManagementExample.java @@ -52,7 +52,7 @@ public class ManagementExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/management/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/management/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 91% rename from examples/jms/management/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/management/src/main/resources/activemq/server0/activemq-configuration.xml index 93d76784e1..d15ca0cbc7 100644 --- a/examples/jms/management/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/management/src/main/resources/activemq/server0/activemq-configuration.xml @@ -12,12 +12,6 @@ jms.queue.activemq.management - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/multiple-failover-failback/src/main/resources/hornetq/server2/activemq-jms.xml b/examples/jms/management/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/multiple-failover-failback/src/main/resources/hornetq/server2/activemq-jms.xml rename to examples/jms/management/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/message-counters/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/management/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/message-counters/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/management/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/management/src/main/resources/jndi.properties b/examples/jms/management/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/management/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/message-counters/pom.xml b/examples/jms/message-counters/pom.xml index 2bca2d4cfc..0e4b7cc618 100644 --- a/examples/jms/message-counters/pom.xml +++ b/examples/jms/message-counters/pom.xml @@ -74,9 +74,6 @@ org.apache.activemq.jms.example.MessageCounterExample - - tcp://localhost:5445 - @@ -125,7 +122,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/message-counters/src/main/java/org/apache/activemq/jms/example/MessageCounterExample.java b/examples/jms/message-counters/src/main/java/org/apache/activemq/jms/example/MessageCounterExample.java index a1b697a7e6..92843cad04 100644 --- a/examples/jms/message-counters/src/main/java/org/apache/activemq/jms/example/MessageCounterExample.java +++ b/examples/jms/message-counters/src/main/java/org/apache/activemq/jms/example/MessageCounterExample.java @@ -62,7 +62,7 @@ public class MessageCounterExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/message-counters/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/message-counters/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 91% rename from examples/jms/message-counters/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/message-counters/src/main/resources/activemq/server0/activemq-configuration.xml index 14ddbcbde0..3b747b8f5c 100644 --- a/examples/jms/message-counters/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/message-counters/src/main/resources/activemq/server0/activemq-configuration.xml @@ -15,13 +15,6 @@ true 2000 2 - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/message-counters/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/message-counters/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/message-counters/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/message-counters/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/message-group/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/message-counters/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/message-group/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/message-counters/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/message-counters/src/main/resources/jndi.properties b/examples/jms/message-counters/src/main/resources/jndi.properties new file mode 100644 index 0000000000..bb4fdf6acb --- /dev/null +++ b/examples/jms/message-counters/src/main/resources/jndi.properties @@ -0,0 +1,4 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue +queue.queue/expiryQueue=expiryQueue \ No newline at end of file diff --git a/examples/jms/message-group/pom.xml b/examples/jms/message-group/pom.xml index 69571d9b5c..63a08ef02c 100644 --- a/examples/jms/message-group/pom.xml +++ b/examples/jms/message-group/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.MessageGroupExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/message-group/src/main/java/org/apache/activemq/jms/example/MessageGroupExample.java b/examples/jms/message-group/src/main/java/org/apache/activemq/jms/example/MessageGroupExample.java index 1a2cf49f06..02b46d6cd8 100644 --- a/examples/jms/message-group/src/main/java/org/apache/activemq/jms/example/MessageGroupExample.java +++ b/examples/jms/message-group/src/main/java/org/apache/activemq/jms/example/MessageGroupExample.java @@ -57,7 +57,7 @@ public class MessageGroupExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perform a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/message-group/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/message-group/src/main/resources/activemq/server0/activemq-configuration.xml new file mode 100644 index 0000000000..52d957087c --- /dev/null +++ b/examples/jms/message-group/src/main/resources/activemq/server0/activemq-configuration.xml @@ -0,0 +1,34 @@ + + + ${build.directory}/server0/data/messaging/bindings + + ${build.directory}/server0/data/messaging/journal + + ${build.directory}/server0/data/messaging/largemessages + + ${build.directory}/server0/data/messaging/paging + + + + + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + + + + + + + + + + + + + + + + + + diff --git a/examples/jms/message-priority/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/message-group/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/message-priority/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/message-group/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/message-group2/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/message-group/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/message-group2/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/message-group/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/message-group/src/main/resources/jndi.properties b/examples/jms/message-group/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/message-group/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/message-group2/pom.xml b/examples/jms/message-group2/pom.xml index 866e9844c7..270708b1da 100644 --- a/examples/jms/message-group2/pom.xml +++ b/examples/jms/message-group2/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.MessageGroup2Example - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/message-group2/src/main/java/org/apache/activemq/jms/example/MessageGroup2Example.java b/examples/jms/message-group2/src/main/java/org/apache/activemq/jms/example/MessageGroup2Example.java index ce462383e1..043c2bc93a 100644 --- a/examples/jms/message-group2/src/main/java/org/apache/activemq/jms/example/MessageGroup2Example.java +++ b/examples/jms/message-group2/src/main/java/org/apache/activemq/jms/example/MessageGroup2Example.java @@ -56,7 +56,7 @@ public class MessageGroup2Example extends ActiveMQExample try { //Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); //Step 2. Perform a lookup on the queue Queue queue = (Queue) initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/message-group2/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/message-group2/src/main/resources/activemq/server0/activemq-configuration.xml new file mode 100644 index 0000000000..52d957087c --- /dev/null +++ b/examples/jms/message-group2/src/main/resources/activemq/server0/activemq-configuration.xml @@ -0,0 +1,34 @@ + + + ${build.directory}/server0/data/messaging/bindings + + ${build.directory}/server0/data/messaging/journal + + ${build.directory}/server0/data/messaging/largemessages + + ${build.directory}/server0/data/messaging/paging + + + + + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + + + + + + + + + + + + + + + + + + diff --git a/examples/jms/queue-message-redistribution/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/message-group2/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/queue-message-redistribution/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/message-group2/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/message-priority/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/message-group2/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/message-priority/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/message-group2/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/message-group2/src/main/resources/jndi.properties b/examples/jms/message-group2/src/main/resources/jndi.properties new file mode 100644 index 0000000000..17141901cd --- /dev/null +++ b/examples/jms/message-group2/src/main/resources/jndi.properties @@ -0,0 +1,4 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.groupID=Group-0 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/message-priority/pom.xml b/examples/jms/message-priority/pom.xml index 631f6bd81e..f3c2fd1f7b 100644 --- a/examples/jms/message-priority/pom.xml +++ b/examples/jms/message-priority/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.MessagePriorityExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/message-priority/src/main/java/org/apache/activemq/jms/example/MessagePriorityExample.java b/examples/jms/message-priority/src/main/java/org/apache/activemq/jms/example/MessagePriorityExample.java index e094b726c5..ee0e791b33 100644 --- a/examples/jms/message-priority/src/main/java/org/apache/activemq/jms/example/MessagePriorityExample.java +++ b/examples/jms/message-priority/src/main/java/org/apache/activemq/jms/example/MessagePriorityExample.java @@ -57,7 +57,7 @@ public class MessagePriorityExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. look-up the JMS queue object from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/message-priority/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/message-priority/src/main/resources/activemq/server0/activemq-configuration.xml new file mode 100644 index 0000000000..52d957087c --- /dev/null +++ b/examples/jms/message-priority/src/main/resources/activemq/server0/activemq-configuration.xml @@ -0,0 +1,34 @@ + + + ${build.directory}/server0/data/messaging/bindings + + ${build.directory}/server0/data/messaging/journal + + ${build.directory}/server0/data/messaging/largemessages + + ${build.directory}/server0/data/messaging/paging + + + + + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + + + + + + + + + + + + + + + + + + diff --git a/examples/jms/queue-message-redistribution/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/message-priority/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/queue-message-redistribution/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/message-priority/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/multiple-failover-failback/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/message-priority/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/multiple-failover-failback/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/message-priority/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/message-priority/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/message-priority/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index 9fa4061b69..0000000000 --- a/examples/jms/message-priority/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - - - - - - - - - - - - - - diff --git a/examples/jms/message-priority/src/main/resources/jndi.properties b/examples/jms/message-priority/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/message-priority/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/multiple-failover-failback/pom.xml b/examples/jms/multiple-failover-failback/pom.xml index 8264323419..4d641abe1b 100644 --- a/examples/jms/multiple-failover-failback/pom.xml +++ b/examples/jms/multiple-failover-failback/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -55,9 +55,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -77,9 +75,7 @@ start - 1299 - 1298 - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 true @@ -100,11 +96,6 @@ org.apache.activemq.jms.example.MultipleFailoverFailbackExample - - tcp://localhost:5445 - tcp://localhost:5446 - tcp://localhost:5447 - exampleConfigDir @@ -119,7 +110,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -128,7 +119,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 @@ -137,7 +128,7 @@ stop - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 diff --git a/examples/jms/multiple-failover-failback/src/main/java/org/apache/activemq/jms/example/MultipleFailoverFailbackExample.java b/examples/jms/multiple-failover-failback/src/main/java/org/apache/activemq/jms/example/MultipleFailoverFailbackExample.java index b6af378fc6..a295731edd 100644 --- a/examples/jms/multiple-failover-failback/src/main/java/org/apache/activemq/jms/example/MultipleFailoverFailbackExample.java +++ b/examples/jms/multiple-failover-failback/src/main/java/org/apache/activemq/jms/example/MultipleFailoverFailbackExample.java @@ -52,7 +52,7 @@ public class MultipleFailoverFailbackExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from the server #1 - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look up the JMS resources from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/multiple-failover-failback/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/multiple-failover-failback/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/multiple-failover/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/multiple-failover/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/multiple-failover-failback/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/multiple-failover-failback/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/multiple-failover-failback/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/multiple-failover-failback/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/multiple-failover/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/multiple-failover/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/multiple-failover-failback/src/main/resources/hornetq/server2/activemq-users.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/multiple-failover-failback/src/main/resources/hornetq/server2/activemq-users.xml rename to examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/multiple-failover-failback/src/main/resources/hornetq/server2/activemq-configuration.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/activemq-configuration.xml similarity index 100% rename from examples/jms/multiple-failover-failback/src/main/resources/hornetq/server2/activemq-configuration.xml rename to examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/activemq-configuration.xml diff --git a/examples/jms/multiple-failover/src/main/resources/hornetq/server2/activemq-jms.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/activemq-jms.xml similarity index 100% rename from examples/jms/multiple-failover/src/main/resources/hornetq/server2/activemq-jms.xml rename to examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/activemq-jms.xml diff --git a/examples/jms/multiple-failover/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/activemq-users.xml similarity index 100% rename from examples/jms/multiple-failover/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/activemq-users.xml diff --git a/examples/jms/multiple-failover-failback/src/main/resources/jndi.properties b/examples/jms/multiple-failover-failback/src/main/resources/jndi.properties new file mode 100644 index 0000000000..8fda7c0024 --- /dev/null +++ b/examples/jms/multiple-failover-failback/src/main/resources/jndi.properties @@ -0,0 +1,7 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.ha=true +connection.ConnectionFactory.retryInterval=1000 +connection.ConnectionFactory.retryIntervalMultiplier=1.0 +connection.ConnectionFactory.reconnectAttempts=-1 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/multiple-failover/pom.xml b/examples/jms/multiple-failover/pom.xml index 844f22c3c6..dd5057ec03 100644 --- a/examples/jms/multiple-failover/pom.xml +++ b/examples/jms/multiple-failover/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -55,9 +55,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -77,9 +75,7 @@ start - 1299 - 1298 - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 true @@ -100,11 +96,6 @@ org.apache.activemq.jms.example.MultipleFailoverExample - - tcp://localhost:5445 - tcp://localhost:5446 - tcp://localhost:5447 - exampleConfigDir @@ -119,7 +110,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -128,7 +119,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 @@ -137,7 +128,7 @@ stop - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 diff --git a/examples/jms/multiple-failover/src/main/java/org/apache/activemq/jms/example/MultipleFailoverExample.java b/examples/jms/multiple-failover/src/main/java/org/apache/activemq/jms/example/MultipleFailoverExample.java index 8f430a34cb..768868f3af 100644 --- a/examples/jms/multiple-failover/src/main/java/org/apache/activemq/jms/example/MultipleFailoverExample.java +++ b/examples/jms/multiple-failover/src/main/java/org/apache/activemq/jms/example/MultipleFailoverExample.java @@ -52,7 +52,7 @@ public class MultipleFailoverExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from the server #1 - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look up the JMS resources from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); @@ -158,5 +158,4 @@ public class MultipleFailoverExample extends ActiveMQExample } } } - } diff --git a/examples/jms/multiple-failover/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/multiple-failover/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/multiple-failover/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/no-consumer-buffering/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/no-consumer-buffering/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/multiple-failover/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/multiple-failover/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/multiple-failover/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/multiple-failover/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/multiple-failover/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/multiple-failover/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/multiple-failover/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/non-transaction-failover/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/non-transaction-failover/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/multiple-failover/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/multiple-failover/src/main/resources/hornetq/server2/activemq-users.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/multiple-failover/src/main/resources/hornetq/server2/activemq-users.xml rename to examples/jms/multiple-failover/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/multiple-failover/src/main/resources/hornetq/server2/activemq-configuration.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server2/activemq-configuration.xml similarity index 100% rename from examples/jms/multiple-failover/src/main/resources/hornetq/server2/activemq-configuration.xml rename to examples/jms/multiple-failover/src/main/resources/activemq/server2/activemq-configuration.xml diff --git a/examples/jms/non-transaction-failover/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server2/activemq-jms.xml similarity index 100% rename from examples/jms/non-transaction-failover/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/multiple-failover/src/main/resources/activemq/server2/activemq-jms.xml diff --git a/examples/jms/no-consumer-buffering/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server2/activemq-users.xml similarity index 100% rename from examples/jms/no-consumer-buffering/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/multiple-failover/src/main/resources/activemq/server2/activemq-users.xml diff --git a/examples/jms/multiple-failover/src/main/resources/jndi.properties b/examples/jms/multiple-failover/src/main/resources/jndi.properties new file mode 100644 index 0000000000..8fda7c0024 --- /dev/null +++ b/examples/jms/multiple-failover/src/main/resources/jndi.properties @@ -0,0 +1,7 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.ha=true +connection.ConnectionFactory.retryInterval=1000 +connection.ConnectionFactory.retryIntervalMultiplier=1.0 +connection.ConnectionFactory.reconnectAttempts=-1 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/no-consumer-buffering/pom.xml b/examples/jms/no-consumer-buffering/pom.xml index b205475821..cfca7023f3 100644 --- a/examples/jms/no-consumer-buffering/pom.xml +++ b/examples/jms/no-consumer-buffering/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.NoConsumerBufferingExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/no-consumer-buffering/src/main/java/org/apache/activemq/jms/example/NoConsumerBufferingExample.java b/examples/jms/no-consumer-buffering/src/main/java/org/apache/activemq/jms/example/NoConsumerBufferingExample.java index 98af21d883..4fa4f83293 100644 --- a/examples/jms/no-consumer-buffering/src/main/java/org/apache/activemq/jms/example/NoConsumerBufferingExample.java +++ b/examples/jms/no-consumer-buffering/src/main/java/org/apache/activemq/jms/example/NoConsumerBufferingExample.java @@ -48,7 +48,7 @@ public class NoConsumerBufferingExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/activemq-configuration.xml new file mode 100644 index 0000000000..52d957087c --- /dev/null +++ b/examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/activemq-configuration.xml @@ -0,0 +1,34 @@ + + + ${build.directory}/server0/data/messaging/bindings + + ${build.directory}/server0/data/messaging/journal + + ${build.directory}/server0/data/messaging/largemessages + + ${build.directory}/server0/data/messaging/paging + + + + + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + + + + + + + + + + + + + + + + + + diff --git a/examples/jms/openwire/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/openwire/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/non-transaction-failover/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/non-transaction-failover/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/no-consumer-buffering/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/no-consumer-buffering/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index e0acd1deea..0000000000 --- a/examples/jms/no-consumer-buffering/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - - - - - - - - - - - - - - diff --git a/examples/jms/no-consumer-buffering/src/main/resources/jndi.properties b/examples/jms/no-consumer-buffering/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d69b1bf26a --- /dev/null +++ b/examples/jms/no-consumer-buffering/src/main/resources/jndi.properties @@ -0,0 +1,4 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.consumerWindowSize=0 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/non-transaction-failover/pom.xml b/examples/jms/non-transaction-failover/pom.xml index 0bd9fa5b01..4ca1716ede 100644 --- a/examples/jms/non-transaction-failover/pom.xml +++ b/examples/jms/non-transaction-failover/pom.xml @@ -36,13 +36,6 @@ start - - - build.directory - ${basedir}/target/ - - - ${basedir}/target/classes/activemq/server0 build.directory @@ -53,6 +46,7 @@ ${udp-address} + ${basedir}/target/classes/activemq/server0 @@ -61,9 +55,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -84,10 +76,6 @@ org.apache.activemq.jms.example.NonTransactionFailoverExample - - tcp://localhost:5445 - tcp://localhost:5446 - exampleConfigDir @@ -102,7 +90,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -111,7 +99,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/non-transaction-failover/src/main/java/org/apache/activemq/jms/example/NonTransactionFailoverExample.java b/examples/jms/non-transaction-failover/src/main/java/org/apache/activemq/jms/example/NonTransactionFailoverExample.java index fc370970d2..2b346a5ea0 100644 --- a/examples/jms/non-transaction-failover/src/main/java/org/apache/activemq/jms/example/NonTransactionFailoverExample.java +++ b/examples/jms/non-transaction-failover/src/main/java/org/apache/activemq/jms/example/NonTransactionFailoverExample.java @@ -53,7 +53,7 @@ public class NonTransactionFailoverExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from the server #1 - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look up the JMS resources from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/non-transaction-failover/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/non-transaction-failover/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/non-transaction-failover/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/pre-acknowledge/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/pre-acknowledge/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/non-transaction-failover/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/non-transaction-failover/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/non-transaction-failover/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/non-transaction-failover/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/non-transaction-failover/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/non-transaction-failover/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/non-transaction-failover/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/producer-rate-limit/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/producer-rate-limit/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/non-transaction-failover/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/openwire/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/openwire/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/non-transaction-failover/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/non-transaction-failover/src/main/resources/jndi.properties b/examples/jms/non-transaction-failover/src/main/resources/jndi.properties new file mode 100644 index 0000000000..8fda7c0024 --- /dev/null +++ b/examples/jms/non-transaction-failover/src/main/resources/jndi.properties @@ -0,0 +1,7 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.ha=true +connection.ConnectionFactory.retryInterval=1000 +connection.ConnectionFactory.retryIntervalMultiplier=1.0 +connection.ConnectionFactory.reconnectAttempts=-1 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/openwire/pom.xml b/examples/jms/openwire/pom.xml index b129d99b75..d6ff7a73a8 100644 --- a/examples/jms/openwire/pom.xml +++ b/examples/jms/openwire/pom.xml @@ -55,9 +55,6 @@ org.apache.activemq.jms.example.OpenWireExample - - tcp://localhost:5445 - @@ -111,7 +108,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/openwire/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/openwire/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/openwire/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/openwire/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/queue-requestor/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/openwire/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/queue-requestor/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/openwire/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/paging/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/openwire/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/paging/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/openwire/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/paging/pom.xml b/examples/jms/paging/pom.xml index 6081b2b635..20ba3fa24b 100644 --- a/examples/jms/paging/pom.xml +++ b/examples/jms/paging/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.PagingExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/paging/src/main/java/org/apache/activemq/jms/example/PagingExample.java b/examples/jms/paging/src/main/java/org/apache/activemq/jms/example/PagingExample.java index fe50d823e2..4754fa79d0 100644 --- a/examples/jms/paging/src/main/java/org/apache/activemq/jms/example/PagingExample.java +++ b/examples/jms/paging/src/main/java/org/apache/activemq/jms/example/PagingExample.java @@ -49,7 +49,7 @@ public class PagingExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perform a lookup on the Connection Factory ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory"); @@ -59,7 +59,7 @@ public class PagingExample extends ActiveMQExample Queue pageQueue = (Queue)initialContext.lookup("queue/pagingQueue"); // Step 4. Lookup for a JMS Queue - Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue"); + Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); // Step 5. Create a JMS Connection connection = cf.createConnection(); diff --git a/examples/jms/paging/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/paging/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/paging/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/paging/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/paging/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/paging/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/paging/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/paging/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/pre-acknowledge/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/paging/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/pre-acknowledge/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/paging/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/paging/src/main/resources/jndi.properties b/examples/jms/paging/src/main/resources/jndi.properties new file mode 100644 index 0000000000..ab86463bb2 --- /dev/null +++ b/examples/jms/paging/src/main/resources/jndi.properties @@ -0,0 +1,4 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue +queue.queue/pagingQueue=pagingQueue \ No newline at end of file diff --git a/examples/jms/perf/pom.xml b/examples/jms/perf/pom.xml index 6b049232f6..91b5195267 100644 --- a/examples/jms/perf/pom.xml +++ b/examples/jms/perf/pom.xml @@ -63,7 +63,7 @@ true - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -75,7 +75,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/perf/src/main/java/org/apache/activemq/jms/example/PerfBase.java b/examples/jms/perf/src/main/java/org/apache/activemq/jms/example/PerfBase.java index a2af10facd..5ceacf04a9 100644 --- a/examples/jms/perf/src/main/java/org/apache/activemq/jms/example/PerfBase.java +++ b/examples/jms/perf/src/main/java/org/apache/activemq/jms/example/PerfBase.java @@ -44,8 +44,6 @@ public abstract class PerfBase private static final String DEFAULT_PERF_PROPERTIES_FILE_NAME = "target/classes/perf.properties"; - private static final String DEFAULT_JNDI_PROPERTIES_FILE_NAME = "target/classes/client.jndi.properties"; - private static byte[] randomByteArray(final int length) { byte[] bytes = new byte[length]; @@ -76,45 +74,6 @@ public abstract class PerfBase return fileName; } - protected static String getJndiFileName(final String[] args) - { - String fileName; - - if (args.length > 1) - { - fileName = args[1]; - } - else - { - fileName = PerfBase.DEFAULT_JNDI_PROPERTIES_FILE_NAME; - } - - return fileName; - } - - protected static Properties getJndiProps(final String fileName) throws Exception - { - Properties props = null; - - InputStream is = null; - - try - { - is = new FileInputStream(fileName); - - props = new Properties(); - - props.load(is); - } - finally - { - if (is != null) - { - is.close(); - } - } - return props; - } protected static PerfParams getParams(final String fileName) throws Exception { Properties props = null; @@ -185,12 +144,9 @@ public abstract class PerfBase private final PerfParams perfParams; - private Properties properties; - - protected PerfBase(final PerfParams perfParams, Properties properties) + protected PerfBase(final PerfParams perfParams) { this.perfParams = perfParams; - this.properties = properties; } private ConnectionFactory factory; @@ -205,7 +161,7 @@ public abstract class PerfBase private void init() throws Exception { - InitialContext ic = new InitialContext(properties); + InitialContext ic = new InitialContext(); System.out.println("ic = " + ic); factory = (ConnectionFactory)ic.lookup(perfParams.getConnectionFactoryLookup()); diff --git a/examples/jms/perf/src/main/java/org/apache/activemq/jms/example/PerfListener.java b/examples/jms/perf/src/main/java/org/apache/activemq/jms/example/PerfListener.java index f17f43d817..a6315ed509 100644 --- a/examples/jms/perf/src/main/java/org/apache/activemq/jms/example/PerfListener.java +++ b/examples/jms/perf/src/main/java/org/apache/activemq/jms/example/PerfListener.java @@ -39,11 +39,7 @@ public class PerfListener extends PerfBase PerfParams params = PerfBase.getParams(fileName); - fileName = PerfBase.getJndiFileName(args); - - Properties properties = PerfBase.getJndiProps(fileName); - - new PerfListener(params, properties).run(); + new PerfListener(params).run(); } catch (Exception e) { @@ -51,9 +47,9 @@ public class PerfListener extends PerfBase } } - private PerfListener(final PerfParams perfParams, Properties properties) + private PerfListener(final PerfParams perfParams) { - super(perfParams, properties); + super(perfParams); } public void run() throws Exception diff --git a/examples/jms/perf/src/main/java/org/apache/activemq/jms/example/PerfSender.java b/examples/jms/perf/src/main/java/org/apache/activemq/jms/example/PerfSender.java index ac6fbfab22..55f4583781 100644 --- a/examples/jms/perf/src/main/java/org/apache/activemq/jms/example/PerfSender.java +++ b/examples/jms/perf/src/main/java/org/apache/activemq/jms/example/PerfSender.java @@ -39,11 +39,7 @@ public class PerfSender extends PerfBase PerfParams params = PerfBase.getParams(fileName); - fileName = PerfBase.getJndiFileName(args); - - Properties properties = PerfBase.getJndiProps(fileName); - - new PerfSender(params, properties).run(); + new PerfSender(params).run(); } catch (Exception e) { @@ -51,9 +47,9 @@ public class PerfSender extends PerfBase } } - private PerfSender(final PerfParams perfParams, Properties properties) + private PerfSender(final PerfParams perfParams) { - super(perfParams, properties); + super(perfParams); } public void run() throws Exception diff --git a/examples/jms/perf/src/main/resources/hornetq/server0/hornetq-configuration-messaging-lab.xml b/examples/jms/perf/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 70% rename from examples/jms/perf/src/main/resources/hornetq/server0/hornetq-configuration-messaging-lab.xml rename to examples/jms/perf/src/main/resources/activemq/server0/activemq-configuration.xml index d00ad0af13..d30b582662 100644 --- a/examples/jms/perf/src/main/resources/hornetq/server0/hornetq-configuration-messaging-lab.xml +++ b/examples/jms/perf/src/main/resources/activemq/server0/activemq-configuration.xml @@ -2,6 +2,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd"> + false + true @@ -10,19 +12,9 @@ - - false - - true - - /activemq-data/large-messages - /activemq-data/bindings - /activemq-data/journal - /activemq-data/paging -

perfAddress
diff --git a/examples/jms/perf/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/perf/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/perf/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/perf/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/perf/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/perf/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index b1ccc9ace3..0000000000 --- a/examples/jms/perf/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - - - false - - true - - - -
perfAddress
-
-
- -
diff --git a/examples/jms/perf/src/main/resources/jndi.properties b/examples/jms/perf/src/main/resources/jndi.properties new file mode 100644 index 0000000000..32fa2c00b2 --- /dev/null +++ b/examples/jms/perf/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445?tcp-no-delay=false&tcp-send-buffer-size=1048576&tcp-receive-buffer-size=1048576 +queue.perfQueue=perfQueue \ No newline at end of file diff --git a/examples/jms/perf/src/main/resources/perf.properties b/examples/jms/perf/src/main/resources/perf.properties index 3a926e53f5..f288b8bfa6 100644 --- a/examples/jms/perf/src/main/resources/perf.properties +++ b/examples/jms/perf/src/main/resources/perf.properties @@ -6,7 +6,7 @@ transacted=false batch-size=1000 drain-queue=false destination-lookup=perfQueue -connection-factory-lookup=/ConnectionFactory +connection-factory-lookup=ConnectionFactory throttle-rate=-1 dups-ok-acknowledge=false disable-message-id=true diff --git a/examples/jms/pre-acknowledge/pom.xml b/examples/jms/pre-acknowledge/pom.xml index 14623b8133..177888479c 100644 --- a/examples/jms/pre-acknowledge/pom.xml +++ b/examples/jms/pre-acknowledge/pom.xml @@ -102,7 +102,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/pre-acknowledge/src/main/java/org/apache/activemq/jms/example/PreacknowledgeExample.java b/examples/jms/pre-acknowledge/src/main/java/org/apache/activemq/jms/example/PreacknowledgeExample.java index e3f2c7aa27..8c507c49d4 100644 --- a/examples/jms/pre-acknowledge/src/main/java/org/apache/activemq/jms/example/PreacknowledgeExample.java +++ b/examples/jms/pre-acknowledge/src/main/java/org/apache/activemq/jms/example/PreacknowledgeExample.java @@ -60,7 +60,7 @@ public class PreacknowledgeExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perform the look-ups Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/pre-acknowledge/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 86% rename from examples/jms/pre-acknowledge/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/pre-acknowledge/src/main/resources/activemq/server0/activemq-configuration.xml index d661c7cb16..9fe2fd0bf3 100644 --- a/examples/jms/pre-acknowledge/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,15 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/queue/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/queue/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/pre-acknowledge/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/producer-rate-limit/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/pre-acknowledge/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/producer-rate-limit/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/pre-acknowledge/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/pre-acknowledge/src/main/resources/jndi.properties b/examples/jms/pre-acknowledge/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/pre-acknowledge/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/producer-rate-limit/pom.xml b/examples/jms/producer-rate-limit/pom.xml index 6d4bf66aa9..b8d0680135 100644 --- a/examples/jms/producer-rate-limit/pom.xml +++ b/examples/jms/producer-rate-limit/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.ProducerRateLimitExample - - tcp://localhost:5445 -
@@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/producer-rate-limit/src/main/java/org/apache/activemq/jms/example/ProducerRateLimitExample.java b/examples/jms/producer-rate-limit/src/main/java/org/apache/activemq/jms/example/ProducerRateLimitExample.java index 1b78bd96a3..78bdf33bf7 100644 --- a/examples/jms/producer-rate-limit/src/main/java/org/apache/activemq/jms/example/ProducerRateLimitExample.java +++ b/examples/jms/producer-rate-limit/src/main/java/org/apache/activemq/jms/example/ProducerRateLimitExample.java @@ -48,7 +48,7 @@ public class ProducerRateLimitExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/producer-rate-limit/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/producer-rate-limit/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/producer-rate-limit/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/producer-rate-limit/src/main/resources/activemq/server0/activemq-configuration.xml index 679a17ad91..4b94d90874 100644 --- a/examples/jms/producer-rate-limit/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/producer-rate-limit/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,15 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/replicated-failback-static/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/producer-rate-limit/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/replicated-failback-static/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/producer-rate-limit/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/proton-cpp/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/producer-rate-limit/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/proton-cpp/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/producer-rate-limit/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/producer-rate-limit/src/main/resources/jndi.properties b/examples/jms/producer-rate-limit/src/main/resources/jndi.properties new file mode 100644 index 0000000000..e053f64ce5 --- /dev/null +++ b/examples/jms/producer-rate-limit/src/main/resources/jndi.properties @@ -0,0 +1,4 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.producerMaxRate=50 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/proton-cpp/pom.xml b/examples/jms/proton-cpp/pom.xml index 32d30c3695..602ddc2d07 100644 --- a/examples/jms/proton-cpp/pom.xml +++ b/examples/jms/proton-cpp/pom.xml @@ -64,7 +64,7 @@ true - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -76,7 +76,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/proton-cpp/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/proton-cpp/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/proton-cpp/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/proton-cpp/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/proton-cpp/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/proton-cpp/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/proton-cpp/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/proton-cpp/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/proton-j/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/proton-cpp/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/proton-j/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/proton-cpp/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/proton-j/pom.xml b/examples/jms/proton-j/pom.xml index f530c43c27..5f1af32ac8 100644 --- a/examples/jms/proton-j/pom.xml +++ b/examples/jms/proton-j/pom.xml @@ -108,7 +108,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/proton-j/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/proton-j/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/proton-j/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/proton-j/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/proton-j/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/proton-j/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/proton-j/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/proton-j/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/queue-message-redistribution/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/proton-j/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/queue-message-redistribution/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/proton-j/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/proton-ruby/pom.xml b/examples/jms/proton-ruby/pom.xml index 7c6ce2106d..f4d9faf4e6 100644 --- a/examples/jms/proton-ruby/pom.xml +++ b/examples/jms/proton-ruby/pom.xml @@ -86,7 +86,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/proton-ruby/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/proton-ruby/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/proton-ruby/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/proton-ruby/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/proton-ruby/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/proton-ruby/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/proton-ruby/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/proton-ruby/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/proton-ruby/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/proton-ruby/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/proton-ruby/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/proton-ruby/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/queue-message-redistribution/pom.xml b/examples/jms/queue-message-redistribution/pom.xml index d2b79afaab..35d0e4997f 100644 --- a/examples/jms/queue-message-redistribution/pom.xml +++ b/examples/jms/queue-message-redistribution/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -55,9 +55,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -96,7 +94,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -105,7 +103,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/jms/example/QueueMessageRedistributionExample.java b/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/jms/example/QueueMessageRedistributionExample.java index 732f36d3e1..b2c473c274 100644 --- a/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/jms/example/QueueMessageRedistributionExample.java +++ b/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/jms/example/QueueMessageRedistributionExample.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.jms.example; +import java.util.Hashtable; + import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.MessageConsumer; @@ -56,7 +58,11 @@ public class QueueMessageRedistributionExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from server 0 - ic0 = getContext(0); + Hashtable properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[0]); + properties.put("queue.queue/exampleQueue", "exampleQueue"); + ic0 = new InitialContext(properties); // Step 2. Look-up the JMS Queue object from JNDI Queue queue = (Queue)ic0.lookup("queue/exampleQueue"); @@ -65,7 +71,10 @@ public class QueueMessageRedistributionExample extends ActiveMQExample ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory"); // Step 4. Get an initial context for looking up JNDI from server 1 - ic1 = getContext(1); + properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[1]); + ic1 = new InitialContext(properties); // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1 ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("ConnectionFactory"); diff --git a/examples/jms/queue-message-redistribution/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/queue-message-redistribution/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/queue-selector/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/queue-selector/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/queue-message-redistribution/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/queue-message-redistribution/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/queue-message-redistribution/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/queue-message-redistribution/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/reattach-node/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/reattach-node/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/queue-requestor/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/queue-requestor/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/queue-requestor/pom.xml b/examples/jms/queue-requestor/pom.xml index 1c644d973f..4cf4351910 100644 --- a/examples/jms/queue-requestor/pom.xml +++ b/examples/jms/queue-requestor/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.QueueRequestorExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/queue-requestor/src/main/java/org/apache/activemq/jms/example/QueueRequestorExample.java b/examples/jms/queue-requestor/src/main/java/org/apache/activemq/jms/example/QueueRequestorExample.java index b2f3d5b7d8..a6fc186988 100644 --- a/examples/jms/queue-requestor/src/main/java/org/apache/activemq/jms/example/QueueRequestorExample.java +++ b/examples/jms/queue-requestor/src/main/java/org/apache/activemq/jms/example/QueueRequestorExample.java @@ -48,7 +48,7 @@ public class QueueRequestorExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/request-reply/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/queue-requestor/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 88% rename from examples/jms/request-reply/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/queue-requestor/src/main/resources/activemq/server0/activemq-configuration.xml index 25e8fc2617..9d3a1bb4b8 100644 --- a/examples/jms/request-reply/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/queue-requestor/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/replicated-failback-static/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/queue-requestor/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/replicated-failback-static/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/queue-requestor/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/queue-selector/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/queue-requestor/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/queue-selector/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/queue-requestor/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/queue-requestor/src/main/resources/jndi.properties b/examples/jms/queue-requestor/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/queue-requestor/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/queue-selector/pom.xml b/examples/jms/queue-selector/pom.xml index cb7024accb..693bc6a929 100644 --- a/examples/jms/queue-selector/pom.xml +++ b/examples/jms/queue-selector/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.QueueSelectorExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/queue-selector/src/main/java/org/apache/activemq/jms/example/QueueSelectorExample.java b/examples/jms/queue-selector/src/main/java/org/apache/activemq/jms/example/QueueSelectorExample.java index ccb5250bde..de2d9dba36 100644 --- a/examples/jms/queue-selector/src/main/java/org/apache/activemq/jms/example/QueueSelectorExample.java +++ b/examples/jms/queue-selector/src/main/java/org/apache/activemq/jms/example/QueueSelectorExample.java @@ -52,7 +52,7 @@ public class QueueSelectorExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. look-up the JMS queue object from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/queue-selector/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/queue-selector/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/queue-selector/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/queue-selector/src/main/resources/activemq/server0/activemq-configuration.xml index 676ebfc82d..27874f9288 100644 --- a/examples/jms/queue-selector/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/queue-selector/src/main/resources/activemq/server0/activemq-configuration.xml @@ -8,14 +8,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/request-reply/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/queue-selector/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/request-reply/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/queue-selector/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/queue/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/queue-selector/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/queue/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/queue-selector/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/queue-selector/src/main/resources/jndi.properties b/examples/jms/queue-selector/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/queue-selector/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/queue/pom.xml b/examples/jms/queue/pom.xml index 307d2f895d..1bbeac3c24 100644 --- a/examples/jms/queue/pom.xml +++ b/examples/jms/queue/pom.xml @@ -29,6 +29,7 @@ org.apache.activemq activemq-maven-plugin + ${project.version} start @@ -51,9 +52,6 @@ org.apache.activemq.jms.example.QueueExample - - tcp://localhost:5445 - @@ -102,7 +100,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/queue/src/main/java/org/apache/activemq/jms/example/QueueExample.java b/examples/jms/queue/src/main/java/org/apache/activemq/jms/example/QueueExample.java index a838c73773..2e38514dd4 100644 --- a/examples/jms/queue/src/main/java/org/apache/activemq/jms/example/QueueExample.java +++ b/examples/jms/queue/src/main/java/org/apache/activemq/jms/example/QueueExample.java @@ -47,7 +47,7 @@ public class QueueExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/queue/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/queue/src/main/resources/activemq/server0/activemq-configuration.xml new file mode 100644 index 0000000000..52d957087c --- /dev/null +++ b/examples/jms/queue/src/main/resources/activemq/server0/activemq-configuration.xml @@ -0,0 +1,34 @@ + + + ${build.directory}/server0/data/messaging/bindings + + ${build.directory}/server0/data/messaging/journal + + ${build.directory}/server0/data/messaging/largemessages + + ${build.directory}/server0/data/messaging/paging + + + + + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + + + + + + + + + + + + + + + + + + diff --git a/examples/jms/replicated-failback/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/queue/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/replicated-failback/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/queue/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/replicated-failback-static/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/queue/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/replicated-failback-static/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/queue/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/queue/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/queue/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index e0acd1deea..0000000000 --- a/examples/jms/queue/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - - - - - - - - - - - - - - diff --git a/examples/jms/queue/src/main/resources/jndi.properties b/examples/jms/queue/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/queue/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/reattach-node/pom.xml b/examples/jms/reattach-node/pom.xml index 97fee3c44c..9498e03f23 100644 --- a/examples/jms/reattach-node/pom.xml +++ b/examples/jms/reattach-node/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -46,9 +46,6 @@ org.apache.activemq.jms.example.ReattachExample - - tcp://localhost:5445 - exampleConfigDir @@ -63,7 +60,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/reattach-node/src/main/java/org/apache/activemq/jms/example/ReattachExample.java b/examples/jms/reattach-node/src/main/java/org/apache/activemq/jms/example/ReattachExample.java index 65d40feffe..9a9d58fbc2 100644 --- a/examples/jms/reattach-node/src/main/java/org/apache/activemq/jms/example/ReattachExample.java +++ b/examples/jms/reattach-node/src/main/java/org/apache/activemq/jms/example/ReattachExample.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.jms.example; +import java.util.Hashtable; + import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.Message; @@ -53,7 +55,7 @@ public class ReattachExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perform a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); @@ -86,7 +88,7 @@ public class ReattachExample extends ActiveMQExample // Step 11. To simulate a temporary problem on the network, we stop the remoting acceptor on the // server which will close all connections - stopAcceptor(initialContext); + stopAcceptor(); System.out.println("Acceptor now stopped, will wait for 10 seconds. This simulates the network connection failing for a while"); @@ -95,7 +97,7 @@ public class ReattachExample extends ActiveMQExample System.out.println("Re-starting acceptor"); - startAcceptor(initialContext); + startAcceptor(); System.out.println("Restarted acceptor. The client will now reconnect."); @@ -121,22 +123,26 @@ public class ReattachExample extends ActiveMQExample } } - private void stopAcceptor(final InitialContext ic) throws Exception + private void stopAcceptor() throws Exception { - stopStartAcceptor(ic, true); + stopStartAcceptor(true); } - private void startAcceptor(final InitialContext ic) throws Exception + private void startAcceptor() throws Exception { - stopStartAcceptor(ic, false); + stopStartAcceptor(false); } // To do this we send a management message to close the acceptor, we do this on a different // connection factory which uses a different remoting connection so we can still send messages // when the main connection has been stopped - private void stopStartAcceptor(final InitialContext initialContext, final boolean stop) throws Exception + private void stopStartAcceptor(final boolean stop) throws Exception { - ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory2"); + Hashtable properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", "tcp://localhost:5446"); + InitialContext initialContext = new InitialContext(properties); + ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory"); Connection connection = null; try diff --git a/examples/jms/reattach-node/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/reattach-node/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/reattach-node/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/reattach-node/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/scale-down/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/reattach-node/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/scale-down/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/reattach-node/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/reattach-node/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/reattach-node/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/reattach-node/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/reattach-node/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/reattach-node/src/main/resources/jndi.properties b/examples/jms/reattach-node/src/main/resources/jndi.properties new file mode 100644 index 0000000000..c801182e3f --- /dev/null +++ b/examples/jms/reattach-node/src/main/resources/jndi.properties @@ -0,0 +1,8 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.retryInterval=1000 +connection.ConnectionFactory.retryIntervalMultiplier=1.0 +connection.ConnectionFactory.reconnectAttempts=-1 +connection.ConnectionFactory.failoverOnServerShutdown=true +connection.ConnectionFactory.confirmationWindowSize=1048576 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/replicated-failback-static/pom.xml b/examples/jms/replicated-failback-static/pom.xml index 631b40f7b1..7358caefb7 100644 --- a/examples/jms/replicated-failback-static/pom.xml +++ b/examples/jms/replicated-failback-static/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -55,9 +55,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -78,10 +76,6 @@ org.apache.activemq.jms.example.ReplicatedFailbackStaticExample - - tcp://localhost:5445 - tcp://localhost:5446 - exampleConfigDir @@ -96,7 +90,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -105,7 +99,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/replicated-failback-static/src/main/java/org/apache/activemq/jms/example/ReplicatedFailbackStaticExample.java b/examples/jms/replicated-failback-static/src/main/java/org/apache/activemq/jms/example/ReplicatedFailbackStaticExample.java index 73edb7e6c1..dde65bb67f 100644 --- a/examples/jms/replicated-failback-static/src/main/java/org/apache/activemq/jms/example/ReplicatedFailbackStaticExample.java +++ b/examples/jms/replicated-failback-static/src/main/java/org/apache/activemq/jms/example/ReplicatedFailbackStaticExample.java @@ -55,7 +55,7 @@ public class ReplicatedFailbackStaticExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from the server #1 - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look up the JMS resources from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); @@ -100,7 +100,7 @@ public class ReplicatedFailbackStaticExample extends ActiveMQExample // Step 10. Crash server #1, the live server, and wait a little while to make sure // it has really crashed - Thread.sleep(2000); + Thread.sleep(5000); killServer(0); // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the diff --git a/examples/jms/replicated-failback-static/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 98% rename from examples/jms/replicated-failback-static/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/replicated-failback-static/src/main/resources/activemq/server0/activemq-configuration.xml index 3854f191d0..684bd36d22 100644 --- a/examples/jms/replicated-failback-static/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/activemq-configuration.xml @@ -19,7 +19,6 @@ true - true diff --git a/examples/jms/replicated-failback/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/replicated-failback/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/replicated-failback-static/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/replicated-failback-static/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/replicated-failback-static/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/replicated-failback-static/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/replicated-failback-static/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/replicated-failback-static/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/replicated-failback-static/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/replicated-failback-static/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/replicated-failback-static/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/replicated-failback-static/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/replicated-failback/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/replicated-failback-static/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/replicated-failback/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/replicated-failback-static/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/replicated-failback-static/src/main/resources/jndi.properties b/examples/jms/replicated-failback-static/src/main/resources/jndi.properties new file mode 100644 index 0000000000..8fda7c0024 --- /dev/null +++ b/examples/jms/replicated-failback-static/src/main/resources/jndi.properties @@ -0,0 +1,7 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.ha=true +connection.ConnectionFactory.retryInterval=1000 +connection.ConnectionFactory.retryIntervalMultiplier=1.0 +connection.ConnectionFactory.reconnectAttempts=-1 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/replicated-failback/pom.xml b/examples/jms/replicated-failback/pom.xml index 1aa611d890..c2846e2dee 100644 --- a/examples/jms/replicated-failback/pom.xml +++ b/examples/jms/replicated-failback/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -55,9 +55,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -78,10 +76,6 @@ org.apache.activemq.jms.example.ReplicatedFailbackExample - - tcp://localhost:5445 - tcp://localhost:5446 - exampleConfigDir @@ -96,7 +90,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -105,7 +99,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/replicated-failback/src/main/java/org/apache/activemq/jms/example/ReplicatedFailbackExample.java b/examples/jms/replicated-failback/src/main/java/org/apache/activemq/jms/example/ReplicatedFailbackExample.java index d216f0fb16..0810ccb1dc 100644 --- a/examples/jms/replicated-failback/src/main/java/org/apache/activemq/jms/example/ReplicatedFailbackExample.java +++ b/examples/jms/replicated-failback/src/main/java/org/apache/activemq/jms/example/ReplicatedFailbackExample.java @@ -55,7 +55,7 @@ public class ReplicatedFailbackExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from the server #1 - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look up the JMS resources from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); @@ -100,7 +100,7 @@ public class ReplicatedFailbackExample extends ActiveMQExample // Step 10. Crash server #1, the live server, and wait a little while to make sure // it has really crashed - Thread.sleep(2000); + Thread.sleep(5000); killServer(0); // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the diff --git a/examples/jms/replicated-failback/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/replicated-failback/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 98% rename from examples/jms/replicated-failback/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/replicated-failback/src/main/resources/activemq/server0/activemq-configuration.xml index 7e9f424493..fcec902e54 100644 --- a/examples/jms/replicated-failback/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/replicated-failback/src/main/resources/activemq/server0/activemq-configuration.xml @@ -19,7 +19,6 @@ true - true diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/replicated-failback/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/replicated-failback/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/replicated-failback/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/replicated-failback/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/replicated-failback/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/replicated-failback/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/replicated-failback/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/replicated-failback/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/replicated-failback/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/replicated-failback/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server2/activemq-jms.xml b/examples/jms/replicated-failback/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server2/activemq-jms.xml rename to examples/jms/replicated-failback/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/replicated-failback/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/replicated-failback/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/replicated-failback/src/main/resources/jndi.properties b/examples/jms/replicated-failback/src/main/resources/jndi.properties new file mode 100644 index 0000000000..8fda7c0024 --- /dev/null +++ b/examples/jms/replicated-failback/src/main/resources/jndi.properties @@ -0,0 +1,7 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.ha=true +connection.ConnectionFactory.retryInterval=1000 +connection.ConnectionFactory.retryIntervalMultiplier=1.0 +connection.ConnectionFactory.reconnectAttempts=-1 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/replicated-multiple-failover/pom.xml b/examples/jms/replicated-multiple-failover/pom.xml index 1afd8abc96..45ef67bedf 100644 --- a/examples/jms/replicated-multiple-failover/pom.xml +++ b/examples/jms/replicated-multiple-failover/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -55,9 +55,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -77,9 +75,7 @@ start - 1299 - 1298 - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 true @@ -100,11 +96,6 @@ org.apache.activemq.jms.example.ReplicatedMultipleFailoverExample - - tcp://localhost:5445 - tcp://localhost:5446 - tcp://localhost:5447 - exampleConfigDir @@ -119,7 +110,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -128,7 +119,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 @@ -137,7 +128,7 @@ stop - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 diff --git a/examples/jms/replicated-multiple-failover/src/main/java/org/apache/activemq/jms/example/ReplicatedMultipleFailoverExample.java b/examples/jms/replicated-multiple-failover/src/main/java/org/apache/activemq/jms/example/ReplicatedMultipleFailoverExample.java index 5ca8ffba95..6b88faddeb 100644 --- a/examples/jms/replicated-multiple-failover/src/main/java/org/apache/activemq/jms/example/ReplicatedMultipleFailoverExample.java +++ b/examples/jms/replicated-multiple-failover/src/main/java/org/apache/activemq/jms/example/ReplicatedMultipleFailoverExample.java @@ -52,7 +52,7 @@ public class ReplicatedMultipleFailoverExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from the server #1 - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look up the JMS resources from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); @@ -97,7 +97,7 @@ public class ReplicatedMultipleFailoverExample extends ActiveMQExample // Step 10. Crash server #1, the live server, and wait a little while to make sure // it has really crashed - Thread.sleep(2000); + Thread.sleep(5000); killServer(0); // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the @@ -119,7 +119,7 @@ public class ReplicatedMultipleFailoverExample extends ActiveMQExample } message0.acknowledge(); - Thread.sleep(2000); + Thread.sleep(5000); killServer(getServer(connection)); // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/replicated-transaction-failover/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/replicated-transaction-failover/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 92% rename from examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/activemq-configuration.xml index 0be89a708f..a5181815f7 100644 --- a/examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server1/activemq-configuration.xml +++ b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/activemq-configuration.xml @@ -18,10 +18,6 @@ - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory diff --git a/examples/jms/replicated-transaction-failover/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/replicated-transaction-failover/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server2/activemq-users.xml b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server2/activemq-users.xml rename to examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server2/activemq-configuration.xml b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/activemq-configuration.xml similarity index 92% rename from examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server2/activemq-configuration.xml rename to examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/activemq-configuration.xml index e1e6d9e20a..6787b3ceb0 100644 --- a/examples/jms/replicated-multiple-failover/src/main/resources/hornetq/server2/activemq-configuration.xml +++ b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/activemq-configuration.xml @@ -17,10 +17,6 @@ - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory diff --git a/examples/jms/send-acknowledgements/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/activemq-jms.xml similarity index 100% rename from examples/jms/send-acknowledgements/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/activemq-jms.xml diff --git a/examples/jms/replicated-transaction-failover/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/activemq-users.xml similarity index 100% rename from examples/jms/replicated-transaction-failover/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/activemq-users.xml diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/jndi.properties b/examples/jms/replicated-multiple-failover/src/main/resources/jndi.properties new file mode 100644 index 0000000000..8fda7c0024 --- /dev/null +++ b/examples/jms/replicated-multiple-failover/src/main/resources/jndi.properties @@ -0,0 +1,7 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.ha=true +connection.ConnectionFactory.retryInterval=1000 +connection.ConnectionFactory.retryIntervalMultiplier=1.0 +connection.ConnectionFactory.reconnectAttempts=-1 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/replicated-transaction-failover/pom.xml b/examples/jms/replicated-transaction-failover/pom.xml index 5d1dc030b7..64f6c36dfd 100644 --- a/examples/jms/replicated-transaction-failover/pom.xml +++ b/examples/jms/replicated-transaction-failover/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -55,9 +55,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 build.directory @@ -78,10 +76,6 @@ org.apache.activemq.jms.example.ReplicatedTransactionFailoverExample - - tcp://localhost:5445 - tcp://localhost:5446 - exampleConfigDir @@ -96,7 +90,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -105,7 +99,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/replicated-transaction-failover/src/main/java/org/apache/activemq/jms/example/ReplicatedTransactionFailoverExample.java b/examples/jms/replicated-transaction-failover/src/main/java/org/apache/activemq/jms/example/ReplicatedTransactionFailoverExample.java index fe0e9d1085..80f8ed69c4 100644 --- a/examples/jms/replicated-transaction-failover/src/main/java/org/apache/activemq/jms/example/ReplicatedTransactionFailoverExample.java +++ b/examples/jms/replicated-transaction-failover/src/main/java/org/apache/activemq/jms/example/ReplicatedTransactionFailoverExample.java @@ -54,7 +54,7 @@ public class ReplicatedTransactionFailoverExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from the server #1 - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look-up the JMS resources from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); @@ -155,7 +155,7 @@ public class ReplicatedTransactionFailoverExample extends ActiveMQExample if (killServer) { - Thread.sleep(2000); + Thread.sleep(5000); killServer(0); diff --git a/examples/jms/replicated-transaction-failover/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/replicated-transaction-failover/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/ssl-enabled/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/ssl-enabled/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/replicated-transaction-failover/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/replicated-transaction-failover/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/replicated-transaction-failover/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 92% rename from examples/jms/replicated-transaction-failover/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/activemq-configuration.xml index f95ed77ebc..3cb1302f46 100644 --- a/examples/jms/replicated-transaction-failover/src/main/resources/hornetq/server1/activemq-configuration.xml +++ b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/activemq-configuration.xml @@ -19,10 +19,6 @@ - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory diff --git a/examples/jms/stomp/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/stomp/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/request-reply/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/request-reply/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/replicated-transaction-failover/src/main/resources/jndi.properties b/examples/jms/replicated-transaction-failover/src/main/resources/jndi.properties new file mode 100644 index 0000000000..8fda7c0024 --- /dev/null +++ b/examples/jms/replicated-transaction-failover/src/main/resources/jndi.properties @@ -0,0 +1,7 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.ha=true +connection.ConnectionFactory.retryInterval=1000 +connection.ConnectionFactory.retryIntervalMultiplier=1.0 +connection.ConnectionFactory.reconnectAttempts=-1 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/request-reply/pom.xml b/examples/jms/request-reply/pom.xml index 72fcd0aba7..377f2b2640 100644 --- a/examples/jms/request-reply/pom.xml +++ b/examples/jms/request-reply/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.RequestReplyExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/request-reply/src/main/java/org/apache/activemq/jms/example/RequestReplyExample.java b/examples/jms/request-reply/src/main/java/org/apache/activemq/jms/example/RequestReplyExample.java index cd7341146c..651dc2afee 100644 --- a/examples/jms/request-reply/src/main/java/org/apache/activemq/jms/example/RequestReplyExample.java +++ b/examples/jms/request-reply/src/main/java/org/apache/activemq/jms/example/RequestReplyExample.java @@ -67,7 +67,7 @@ public class RequestReplyExample extends ActiveMQExample server.start(); // Step 2. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 3. Lookup the queue for sending the request message Queue requestQueue = (Queue)initialContext.lookup("queue/exampleQueue"); @@ -162,7 +162,7 @@ public class RequestReplyExample extends ActiveMQExample public void start() throws Exception { // Get an initial context to perform the JNDI lookup. - InitialContext initialContext = getContext(0); + InitialContext initialContext = new InitialContext(); // Lookup the queue to receive the request message Queue requestQueue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/queue-requestor/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/request-reply/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 88% rename from examples/jms/queue-requestor/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/request-reply/src/main/resources/activemq/server0/activemq-configuration.xml index e1af71e281..9d3a1bb4b8 100644 --- a/examples/jms/queue-requestor/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/request-reply/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,15 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/scale-down/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/request-reply/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/scale-down/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/request-reply/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/scale-down/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/request-reply/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/scale-down/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/request-reply/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/request-reply/src/main/resources/jndi.properties b/examples/jms/request-reply/src/main/resources/jndi.properties new file mode 100644 index 0000000000..8fda7c0024 --- /dev/null +++ b/examples/jms/request-reply/src/main/resources/jndi.properties @@ -0,0 +1,7 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.ha=true +connection.ConnectionFactory.retryInterval=1000 +connection.ConnectionFactory.retryIntervalMultiplier=1.0 +connection.ConnectionFactory.reconnectAttempts=-1 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/rest/dup-send/src/main/resources/hornetq-client.xml b/examples/jms/rest/dup-send/src/main/resources/activemq-client.xml similarity index 100% rename from examples/jms/rest/dup-send/src/main/resources/hornetq-client.xml rename to examples/jms/rest/dup-send/src/main/resources/activemq-client.xml diff --git a/examples/jms/rest/dup-send/src/main/resources/hornetq-rest.xml b/examples/jms/rest/dup-send/src/main/resources/activemq-rest.xml similarity index 100% rename from examples/jms/rest/dup-send/src/main/resources/hornetq-rest.xml rename to examples/jms/rest/dup-send/src/main/resources/activemq-rest.xml diff --git a/examples/jms/rest/jms-to-rest/src/main/resources/hornetq-client.xml b/examples/jms/rest/jms-to-rest/src/main/resources/activemq-client.xml similarity index 100% rename from examples/jms/rest/jms-to-rest/src/main/resources/hornetq-client.xml rename to examples/jms/rest/jms-to-rest/src/main/resources/activemq-client.xml diff --git a/examples/jms/rest/push/src/main/resources/hornetq-client.xml b/examples/jms/rest/push/src/main/resources/activemq-client.xml similarity index 100% rename from examples/jms/rest/push/src/main/resources/hornetq-client.xml rename to examples/jms/rest/push/src/main/resources/activemq-client.xml diff --git a/examples/jms/scale-down/pom.xml b/examples/jms/scale-down/pom.xml index f9a23af905..33924a678d 100644 --- a/examples/jms/scale-down/pom.xml +++ b/examples/jms/scale-down/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 udp-address @@ -51,9 +51,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -70,10 +68,6 @@ org.apache.activemq.jms.example.ScaleDownExample - - tcp://localhost:5445 - tcp://localhost:5446 - exampleConfigDir @@ -88,7 +82,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -97,7 +91,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/scale-down/src/main/java/org/apache/activemq/jms/example/ScaleDownExample.java b/examples/jms/scale-down/src/main/java/org/apache/activemq/jms/example/ScaleDownExample.java index d942b797d9..3d29180cc6 100644 --- a/examples/jms/scale-down/src/main/java/org/apache/activemq/jms/example/ScaleDownExample.java +++ b/examples/jms/scale-down/src/main/java/org/apache/activemq/jms/example/ScaleDownExample.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.jms.example; +import java.util.Hashtable; + import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.MessageConsumer; @@ -52,8 +54,24 @@ public class ScaleDownExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI for both servers - initialContext1 = getContext(1); - initialContext = getContext(0); + Hashtable properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[0]); + properties.put("connection.ConnectionFactory.ha", true); + properties.put("connection.ConnectionFactory.retryInterval", 1000); + properties.put("connection.ConnectionFactory.retryIntervalMultiplier", 1.0); + properties.put("connection.ConnectionFactory.reconnectAttempts", -1); + properties.put("queue.queue/exampleQueue", "exampleQueue"); + initialContext = new InitialContext(properties); + + properties = new Hashtable(); + properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); + properties.put("java.naming.provider.url", args[1]); + properties.put("connection.ConnectionFactory.ha", true); + properties.put("connection.ConnectionFactory.retryInterval", 1000); + properties.put("connection.ConnectionFactory.retryIntervalMultiplier", 1.0); + properties.put("connection.ConnectionFactory.reconnectAttempts", -1); + initialContext1 = new InitialContext(properties); // Step 2. Look up the JMS resources from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); @@ -83,9 +101,9 @@ public class ScaleDownExample extends ActiveMQExample System.out.println("Sent message: " + message.getText()); } - // Step 7. Crash server #0, the live server, and wait a little while to make sure + // Step 7. Crash server #1, the live server, and wait a little while to make sure // it has really crashed - Thread.sleep(2000); + Thread.sleep(5000); killServer(1); diff --git a/examples/jms/scale-down/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/scale-down/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 94% rename from examples/jms/scale-down/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/scale-down/src/main/resources/activemq/server0/activemq-configuration.xml index 784a5bff73..b9a99386b0 100644 --- a/examples/jms/scale-down/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/scale-down/src/main/resources/activemq/server0/activemq-configuration.xml @@ -17,10 +17,6 @@ org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/scheduled-message/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/scale-down/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/scheduled-message/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/scale-down/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/scale-down/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/scale-down/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/scale-down/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/scale-down/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/scale-down/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/scale-down/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/scale-down/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/scale-down/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/static-selector/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/scale-down/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/static-selector/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/scale-down/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/scheduled-message/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/scale-down/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/scheduled-message/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/scale-down/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/scheduled-message/pom.xml b/examples/jms/scheduled-message/pom.xml index 83f1a676ed..ca365bc240 100644 --- a/examples/jms/scheduled-message/pom.xml +++ b/examples/jms/scheduled-message/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.ScheduledMessageExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/scheduled-message/src/main/java/org/apache/activemq/jms/example/ScheduledMessageExample.java b/examples/jms/scheduled-message/src/main/java/org/apache/activemq/jms/example/ScheduledMessageExample.java index 92ece47be5..563d48f6f4 100644 --- a/examples/jms/scheduled-message/src/main/java/org/apache/activemq/jms/example/ScheduledMessageExample.java +++ b/examples/jms/scheduled-message/src/main/java/org/apache/activemq/jms/example/ScheduledMessageExample.java @@ -51,7 +51,7 @@ public class ScheduledMessageExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/transactional/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/scheduled-message/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/transactional/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/scheduled-message/src/main/resources/activemq/server0/activemq-configuration.xml index 8ef5e46935..5d9a6715be 100644 --- a/examples/jms/transactional/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/scheduled-message/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/transactional/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/scheduled-message/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/transactional/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/scheduled-message/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/send-acknowledgements/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/scheduled-message/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/send-acknowledgements/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/scheduled-message/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/scheduled-message/src/main/resources/jndi.properties b/examples/jms/scheduled-message/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/scheduled-message/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/security/pom.xml b/examples/jms/security/pom.xml index 8eb47f87a3..35dafb63d4 100644 --- a/examples/jms/security/pom.xml +++ b/examples/jms/security/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.SecurityExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/security/src/main/java/org/apache/activemq/jms/example/SecurityExample.java b/examples/jms/security/src/main/java/org/apache/activemq/jms/example/SecurityExample.java index 9a699fb4ae..301c2611ec 100644 --- a/examples/jms/security/src/main/java/org/apache/activemq/jms/example/SecurityExample.java +++ b/examples/jms/security/src/main/java/org/apache/activemq/jms/example/SecurityExample.java @@ -55,7 +55,7 @@ public class SecurityExample extends ActiveMQExample try { // /Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. perform lookup on the topics Topic genericTopic = (Topic)initialContext.lookup("topic/genericTopic"); diff --git a/examples/jms/security/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/security/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 90% rename from examples/jms/security/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/security/src/main/resources/activemq/server0/activemq-configuration.xml index 80a5f2c104..7b85a9701e 100644 --- a/examples/jms/security/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/security/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/security/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/security/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/security/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/security/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/security/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/security/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/security/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/security/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/security/src/main/resources/jndi.properties b/examples/jms/security/src/main/resources/jndi.properties new file mode 100644 index 0000000000..3afad0c0ef --- /dev/null +++ b/examples/jms/security/src/main/resources/jndi.properties @@ -0,0 +1,5 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +topic.topic/genericTopic=genericTopic +topic.topic/europeTopic=news.europe.europeTopic +topic.topic/usTopic=news.us.usTopic \ No newline at end of file diff --git a/examples/jms/send-acknowledgements/pom.xml b/examples/jms/send-acknowledgements/pom.xml index 9a766ca1af..30f436a2d2 100644 --- a/examples/jms/send-acknowledgements/pom.xml +++ b/examples/jms/send-acknowledgements/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.SendAcknowledgementsExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/send-acknowledgements/src/main/java/org/apache/activemq/jms/example/SendAcknowledgementsExample.java b/examples/jms/send-acknowledgements/src/main/java/org/apache/activemq/jms/example/SendAcknowledgementsExample.java index 31c284e8e4..4e2cf53a9f 100644 --- a/examples/jms/send-acknowledgements/src/main/java/org/apache/activemq/jms/example/SendAcknowledgementsExample.java +++ b/examples/jms/send-acknowledgements/src/main/java/org/apache/activemq/jms/example/SendAcknowledgementsExample.java @@ -55,7 +55,7 @@ public class SendAcknowledgementsExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/send-acknowledgements/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/send-acknowledgements/src/main/resources/activemq/server0/activemq-configuration.xml new file mode 100644 index 0000000000..52d957087c --- /dev/null +++ b/examples/jms/send-acknowledgements/src/main/resources/activemq/server0/activemq-configuration.xml @@ -0,0 +1,34 @@ + + + ${build.directory}/server0/data/messaging/bindings + + ${build.directory}/server0/data/messaging/journal + + ${build.directory}/server0/data/messaging/largemessages + + ${build.directory}/server0/data/messaging/paging + + + + + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + + + + + + + + + + + + + + + + + + diff --git a/examples/jms/stomp1.1/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/send-acknowledgements/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/stomp1.1/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/send-acknowledgements/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/ssl-enabled/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/send-acknowledgements/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/ssl-enabled/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/send-acknowledgements/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/send-acknowledgements/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/send-acknowledgements/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index e0acd1deea..0000000000 --- a/examples/jms/send-acknowledgements/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - - - - - - - - - - - - - - diff --git a/examples/jms/send-acknowledgements/src/main/resources/jndi.properties b/examples/jms/send-acknowledgements/src/main/resources/jndi.properties new file mode 100644 index 0000000000..5361f8331b --- /dev/null +++ b/examples/jms/send-acknowledgements/src/main/resources/jndi.properties @@ -0,0 +1,4 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.confirmationWindowSize=1048576 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/spring-integration/pom.xml b/examples/jms/spring-integration/pom.xml index 22db0f20a6..c57dc67fbb 100644 --- a/examples/jms/spring-integration/pom.xml +++ b/examples/jms/spring-integration/pom.xml @@ -46,9 +46,6 @@ org.apache.activemq.jms.example.SpringExample - - tcp://localhost:5445 - @@ -91,7 +88,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/spring-integration/src/main/resources/activemq-configuration.xml b/examples/jms/spring-integration/src/main/resources/activemq-configuration.xml index 7e86c388c6..2db2db3f71 100644 --- a/examples/jms/spring-integration/src/main/resources/activemq-configuration.xml +++ b/examples/jms/spring-integration/src/main/resources/activemq-configuration.xml @@ -3,13 +3,6 @@ xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd"> false - - - - - org.apache.activemq.core.remoting.impl.invm.InVMConnectorFactory - - diff --git a/examples/jms/spring-integration/src/main/resources/spring-jms-beans.xml b/examples/jms/spring-integration/src/main/resources/spring-jms-beans.xml index c9eccea32c..9378efb1a2 100644 --- a/examples/jms/spring-integration/src/main/resources/spring-jms-beans.xml +++ b/examples/jms/spring-integration/src/main/resources/spring-jms-beans.xml @@ -4,22 +4,34 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> - + - - - - - - + + + + + + + + - - - - - - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/jms/ssl-enabled/pom.xml b/examples/jms/ssl-enabled/pom.xml index 8fe25340fc..9220b136a7 100644 --- a/examples/jms/ssl-enabled/pom.xml +++ b/examples/jms/ssl-enabled/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.SSLExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/ssl-enabled/src/main/java/org/apache/activemq/jms/example/SSLExample.java b/examples/jms/ssl-enabled/src/main/java/org/apache/activemq/jms/example/SSLExample.java index e025afd4d4..748350602d 100644 --- a/examples/jms/ssl-enabled/src/main/java/org/apache/activemq/jms/example/SSLExample.java +++ b/examples/jms/ssl-enabled/src/main/java/org/apache/activemq/jms/example/SSLExample.java @@ -47,7 +47,7 @@ public class SSLExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Perfom a lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/ssl-enabled/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/ssl-enabled/src/main/resources/activemq/server0/activemq-configuration.xml new file mode 100644 index 0000000000..ce77b71dcf --- /dev/null +++ b/examples/jms/ssl-enabled/src/main/resources/activemq/server0/activemq-configuration.xml @@ -0,0 +1,39 @@ + + + ${build.directory}/server0/data/messaging/bindings + + ${build.directory}/server0/data/messaging/journal + + ${build.directory}/server0/data/messaging/largemessages + + ${build.directory}/server0/data/messaging/paging + + + + + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/jms/stomp1.2/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/ssl-enabled/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/stomp1.2/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/ssl-enabled/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/static-selector-jms/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/ssl-enabled/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/static-selector-jms/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/ssl-enabled/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/ssl-enabled/src/main/resources/activemq/server0/activemq.example.keystore b/examples/jms/ssl-enabled/src/main/resources/activemq/server0/activemq.example.keystore new file mode 100644 index 0000000000000000000000000000000000000000..50de6819eee906dd605e2f63695080cb6c46b1a6 GIT binary patch literal 1273 zcmezO_TO6u1_mY|W&~r_+{*0KN+8e6@Yg;$Al+}!#Mo`X$Ht}2#>m2`#U#kc$jZRd z#8@tO^zZg=HOI(F2mG}dwA39uKTDsmd~$X9GIL4(t6MK9El^pV(D5Qfe(jFGpC`CE z-Om1}zG|}W5rv8Ox|3F<7+F*wxOn^%&WTH z?MiAx@AU=Bq*OnRU2B-b7r~dcFLc{|X0;0+Dz0o`e)A!ZO=hd$rovhO+RAJ-8gJ-* z&|+hfQ;Y6+J^OK2`v0X*@HnhH zwDwp0CZC*CPraq9PTDek63AQQvf=#>*^L`D#UlUyO|SCGzQp?3#Z%)+L5697s^ZI} zi;Z_Wgd7-57B>Hs$gUA#@m_0s?V96`#Ud0pV790BN0=w{HamP@; zd&e*SoSl8<_NB%d&;4!XDrSWy=y@p|nwjljdgE&R7S3}E!v%#SW-iJtU`udSjIWB2 zUlO~qwC=*D`iCb^Et)9ztKr^}qsPLdPU?MgnKYy4a$Le3j>#pNWvM^~P$6ziA!dY-ft)z6p^2f9p@D&sp{bEk6p(9bU<~Kd z#SKl2+kq)n2j+D~AV;35v610#eQ={}sgP#SeXlusZ=O8=Cb&Jw=DiEUVLAJTZGmc; zuCWeEfxjbddn11BKl*i-!MD@1LvyY-S~tj=+HZ6MH!u=sa<}1i)-ybe$y*AtS-swH7W6XAh@2s4%e)lh{S4}^| zeYkDeo6-X#!~1q!iS&O~$S%;>u*FlXQ2B+AhM4g7^PEOKCzd_55v%GBsp-{tuy~!E z_U2`!6Z00=bN^B_P5Ssdsftm>`plA#`&I-_=v>i!|6$bA`D~NA)8ZPcLse54eXReT z_tau;Y++z(Y_PHA37RIDuhwqHF6#HfWsknj*DKE2A6NfnTK$n{uZQl#iO;>~@t$E~ zpPZj@NycFk>-x2(cLW~AZ=EM`VPp60t5!@2M{Kw0X2q5YniS;cxSwHc$&LG#(ZO5r zGU?>>=U*R}m!9R6jVi9)`rbs?*5+~V8~47Z%CM;SN9z3_@HR|btY{!_APY=+vV1IJ zEFvNrtvfq}wnw|H`ttYf0>6#bQ}&yqBxz=S1_K=?5fAs27iaR)x^(Y&2#C(pNo3;h x_|7B}&vUW9WOl?(+sGsXPVJ(Gn(&D4^*Or=1hy~WWr)>___poMkE?BSxB=sr?Kl7c literal 0 HcmV?d00001 diff --git a/examples/jms/ssl-enabled/src/main/resources/activemq/server0/activemq.example.truststore b/examples/jms/ssl-enabled/src/main/resources/activemq/server0/activemq.example.truststore new file mode 100644 index 0000000000000000000000000000000000000000..129391a94858610c3384fbdff9827d8075213682 GIT binary patch literal 866 zcmezO_TO6u1_mY|W(3o$xs}>IWPs%5&yIw%GH zj$DTEYrX%Z#4I`Yq6gz~CQ*jz2?710 z%G_r*P1@PC=yePChX|RkAg6tQxS;jgY}fxLk%Fy+bev52vVh-kF# z>=4=>?Xv32-?t0=HdasBZ;q0rne`bAbeKdu+*4kh$xG|fz2hMuI!`B&iNE7JlSn+z s#rl%j5j$-olMFbuiyCUeBfh`(j8*u!GNY&YvgIk`13r(>t`B_x0CFfZL;wH) literal 0 HcmV?d00001 diff --git a/examples/jms/ssl-enabled/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/ssl-enabled/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index 8bba0898a8..0000000000 --- a/examples/jms/ssl-enabled/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/jms/ssl-enabled/src/main/resources/hornetq/server0/hornetq.example.keystore b/examples/jms/ssl-enabled/src/main/resources/hornetq/server0/hornetq.example.keystore deleted file mode 100644 index 8ca2ea4904f22b81d4a0427dda485afb4cfc2112..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1259 zcmezO_TO6u1_mY|W&~r_+{*0KN+3_!=B3>MAl+}!#Mo`X$Ht}2#>m2`#U#kc$jZRd z#8`ee(&9X0;@sL74Xf6KywuTBKC;T$`b2)<-kkMsb@Y!;>R%b@TNUabr2n%@FoUhs zrg52cqE~Fp&d(kH_=@GEPUJscpmfnjf4ArAjhn8-`))4zzL@XA+izE29eO_X7e_&$ zS8JZ}&%S^H1D%EM1WoIoJ3iF9*88P-ZdCw4t#jf7VU++u-A2`fDpD51S z-(r76I{w?C1xw_caukl8&lF=_6qWEo{Bu^rdymS+bAE7&C^%)vKd|vV=d9Uu<&a`P z$JcXTx-(1E7kBNvv+MUtndpD}4irXyYTLj3s(Q(L`?rO`MkQQHrAtue$NReYeo`u=D?pAKktCJVhA4KbRQwG4#*Bs&$Z9iqJDPuw-Ch7BgsK7BXmJ zI=_IKiIItk#j9`PdIN4YcC9v#a~3SjtPBP@h62FYV-96u6J`(1%g)O$&x46@V2H3| zh;RwB2c@PccqEpjqhq{7-2K+p}i|EL}2x{tK3B0i{F!yH{TS zxBZy(59{#f$5t#8wMkM+Ov zo?6U}EeuSJ4ICn8-<)}K++~-3l*bkU<&4gj<&IRo;UyN9NVlvi$G&!+|o3+9151;7dckQwo8~P*qvsKlbjZdlS z8!N1xeAiI#?3SZfNyE$r3l^X3xkk%1bRNG>{YLHLx_WFfueWGBP$ai~?~D4Gk@!Tspg^iE+C@ z6Qd3+I2eH(d8WojhQIZ}jk2XennCxy=IFh7^8B0N_8^=0E)0j|>>IWPs%5&yIw%GH zj$DTEYrX%Z#4I`Yq6gz~CQ*jz2?710 z%G_r*P1@PC=yePChX|RkAg6tQxS;jgY}1m diff --git a/examples/jms/ssl-enabled/src/main/resources/jndi.properties b/examples/jms/ssl-enabled/src/main/resources/jndi.properties new file mode 100644 index 0000000000..948b4bd0a4 --- /dev/null +++ b/examples/jms/ssl-enabled/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5500?ssl-enabled=true&trust-store-path=activemq/server0/activemq.example.truststore&trust-store-password=activemqexample +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/static-selector-jms/pom.xml b/examples/jms/static-selector-jms/pom.xml index ba5cd8a1c5..4bac000c3c 100644 --- a/examples/jms/static-selector-jms/pom.xml +++ b/examples/jms/static-selector-jms/pom.xml @@ -102,7 +102,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/static-selector-jms/src/main/java/org/apache/activemq/jms/example/StaticSelectorJMSExample.java b/examples/jms/static-selector-jms/src/main/java/org/apache/activemq/jms/example/StaticSelectorJMSExample.java index 7b976e4d7a..267384d91f 100644 --- a/examples/jms/static-selector-jms/src/main/java/org/apache/activemq/jms/example/StaticSelectorJMSExample.java +++ b/examples/jms/static-selector-jms/src/main/java/org/apache/activemq/jms/example/StaticSelectorJMSExample.java @@ -52,7 +52,7 @@ public class StaticSelectorJMSExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. look-up the JMS queue object from JNDI, this is the queue that has filter configured with it. Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); @@ -68,9 +68,10 @@ public class StaticSelectorJMSExample extends ActiveMQExample // Step 6. Create a JMS Session Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + Session producerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); // Step 7. Create a JMS Message Producer - MessageProducer producer = session.createProducer(queue); + MessageProducer producer = producerSession.createProducer(queue); // Step 8. Create a JMS Message Consumer that receives 'red' messages MessageConsumer redConsumer = session.createConsumer(queue); @@ -138,7 +139,7 @@ public class StaticSelectorJMSExample extends ActiveMQExample textMessage.getText() + "] with color property: " + colorProp); - if (!colorProp.equals(name)) + if (colorProp != null && !colorProp.equals(name)) { result = false; } diff --git a/examples/jms/xa-heuristic/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/static-selector-jms/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/xa-heuristic/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/static-selector-jms/src/main/resources/activemq/server0/activemq-configuration.xml index 8ef5e46935..5d9a6715be 100644 --- a/examples/jms/xa-heuristic/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/static-selector-jms/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/static-selector-jms/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/static-selector-jms/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/static-selector-jms/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/static-selector-jms/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/static-selector/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/static-selector-jms/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/static-selector/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/static-selector-jms/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/static-selector-jms/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/static-selector-jms/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index d098c40384..0000000000 --- a/examples/jms/static-selector-jms/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - - - - - - - - - - - - - - diff --git a/examples/jms/static-selector-jms/src/main/resources/jndi.properties b/examples/jms/static-selector-jms/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/static-selector-jms/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/static-selector/pom.xml b/examples/jms/static-selector/pom.xml index a8a3f37b9f..2a695ead89 100644 --- a/examples/jms/static-selector/pom.xml +++ b/examples/jms/static-selector/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.StaticSelectorExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/static-selector/readme.html b/examples/jms/static-selector/readme.html index bf656560e6..6f73b532dc 100644 --- a/examples/jms/static-selector/readme.html +++ b/examples/jms/static-selector/readme.html @@ -32,7 +32,7 @@

In the example code, five messages with different 'color' property values are sent to queue 'selectorQueue'. One consumer is created to receive messages from the queue. Of the five sent messages, two are of 'red' color properties, one is 'blue', - one is 'green' and one has not the 'color' propery at all. The result is that the consumer only gets the two 'red' messages.

+ one is 'green' and one has not the 'color' property at all. The result is that the consumer only gets the two 'red' messages.

Example step-by-step

diff --git a/examples/jms/static-selector/src/main/java/org/apache/activemq/jms/example/StaticSelectorExample.java b/examples/jms/static-selector/src/main/java/org/apache/activemq/jms/example/StaticSelectorExample.java index 11cc7b3850..346134d55a 100644 --- a/examples/jms/static-selector/src/main/java/org/apache/activemq/jms/example/StaticSelectorExample.java +++ b/examples/jms/static-selector/src/main/java/org/apache/activemq/jms/example/StaticSelectorExample.java @@ -52,7 +52,7 @@ public class StaticSelectorExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. look-up the JMS queue object from JNDI, this is the queue that has filter configured with it. Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); @@ -68,9 +68,10 @@ public class StaticSelectorExample extends ActiveMQExample // Step 6. Create a JMS Session Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + Session producerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); // Step 7. Create a JMS Message Producer - MessageProducer producer = session.createProducer(queue); + MessageProducer producer = producerSession.createProducer(queue); // Step 8. Create a JMS Message Consumer that receives 'red' messages MessageConsumer redConsumer = session.createConsumer(queue); @@ -138,7 +139,7 @@ public class StaticSelectorExample extends ActiveMQExample textMessage.getText() + "] with color property: " + colorProp); - if (!colorProp.equals(name)) + if (colorProp != null && !colorProp.equals(name)) { result = false; } diff --git a/examples/jms/scheduled-message/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/static-selector/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/scheduled-message/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/static-selector/src/main/resources/activemq/server0/activemq-configuration.xml index 8ef5e46935..d150bc4203 100644 --- a/examples/jms/scheduled-message/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/static-selector/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - @@ -25,6 +17,13 @@
+ + +
jms.queue.exampleQueue
+ +
+
+ diff --git a/examples/jms/message-group/src/main/resources/hornetq/server0/hornetq-jms.xml b/examples/jms/static-selector/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/message-group/src/main/resources/hornetq/server0/hornetq-jms.xml rename to examples/jms/static-selector/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/stomp-websockets/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/static-selector/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/stomp-websockets/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/static-selector/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/static-selector/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/static-selector/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index 930c70c569..0000000000 --- a/examples/jms/static-selector/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - -
jms.queue.selectorQueue
- -
-
- - - - - - - - - - - - - - - -
diff --git a/examples/jms/static-selector/src/main/resources/jndi.properties b/examples/jms/static-selector/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/static-selector/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/stomp-websockets/pom.xml b/examples/jms/stomp-websockets/pom.xml index 3d56027787..390e3f5d66 100644 --- a/examples/jms/stomp-websockets/pom.xml +++ b/examples/jms/stomp-websockets/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -63,7 +63,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/stomp-websockets/src/main/java/org/apache/activemq/jms/example/StompWebSocketExample.java b/examples/jms/stomp-websockets/src/main/java/org/apache/activemq/jms/example/StompWebSocketExample.java index dac21d91de..323dc02096 100644 --- a/examples/jms/stomp-websockets/src/main/java/org/apache/activemq/jms/example/StompWebSocketExample.java +++ b/examples/jms/stomp-websockets/src/main/java/org/apache/activemq/jms/example/StompWebSocketExample.java @@ -49,7 +49,7 @@ public class StompWebSocketExample extends ActiveMQExample InitialContext initialContext = null; try { - initialContext = getContext(0); + initialContext = new InitialContext(); Topic topic = (Topic)initialContext.lookup("topic/chat"); ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory"); connection = cf.createConnection(); diff --git a/examples/jms/stomp-websockets/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/stomp-websockets/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 88% rename from examples/jms/stomp-websockets/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/stomp-websockets/src/main/resources/activemq/server0/activemq-configuration.xml index c74f54a9ae..60985dfbd8 100644 --- a/examples/jms/stomp-websockets/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/stomp-websockets/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/stomp-websockets/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/stomp-websockets/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/stomp-websockets/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/stomp-websockets/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/stomp/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/stomp-websockets/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/stomp/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/stomp-websockets/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/durable-subscription/src/main/resources/hornetq/server0/client-jndi.properties b/examples/jms/stomp-websockets/src/main/resources/jndi.properties similarity index 86% rename from examples/jms/durable-subscription/src/main/resources/hornetq/server0/client-jndi.properties rename to examples/jms/stomp-websockets/src/main/resources/jndi.properties index f68e7f708b..754c087889 100644 --- a/examples/jms/durable-subscription/src/main/resources/hornetq/server0/client-jndi.properties +++ b/examples/jms/stomp-websockets/src/main/resources/jndi.properties @@ -1,2 +1,3 @@ java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory java.naming.provider.url=tcp://localhost:5445 +topic.topic/chat=chat \ No newline at end of file diff --git a/examples/jms/stomp/pom.xml b/examples/jms/stomp/pom.xml index ebf7049a54..627b7c0638 100644 --- a/examples/jms/stomp/pom.xml +++ b/examples/jms/stomp/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.StompExample - - tcp://localhost:5445 - @@ -107,7 +104,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/stomp/src/main/java/org/apache/activemq/jms/example/StompExample.java b/examples/jms/stomp/src/main/java/org/apache/activemq/jms/example/StompExample.java index a27ae303f1..bd3f84a3d2 100644 --- a/examples/jms/stomp/src/main/java/org/apache/activemq/jms/example/StompExample.java +++ b/examples/jms/stomp/src/main/java/org/apache/activemq/jms/example/StompExample.java @@ -88,7 +88,7 @@ public class StompExample extends ActiveMQExample // We will now consume from JMS the message sent with Stomp. // Step 6. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 7. Perform a lookup on the queue and the connection factory Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/stomp/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/stomp/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 89% rename from examples/jms/stomp/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/stomp/src/main/resources/activemq/server0/activemq-configuration.xml index 0188165c26..1b68cd8b02 100644 --- a/examples/jms/stomp/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/stomp/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,15 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/stop-server-failover/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/stomp/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/stop-server-failover/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/stomp/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/stomp1.1/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/stomp/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/stomp1.1/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/stomp/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/stomp/src/main/resources/jndi.properties b/examples/jms/stomp/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/stomp/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/stomp1.1/pom.xml b/examples/jms/stomp1.1/pom.xml index 251f5c8d85..f7db8c068f 100644 --- a/examples/jms/stomp1.1/pom.xml +++ b/examples/jms/stomp1.1/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.StompExample - - tcp://localhost:5445 - @@ -107,7 +104,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/stomp1.1/src/main/java/org/apache/activemq/jms/example/StompExample.java b/examples/jms/stomp1.1/src/main/java/org/apache/activemq/jms/example/StompExample.java index 35309c0ea6..17220f9ca8 100644 --- a/examples/jms/stomp1.1/src/main/java/org/apache/activemq/jms/example/StompExample.java +++ b/examples/jms/stomp1.1/src/main/java/org/apache/activemq/jms/example/StompExample.java @@ -95,7 +95,7 @@ public class StompExample extends ActiveMQExample // We will now consume from JMS the message sent with Stomp. // Step 6. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 7. Perform a lookup on the queue and the connection factory Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/stomp1.1/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/stomp1.1/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 89% rename from examples/jms/stomp1.1/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/stomp1.1/src/main/resources/activemq/server0/activemq-configuration.xml index 0188165c26..1b68cd8b02 100644 --- a/examples/jms/stomp1.1/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/stomp1.1/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,15 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/stop-server-failover/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/stomp1.1/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/stop-server-failover/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/stomp1.1/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/stomp1.2/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/stomp1.1/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/stomp1.2/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/stomp1.1/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/stomp1.1/src/main/resources/jndi.properties b/examples/jms/stomp1.1/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/stomp1.1/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/stomp1.2/pom.xml b/examples/jms/stomp1.2/pom.xml index 1876e38150..2c52fb6eaf 100644 --- a/examples/jms/stomp1.2/pom.xml +++ b/examples/jms/stomp1.2/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.StompExample - - tcp://localhost:5445 - @@ -107,7 +104,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/stomp1.2/src/main/java/org/apache/activemq/jms/example/StompExample.java b/examples/jms/stomp1.2/src/main/java/org/apache/activemq/jms/example/StompExample.java index 7b21107af2..f9faf729d2 100644 --- a/examples/jms/stomp1.2/src/main/java/org/apache/activemq/jms/example/StompExample.java +++ b/examples/jms/stomp1.2/src/main/java/org/apache/activemq/jms/example/StompExample.java @@ -94,7 +94,7 @@ public class StompExample extends ActiveMQExample // We will now consume from JMS the message sent with Stomp. // Step 6. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 7. Perform a lookup on the queue and the connection factory Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/stomp1.2/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/stomp1.2/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 89% rename from examples/jms/stomp1.2/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/stomp1.2/src/main/resources/activemq/server0/activemq-configuration.xml index 0188165c26..1b68cd8b02 100644 --- a/examples/jms/stomp1.2/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/stomp1.2/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,15 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/transaction-failover/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/stomp1.2/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/transaction-failover/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/stomp1.2/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/stop-server-failover/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/stomp1.2/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/stop-server-failover/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/stomp1.2/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/stomp1.2/src/main/resources/jndi.properties b/examples/jms/stomp1.2/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/stomp1.2/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/stop-server-failover/pom.xml b/examples/jms/stop-server-failover/pom.xml index 366ebfc621..60ae76bc2c 100644 --- a/examples/jms/stop-server-failover/pom.xml +++ b/examples/jms/stop-server-failover/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -57,7 +57,7 @@ 1199 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -96,7 +96,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -105,7 +105,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/stop-server-failover/src/main/java/org/apache/activemq/jms/example/StopServerFailoverExample.java b/examples/jms/stop-server-failover/src/main/java/org/apache/activemq/jms/example/StopServerFailoverExample.java index e5e669127e..a5e9eb4679 100644 --- a/examples/jms/stop-server-failover/src/main/java/org/apache/activemq/jms/example/StopServerFailoverExample.java +++ b/examples/jms/stop-server-failover/src/main/java/org/apache/activemq/jms/example/StopServerFailoverExample.java @@ -53,7 +53,7 @@ public class StopServerFailoverExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from the server #1 - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look up the JMS resources from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); @@ -98,7 +98,7 @@ public class StopServerFailoverExample extends ActiveMQExample // Step 10. Crash server #1, the live server, and wait a little while to make sure // it has really crashed - Thread.sleep(2000); + Thread.sleep(5000); System.out.println("stop the server by logging into jconsole"); System.in.read(); diff --git a/examples/jms/stop-server-failover/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/stop-server-failover/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/stop-server-failover/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/stop-server-failover/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/transaction-failover/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/stop-server-failover/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/transaction-failover/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/stop-server-failover/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/stop-server-failover/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/stop-server-failover/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/stop-server-failover/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/stop-server-failover/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/stop-server-failover/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/stop-server-failover/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/stop-server-failover/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/stop-server-failover/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/xa-heuristic/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/stop-server-failover/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/xa-heuristic/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/stop-server-failover/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/stop-server-failover/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/stop-server-failover/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/stop-server-failover/src/main/resources/jndi.properties b/examples/jms/stop-server-failover/src/main/resources/jndi.properties new file mode 100644 index 0000000000..8fda7c0024 --- /dev/null +++ b/examples/jms/stop-server-failover/src/main/resources/jndi.properties @@ -0,0 +1,7 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.ha=true +connection.ConnectionFactory.retryInterval=1000 +connection.ConnectionFactory.retryIntervalMultiplier=1.0 +connection.ConnectionFactory.reconnectAttempts=-1 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/symmetric-cluster/pom.xml b/examples/jms/symmetric-cluster/pom.xml index 585c5c44b5..c23df88f90 100644 --- a/examples/jms/symmetric-cluster/pom.xml +++ b/examples/jms/symmetric-cluster/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -57,7 +57,7 @@ 1199 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -79,7 +79,7 @@ 1299 1298 - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 true @@ -101,7 +101,7 @@ 1399 1398 - ${basedir}/target/classes/activemq/server3 + ${basedir}/target/classes/activemq/server3 true @@ -123,7 +123,7 @@ 1499 1498 - ${basedir}/target/classes/activemq/server4 + ${basedir}/target/classes/activemq/server4 true @@ -145,7 +145,7 @@ 1599 1598 - ${basedir}/target/classes/activemq/server5 + ${basedir}/target/classes/activemq/server5 true @@ -188,7 +188,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -197,7 +197,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 @@ -206,7 +206,7 @@ stop - ${basedir}/target/classes/activemq/server2 + ${basedir}/target/classes/activemq/server2 @@ -215,7 +215,7 @@ stop - ${basedir}/target/classes/activemq/server3 + ${basedir}/target/classes/activemq/server3 @@ -224,7 +224,7 @@ stop - ${basedir}/target/classes/activemq/server4 + ${basedir}/target/classes/activemq/server4 @@ -233,7 +233,7 @@ stop - ${basedir}/target/classes/activemq/server5 + ${basedir}/target/classes/activemq/server5 diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server1/activemq-jms.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server2/activemq-users.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server2/activemq-users.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server2/activemq-configuration.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server2/activemq-configuration.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server2/activemq-configuration.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server2/activemq-configuration.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server2/activemq-jms.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server2/activemq-jms.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server2/activemq-jms.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server2/activemq-jms.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server3/activemq-users.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server2/activemq-users.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server3/activemq-users.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server2/activemq-users.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server3/activemq-configuration.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server3/activemq-configuration.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server3/activemq-configuration.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server3/activemq-configuration.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server3/activemq-jms.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server3/activemq-jms.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server3/activemq-jms.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server3/activemq-jms.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server4/activemq-users.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server3/activemq-users.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server4/activemq-users.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server3/activemq-users.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server4/activemq-configuration.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server4/activemq-configuration.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server4/activemq-configuration.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server4/activemq-configuration.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server4/activemq-jms.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server4/activemq-jms.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server4/activemq-jms.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server4/activemq-jms.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server5/activemq-users.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server4/activemq-users.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server5/activemq-users.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server4/activemq-users.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server5/activemq-configuration.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server5/activemq-configuration.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server5/activemq-configuration.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server5/activemq-configuration.xml diff --git a/examples/jms/symmetric-cluster/src/main/resources/hornetq/server5/activemq-jms.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server5/activemq-jms.xml similarity index 100% rename from examples/jms/symmetric-cluster/src/main/resources/hornetq/server5/activemq-jms.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server5/activemq-jms.xml diff --git a/examples/jms/temp-queue/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server5/activemq-users.xml similarity index 100% rename from examples/jms/temp-queue/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/symmetric-cluster/src/main/resources/activemq/server5/activemq-users.xml diff --git a/examples/jms/temp-queue/pom.xml b/examples/jms/temp-queue/pom.xml index c1649f1e3c..59dc9177d4 100644 --- a/examples/jms/temp-queue/pom.xml +++ b/examples/jms/temp-queue/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.TemporaryQueueExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/temp-queue/src/main/java/org/apache/activemq/jms/example/TemporaryQueueExample.java b/examples/jms/temp-queue/src/main/java/org/apache/activemq/jms/example/TemporaryQueueExample.java index 55b6438e51..8dfcc1db93 100644 --- a/examples/jms/temp-queue/src/main/java/org/apache/activemq/jms/example/TemporaryQueueExample.java +++ b/examples/jms/temp-queue/src/main/java/org/apache/activemq/jms/example/TemporaryQueueExample.java @@ -48,7 +48,7 @@ public class TemporaryQueueExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look-up the JMS connection factory ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory"); diff --git a/examples/jms/temp-queue/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/temp-queue/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/temp-queue/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/temp-queue/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/temp-queue/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/temp-queue/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/temp-queue/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/temp-queue/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/topic-hierarchies/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/temp-queue/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/topic-hierarchies/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/temp-queue/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/temp-queue/src/main/resources/jndi.properties b/examples/jms/temp-queue/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/temp-queue/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/topic-hierarchies/pom.xml b/examples/jms/topic-hierarchies/pom.xml index dd1b6d9ef0..2974a78494 100644 --- a/examples/jms/topic-hierarchies/pom.xml +++ b/examples/jms/topic-hierarchies/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.TopicHierarchyExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/topic-hierarchies/src/main/java/org/apache/activemq/jms/example/TopicHierarchyExample.java b/examples/jms/topic-hierarchies/src/main/java/org/apache/activemq/jms/example/TopicHierarchyExample.java index 8fff1593c2..2a7d7b7044 100644 --- a/examples/jms/topic-hierarchies/src/main/java/org/apache/activemq/jms/example/TopicHierarchyExample.java +++ b/examples/jms/topic-hierarchies/src/main/java/org/apache/activemq/jms/example/TopicHierarchyExample.java @@ -51,7 +51,7 @@ public class TopicHierarchyExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 3. Perform a lookup on the Connection Factory ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory"); diff --git a/examples/jms/topic-hierarchies/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/topic-hierarchies/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/topic-hierarchies/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/topic-hierarchies/src/main/resources/activemq/server0/activemq-configuration.xml index 2fe40d991c..c4d93e0df9 100644 --- a/examples/jms/topic-hierarchies/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/topic-hierarchies/src/main/resources/activemq/server0/activemq-configuration.xml @@ -10,15 +10,6 @@ ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - diff --git a/examples/jms/topic-hierarchies/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/topic-hierarchies/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/topic-hierarchies/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/topic-hierarchies/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/topic-selector-example1/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/topic-hierarchies/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/topic-selector-example1/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/topic-hierarchies/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/dead-letter/src/main/resources/hornetq/server0/client-jndi.properties b/examples/jms/topic-hierarchies/src/main/resources/jndi.properties similarity index 100% rename from examples/jms/dead-letter/src/main/resources/hornetq/server0/client-jndi.properties rename to examples/jms/topic-hierarchies/src/main/resources/jndi.properties diff --git a/examples/jms/topic-selector-example1/pom.xml b/examples/jms/topic-selector-example1/pom.xml index 1779b3b5f3..5a94a8aab5 100644 --- a/examples/jms/topic-selector-example1/pom.xml +++ b/examples/jms/topic-selector-example1/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.TopicSelectorExample1 - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/topic-selector-example1/src/main/java/org/apache/activemq/jms/example/TopicSelectorExample1.java b/examples/jms/topic-selector-example1/src/main/java/org/apache/activemq/jms/example/TopicSelectorExample1.java index 9cda2da95d..95631ce516 100644 --- a/examples/jms/topic-selector-example1/src/main/java/org/apache/activemq/jms/example/TopicSelectorExample1.java +++ b/examples/jms/topic-selector-example1/src/main/java/org/apache/activemq/jms/example/TopicSelectorExample1.java @@ -49,7 +49,7 @@ public class TopicSelectorExample1 extends ActiveMQExample { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look-up the JMS topic Topic topic = (Topic)initialContext.lookup("topic/exampleTopic"); diff --git a/examples/jms/topic-selector-example1/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/topic-selector-example1/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/topic-selector-example1/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/topic-selector-example1/src/main/resources/activemq/server0/activemq-configuration.xml index 0f134f2928..7e6a27debc 100644 --- a/examples/jms/topic-selector-example1/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/topic-selector-example1/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/topic-selector-example1/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/topic-selector-example1/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/topic-selector-example1/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/topic-selector-example1/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/topic-selector-example2/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/topic-selector-example1/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/topic-selector-example2/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/topic-selector-example1/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/topic-selector-example1/src/main/resources/jndi.properties b/examples/jms/topic-selector-example1/src/main/resources/jndi.properties new file mode 100644 index 0000000000..4faa7906e4 --- /dev/null +++ b/examples/jms/topic-selector-example1/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +topic.topic/exampleTopic=exampleTopic \ No newline at end of file diff --git a/examples/jms/topic-selector-example2/pom.xml b/examples/jms/topic-selector-example2/pom.xml index 8f43b603ee..1738558450 100644 --- a/examples/jms/topic-selector-example2/pom.xml +++ b/examples/jms/topic-selector-example2/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.TopicSelectorExample2 - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/topic-selector-example2/src/main/java/org/apache/activemq/jms/example/TopicSelectorExample2.java b/examples/jms/topic-selector-example2/src/main/java/org/apache/activemq/jms/example/TopicSelectorExample2.java index e322ea17d8..49ab3f442f 100644 --- a/examples/jms/topic-selector-example2/src/main/java/org/apache/activemq/jms/example/TopicSelectorExample2.java +++ b/examples/jms/topic-selector-example2/src/main/java/org/apache/activemq/jms/example/TopicSelectorExample2.java @@ -52,7 +52,7 @@ public class TopicSelectorExample2 extends ActiveMQExample try { // /Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. perform a lookup on the topic Topic topic = (Topic)initialContext.lookup("topic/exampleTopic"); diff --git a/examples/jms/topic/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/topic-selector-example2/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/topic/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/topic-selector-example2/src/main/resources/activemq/server0/activemq-configuration.xml index 0f134f2928..7e6a27debc 100644 --- a/examples/jms/topic/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/topic-selector-example2/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/topic-selector-example2/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/topic-selector-example2/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/topic-selector-example2/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/topic-selector-example2/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/topic/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/topic-selector-example2/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/topic/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/topic-selector-example2/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/topic-selector-example2/src/main/resources/jndi.properties b/examples/jms/topic-selector-example2/src/main/resources/jndi.properties new file mode 100644 index 0000000000..4faa7906e4 --- /dev/null +++ b/examples/jms/topic-selector-example2/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +topic.topic/exampleTopic=exampleTopic \ No newline at end of file diff --git a/examples/jms/topic/pom.xml b/examples/jms/topic/pom.xml index f7b848676f..3511f518b5 100644 --- a/examples/jms/topic/pom.xml +++ b/examples/jms/topic/pom.xml @@ -102,7 +102,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/topic/src/main/java/org/apache/activemq/jms/example/TopicExample.java b/examples/jms/topic/src/main/java/org/apache/activemq/jms/example/TopicExample.java index c7296384c4..0d37e659db 100644 --- a/examples/jms/topic/src/main/java/org/apache/activemq/jms/example/TopicExample.java +++ b/examples/jms/topic/src/main/java/org/apache/activemq/jms/example/TopicExample.java @@ -47,7 +47,7 @@ public class TopicExample extends ActiveMQExample try { // /Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. perform a lookup on the topic Topic topic = (Topic)initialContext.lookup("topic/exampleTopic"); diff --git a/examples/jms/topic-selector-example2/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/topic/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/topic-selector-example2/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/topic/src/main/resources/activemq/server0/activemq-configuration.xml index 0f134f2928..7e6a27debc 100644 --- a/examples/jms/topic-selector-example2/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/topic/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/topic/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/topic/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/topic/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/topic/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/transaction-failover/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/topic/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/transaction-failover/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/topic/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/topic/src/main/resources/jndi.properties b/examples/jms/topic/src/main/resources/jndi.properties new file mode 100644 index 0000000000..4faa7906e4 --- /dev/null +++ b/examples/jms/topic/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +topic.topic/exampleTopic=exampleTopic \ No newline at end of file diff --git a/examples/jms/transaction-failover/pom.xml b/examples/jms/transaction-failover/pom.xml index 177667e188..d5c3b11a5e 100644 --- a/examples/jms/transaction-failover/pom.xml +++ b/examples/jms/transaction-failover/pom.xml @@ -36,7 +36,7 @@ start - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 build.directory @@ -55,9 +55,7 @@ start - 1199 - 1198 - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 true @@ -78,10 +76,6 @@ org.apache.activemq.jms.example.TransactionFailoverExample - - tcp://localhost:5445 - tcp://localhost:5446 - exampleConfigDir @@ -96,7 +90,7 @@ stop - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 @@ -105,7 +99,7 @@ stop - ${basedir}/target/classes/activemq/server1 + ${basedir}/target/classes/activemq/server1 diff --git a/examples/jms/transaction-failover/src/main/java/org/apache/activemq/jms/example/TransactionFailoverExample.java b/examples/jms/transaction-failover/src/main/java/org/apache/activemq/jms/example/TransactionFailoverExample.java index 3f31b6e2fb..d9cbd95fbc 100644 --- a/examples/jms/transaction-failover/src/main/java/org/apache/activemq/jms/example/TransactionFailoverExample.java +++ b/examples/jms/transaction-failover/src/main/java/org/apache/activemq/jms/example/TransactionFailoverExample.java @@ -54,7 +54,7 @@ public class TransactionFailoverExample extends ActiveMQExample try { // Step 1. Get an initial context for looking up JNDI from the server #1 - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look-up the JMS resources from JNDI Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); @@ -155,7 +155,7 @@ public class TransactionFailoverExample extends ActiveMQExample if (killServer) { - Thread.sleep(2000); + Thread.sleep(5000); killServer(0); diff --git a/examples/jms/transaction-failover/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/transaction-failover/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 100% rename from examples/jms/transaction-failover/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/transaction-failover/src/main/resources/activemq/server0/activemq-configuration.xml diff --git a/examples/jms/xa-receive/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/transaction-failover/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/xa-receive/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/transaction-failover/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/transaction-failover/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/transaction-failover/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/transaction-failover/src/main/resources/hornetq/server1/activemq-users.xml rename to examples/jms/transaction-failover/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/transaction-failover/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/transaction-failover/src/main/resources/activemq/server1/activemq-configuration.xml similarity index 100% rename from examples/jms/transaction-failover/src/main/resources/hornetq/server1/activemq-configuration.xml rename to examples/jms/transaction-failover/src/main/resources/activemq/server1/activemq-configuration.xml diff --git a/examples/jms/xa-send/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/transaction-failover/src/main/resources/activemq/server1/activemq-jms.xml similarity index 100% rename from examples/jms/xa-send/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/transaction-failover/src/main/resources/activemq/server1/activemq-jms.xml diff --git a/examples/jms/transactional/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/transaction-failover/src/main/resources/activemq/server1/activemq-users.xml similarity index 100% rename from examples/jms/transactional/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/transaction-failover/src/main/resources/activemq/server1/activemq-users.xml diff --git a/examples/jms/transaction-failover/src/main/resources/jndi.properties b/examples/jms/transaction-failover/src/main/resources/jndi.properties new file mode 100644 index 0000000000..8fda7c0024 --- /dev/null +++ b/examples/jms/transaction-failover/src/main/resources/jndi.properties @@ -0,0 +1,7 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connection.ConnectionFactory.ha=true +connection.ConnectionFactory.retryInterval=1000 +connection.ConnectionFactory.retryIntervalMultiplier=1.0 +connection.ConnectionFactory.reconnectAttempts=-1 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/transactional/pom.xml b/examples/jms/transactional/pom.xml index fd165b6f5e..42738abcab 100644 --- a/examples/jms/transactional/pom.xml +++ b/examples/jms/transactional/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.TransactionalExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/transactional/src/main/java/org/apache/activemq/jms/example/TransactionalExample.java b/examples/jms/transactional/src/main/java/org/apache/activemq/jms/example/TransactionalExample.java index d23f6b10a4..06defdd1fa 100644 --- a/examples/jms/transactional/src/main/java/org/apache/activemq/jms/example/TransactionalExample.java +++ b/examples/jms/transactional/src/main/java/org/apache/activemq/jms/example/TransactionalExample.java @@ -47,7 +47,7 @@ public class TransactionalExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Look-up the JMS topic Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/xa-receive/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/transactional/src/main/resources/activemq/server0/activemq-configuration.xml similarity index 85% rename from examples/jms/xa-receive/src/main/resources/hornetq/server0/activemq-configuration.xml rename to examples/jms/transactional/src/main/resources/activemq/server0/activemq-configuration.xml index 8ef5e46935..5d9a6715be 100644 --- a/examples/jms/xa-receive/src/main/resources/hornetq/server0/activemq-configuration.xml +++ b/examples/jms/transactional/src/main/resources/activemq/server0/activemq-configuration.xml @@ -9,14 +9,6 @@ ${build.directory}/server0/data/messaging/largemessages ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - diff --git a/examples/jms/transactional/src/main/resources/activemq/server0/activemq-jms.xml b/examples/jms/transactional/src/main/resources/activemq/server0/activemq-jms.xml new file mode 100644 index 0000000000..847659f7ad --- /dev/null +++ b/examples/jms/transactional/src/main/resources/activemq/server0/activemq-jms.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/examples/jms/xa-heuristic/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/transactional/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/xa-heuristic/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/transactional/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/transactional/src/main/resources/jndi.properties b/examples/jms/transactional/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/transactional/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/xa-heuristic/pom.xml b/examples/jms/xa-heuristic/pom.xml index 38e545e2c0..8f7bc603de 100644 --- a/examples/jms/xa-heuristic/pom.xml +++ b/examples/jms/xa-heuristic/pom.xml @@ -74,9 +74,6 @@ org.apache.activemq.jms.example.XAHeuristicExample - - tcp://localhost:5445 - @@ -125,7 +122,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/jms/example/XAHeuristicExample.java b/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/jms/example/XAHeuristicExample.java index 3a70346bb7..071f63f562 100644 --- a/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/jms/example/XAHeuristicExample.java +++ b/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/jms/example/XAHeuristicExample.java @@ -71,7 +71,7 @@ public class XAHeuristicExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/xa-heuristic/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/xa-heuristic/src/main/resources/activemq/server0/activemq-configuration.xml new file mode 100644 index 0000000000..5d9a6715be --- /dev/null +++ b/examples/jms/xa-heuristic/src/main/resources/activemq/server0/activemq-configuration.xml @@ -0,0 +1,34 @@ + + + ${build.directory}/server0/data/messaging/bindings + + ${build.directory}/server0/data/messaging/journal + + ${build.directory}/server0/data/messaging/largemessages + + ${build.directory}/server0/data/messaging/paging + + + + + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + + + + + + + + + + + + + + + + + + diff --git a/examples/jms/xa-with-jta/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/xa-heuristic/src/main/resources/activemq/server0/activemq-jms.xml similarity index 100% rename from examples/jms/xa-with-jta/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/xa-heuristic/src/main/resources/activemq/server0/activemq-jms.xml diff --git a/examples/jms/xa-receive/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/xa-heuristic/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/xa-receive/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/xa-heuristic/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/xa-heuristic/src/main/resources/jndi.properties b/examples/jms/xa-heuristic/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/xa-heuristic/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/xa-receive/pom.xml b/examples/jms/xa-receive/pom.xml index 0fddd12a31..08b7b55cca 100644 --- a/examples/jms/xa-receive/pom.xml +++ b/examples/jms/xa-receive/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.XAReceiveExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/xa-receive/src/main/java/org/apache/activemq/jms/example/XAReceiveExample.java b/examples/jms/xa-receive/src/main/java/org/apache/activemq/jms/example/XAReceiveExample.java index 87e92f5872..11894ccd73 100644 --- a/examples/jms/xa-receive/src/main/java/org/apache/activemq/jms/example/XAReceiveExample.java +++ b/examples/jms/xa-receive/src/main/java/org/apache/activemq/jms/example/XAReceiveExample.java @@ -56,7 +56,7 @@ public class XAReceiveExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/xa-receive/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/xa-receive/src/main/resources/activemq/server0/activemq-configuration.xml new file mode 100644 index 0000000000..5d9a6715be --- /dev/null +++ b/examples/jms/xa-receive/src/main/resources/activemq/server0/activemq-configuration.xml @@ -0,0 +1,34 @@ + + + ${build.directory}/server0/data/messaging/bindings + + ${build.directory}/server0/data/messaging/journal + + ${build.directory}/server0/data/messaging/largemessages + + ${build.directory}/server0/data/messaging/paging + + + + + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + + + + + + + + + + + + + + + + + + diff --git a/examples/jms/jmx/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/xa-receive/src/main/resources/activemq/server0/activemq-jms.xml similarity index 95% rename from examples/jms/jmx/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/xa-receive/src/main/resources/activemq/server0/activemq-jms.xml index b53cafef62..0d5c9537fb 100644 --- a/examples/jms/jmx/src/main/resources/hornetq/server0/activemq-jms.xml +++ b/examples/jms/xa-receive/src/main/resources/activemq/server0/activemq-jms.xml @@ -4,6 +4,5 @@ - diff --git a/examples/jms/xa-send/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/xa-receive/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/xa-send/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/xa-receive/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/xa-receive/src/main/resources/jndi.properties b/examples/jms/xa-receive/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/xa-receive/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/xa-send/pom.xml b/examples/jms/xa-send/pom.xml index 2e4fadb6b4..a6df573f5d 100644 --- a/examples/jms/xa-send/pom.xml +++ b/examples/jms/xa-send/pom.xml @@ -51,9 +51,6 @@ org.apache.activemq.jms.example.XASendExample - - tcp://localhost:5445 - @@ -102,7 +99,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/xa-send/src/main/java/org/apache/activemq/jms/example/XASendExample.java b/examples/jms/xa-send/src/main/java/org/apache/activemq/jms/example/XASendExample.java index b5928262f4..923db20ffd 100644 --- a/examples/jms/xa-send/src/main/java/org/apache/activemq/jms/example/XASendExample.java +++ b/examples/jms/xa-send/src/main/java/org/apache/activemq/jms/example/XASendExample.java @@ -62,7 +62,7 @@ public class XASendExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/xa-send/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/xa-send/src/main/resources/activemq/server0/activemq-configuration.xml new file mode 100644 index 0000000000..5d9a6715be --- /dev/null +++ b/examples/jms/xa-send/src/main/resources/activemq/server0/activemq-configuration.xml @@ -0,0 +1,34 @@ + + + ${build.directory}/server0/data/messaging/bindings + + ${build.directory}/server0/data/messaging/journal + + ${build.directory}/server0/data/messaging/largemessages + + ${build.directory}/server0/data/messaging/paging + + + + + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + + + + + + + + + + + + + + + + + + diff --git a/examples/jms/aerogear/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/xa-send/src/main/resources/activemq/server0/activemq-jms.xml similarity index 87% rename from examples/jms/aerogear/src/main/resources/hornetq/server0/activemq-jms.xml rename to examples/jms/xa-send/src/main/resources/activemq/server0/activemq-jms.xml index 24832553a0..0d5c9537fb 100644 --- a/examples/jms/aerogear/src/main/resources/hornetq/server0/activemq-jms.xml +++ b/examples/jms/xa-send/src/main/resources/activemq/server0/activemq-jms.xml @@ -3,6 +3,6 @@ xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - + diff --git a/examples/jms/xa-with-jta/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/xa-send/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/xa-with-jta/src/main/resources/hornetq/server0/activemq-users.xml rename to examples/jms/xa-send/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/xa-send/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/xa-send/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index 8ef5e46935..0000000000 --- a/examples/jms/xa-send/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - - - - - - - - - - - - - - diff --git a/examples/jms/xa-send/src/main/resources/jndi.properties b/examples/jms/xa-send/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/xa-send/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/jms/xa-with-jta/pom.xml b/examples/jms/xa-with-jta/pom.xml index 9410de33f7..4533189e78 100644 --- a/examples/jms/xa-with-jta/pom.xml +++ b/examples/jms/xa-with-jta/pom.xml @@ -31,6 +31,11 @@ jbossjta 4.16.4.Final + + org.apache.geronimo.specs + geronimo-jta_1.1_spec + 1.1.1 + @@ -60,9 +65,6 @@ org.apache.activemq.jms.example.XAwithJTAExample - - tcp://localhost:5445 - @@ -111,7 +113,7 @@ false - ${basedir}/target/classes/activemq/server0 + ${basedir}/target/classes/activemq/server0 diff --git a/examples/jms/xa-with-jta/src/main/java/org/apache/activemq/jms/example/XAwithJTAExample.java b/examples/jms/xa-with-jta/src/main/java/org/apache/activemq/jms/example/XAwithJTAExample.java index 1ec8b40e9f..ed181ca667 100644 --- a/examples/jms/xa-with-jta/src/main/java/org/apache/activemq/jms/example/XAwithJTAExample.java +++ b/examples/jms/xa-with-jta/src/main/java/org/apache/activemq/jms/example/XAwithJTAExample.java @@ -56,7 +56,7 @@ public class XAwithJTAExample extends ActiveMQExample try { // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = getContext(0); + initialContext = new InitialContext(); // Step 2. Lookup on the queue Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); diff --git a/examples/jms/xa-with-jta/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/xa-with-jta/src/main/resources/activemq/server0/activemq-configuration.xml new file mode 100644 index 0000000000..5d9a6715be --- /dev/null +++ b/examples/jms/xa-with-jta/src/main/resources/activemq/server0/activemq-configuration.xml @@ -0,0 +1,34 @@ + + + ${build.directory}/server0/data/messaging/bindings + + ${build.directory}/server0/data/messaging/journal + + ${build.directory}/server0/data/messaging/largemessages + + ${build.directory}/server0/data/messaging/paging + + + + + org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory + + + + + + + + + + + + + + + + + + diff --git a/examples/jms/xa-with-jta/src/main/resources/activemq/server0/activemq-jms.xml b/examples/jms/xa-with-jta/src/main/resources/activemq/server0/activemq-jms.xml new file mode 100644 index 0000000000..0d5c9537fb --- /dev/null +++ b/examples/jms/xa-with-jta/src/main/resources/activemq/server0/activemq-jms.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/examples/jms/jms-bridge/src/main/resources/hornetq/server0/hornetq-users.xml b/examples/jms/xa-with-jta/src/main/resources/activemq/server0/activemq-users.xml similarity index 100% rename from examples/jms/jms-bridge/src/main/resources/hornetq/server0/hornetq-users.xml rename to examples/jms/xa-with-jta/src/main/resources/activemq/server0/activemq-users.xml diff --git a/examples/jms/xa-with-jta/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/xa-with-jta/src/main/resources/hornetq/server0/activemq-configuration.xml deleted file mode 100644 index 8ef5e46935..0000000000 --- a/examples/jms/xa-with-jta/src/main/resources/hornetq/server0/activemq-configuration.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - ${build.directory}/server0/data/messaging/bindings - - ${build.directory}/server0/data/messaging/journal - - ${build.directory}/server0/data/messaging/largemessages - - ${build.directory}/server0/data/messaging/paging - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory - - - - - - - org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory - - - - - - - - - - - - - - - - - - diff --git a/examples/jms/xa-with-jta/src/main/resources/jndi.properties b/examples/jms/xa-with-jta/src/main/resources/jndi.properties new file mode 100644 index 0000000000..d9b5c6ae23 --- /dev/null +++ b/examples/jms/xa-with-jta/src/main/resources/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +queue.queue/exampleQueue=exampleQueue \ No newline at end of file diff --git a/examples/soak/normal/pom.xml b/examples/soak/normal/pom.xml index a33fdfefe9..2c0a133c03 100644 --- a/examples/soak/normal/pom.xml +++ b/examples/soak/normal/pom.xml @@ -83,7 +83,7 @@ true - ${server.dir} + ${server.dir} @@ -116,7 +116,7 @@ stop - ${server.dir} + ${server.dir} @@ -175,7 +175,7 @@ start - ${server.dir} + ${server.dir} true true diff --git a/pom.xml b/pom.xml index 315865fb91..1e2ba339bf 100644 --- a/pom.xml +++ b/pom.xml @@ -455,6 +455,7 @@ activemq-rest activemq-tools activemq-service-extensions + activemq-maven-plugin integration/activemq-spring-integration integration/activemq-aerogear-integration @@ -506,6 +507,7 @@ activemq-rest activemq-tools activemq-service-extensions + activemq-maven-plugin integration/activemq-spring-integration integration/activemq-aerogear-integration integration/activemq-vertx-integration @@ -532,6 +534,7 @@ activemq-rest activemq-tools activemq-service-extensions + activemq-maven-plugin integration/activemq-spring-integration integration/activemq-aerogear-integration integration/activemq-vertx-integration @@ -569,6 +572,7 @@ activemq-rest activemq-tools activemq-service-extensions + activemq-maven-plugin integration/activemq-spring-integration integration/activemq-aerogear-integration integration/activemq-vertx-integration @@ -602,6 +606,7 @@ activemq-rest activemq-tools activemq-service-extensions + activemq-maven-plugin integration/activemq-spring-integration integration/activemq-aerogear-integration integration/activemq-vertx-integration @@ -762,7 +767,7 @@ org.apache.activemq activemq-maven-plugin - 1.2.0 + 6.0.0-SNAPSHOT