Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4D334175E6 for ; Mon, 31 Aug 2015 18:50:43 +0000 (UTC) Received: (qmail 63878 invoked by uid 500); 31 Aug 2015 18:50:43 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 63837 invoked by uid 500); 31 Aug 2015 18:50:43 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 63828 invoked by uid 99); 31 Aug 2015 18:50:43 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Aug 2015 18:50:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C9EE5E0244; Mon, 31 Aug 2015 18:50:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: clebertsuconic@apache.org To: commits@activemq.apache.org Message-Id: <0c8224bd01ad4bcb854194e80ed92562@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: activemq-artemis git commit: small improvement on topic hierarchies example Date: Mon, 31 Aug 2015 18:50:42 +0000 (UTC) Repository: activemq-artemis Updated Branches: refs/heads/master 1642a856c -> ce924b7ef small improvement on topic hierarchies example Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/ce924b7e Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/ce924b7e Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/ce924b7e Branch: refs/heads/master Commit: ce924b7ef039e9d10ebd52bc98aef35fa33a359d Parents: 1642a85 Author: Clebert Suconic Authored: Mon Aug 31 12:36:37 2015 -0400 Committer: Clebert Suconic Committed: Mon Aug 31 14:48:41 2015 -0400 ---------------------------------------------------------------------- .../features/standard/topic-hierarchies/pom.xml | 4 ++ .../jms/example/TopicHierarchyExample.java | 12 +--- .../main/resources/activemq/server0/broker.xml | 71 -------------------- .../src/main/resources/jndi.properties | 19 ------ 4 files changed, 6 insertions(+), 100 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ce924b7e/examples/features/standard/topic-hierarchies/pom.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/topic-hierarchies/pom.xml b/examples/features/standard/topic-hierarchies/pom.xml index e3fe3f8..3ebca91 100644 --- a/examples/features/standard/topic-hierarchies/pom.xml +++ b/examples/features/standard/topic-hierarchies/pom.xml @@ -57,6 +57,10 @@ under the License. ${noServer} + + --topics + news,news.usa,news.usa.wrestling,news.europe,news.europe.sport,news.europe.entertainment + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ce924b7e/examples/features/standard/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java b/examples/features/standard/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java index 0a720da..5b9a084 100644 --- a/examples/features/standard/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java +++ b/examples/features/standard/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java @@ -24,9 +24,9 @@ import javax.jms.MessageProducer; import javax.jms.Session; import javax.jms.TextMessage; import javax.jms.Topic; -import javax.naming.InitialContext; import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; +import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; /** * This example demonstrates how a JMS TopicSubscriber can be created to subscribe to a wild-card Topic. @@ -37,13 +37,8 @@ public class TopicHierarchyExample { public static void main(final String[] args) throws Exception { Connection connection = null; - InitialContext initialContext = null; try { - // Step 1. Create an initial context to perform the JNDI lookup. - initialContext = new InitialContext(); - - // Step 3. Perform a lookup on the Connection Factory - ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory"); + ConnectionFactory cf = new ActiveMQConnectionFactory(); // Step 4. Create a JMS Connection connection = cf.createConnection(); @@ -110,9 +105,6 @@ public class TopicHierarchyExample { } finally { // Step 12. Be sure to close our resources! - if (initialContext != null) { - initialContext.close(); - } if (connection != null) { connection.close(); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ce924b7e/examples/features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml deleted file mode 100644 index 9ec66c6..0000000 --- a/examples/features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - ./data/bindings - - ./data/journal - - ./data/largemessages - - ./data/paging - - - - tcp://localhost:61616 - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ce924b7e/examples/features/standard/topic-hierarchies/src/main/resources/jndi.properties ---------------------------------------------------------------------- diff --git a/examples/features/standard/topic-hierarchies/src/main/resources/jndi.properties b/examples/features/standard/topic-hierarchies/src/main/resources/jndi.properties deleted file mode 100644 index 5cbe72c..0000000 --- a/examples/features/standard/topic-hierarchies/src/main/resources/jndi.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory -connectionFactory.ConnectionFactory=tcp://localhost:61616