activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1390775 [1/2] - in /activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire: ./ jms-example-composite-destinations/ jms-example-composite-destinations/src/ jms-example-composite-destinations/src/main/ jms-example-co...
Date Wed, 26 Sep 2012 23:26:20 GMT
Author: chirino
Date: Wed Sep 26 23:26:16 2012
New Revision: 1390775

URL: http://svn.apache.org/viewvc?rev=1390775&view=rev
Log:
Fixes APLO-262: Adding Christian Posta's Openwire Examples to the distribution.

Added:
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/pom.xml
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/readme.md
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/java/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/java/example/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/java/example/composite/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/java/example/composite/dest/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/java/example/composite/dest/Consumer.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/java/example/composite/dest/Producer.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/pom.xml
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/readme.md
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/java/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/java/example/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/java/example/topic/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/java/example/topic/durable/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/java/example/topic/durable/Publisher.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/java/example/topic/durable/Subscriber.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/pom.xml
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/readme.md
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/java/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/java/example/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/java/example/queue/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/java/example/queue/exclusive/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/java/example/queue/exclusive/Consumer.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/java/example/queue/exclusive/Producer.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/pom.xml
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/readme.md
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/main/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/main/java/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/main/java/example/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/main/java/example/browser/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/main/java/example/browser/Browser.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/main/java/example/browser/Producer.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/pom.xml
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/readme.md
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/java/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/java/example/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/java/example/queue/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/java/example/queue/selector/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/java/example/queue/selector/Consumer.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/java/example/queue/selector/Producer.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/pom.xml
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/readme.md
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/src/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/src/main/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/src/main/java/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/src/main/java/example/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/src/main/java/example/queue/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/src/main/java/example/queue/Consumer.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/src/main/java/example/queue/Producer.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/src/main/resources/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/src/main/resources/log4j.properties
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-temp-destinations/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-temp-destinations/pom.xml
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-temp-destinations/readme.md
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-temp-destinations/src/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-temp-destinations/src/main/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-temp-destinations/src/main/java/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-temp-destinations/src/main/java/example/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-temp-destinations/src/main/java/example/tempdest/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-temp-destinations/src/main/java/example/tempdest/Consumer.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-temp-destinations/src/main/java/example/tempdest/ProducerRequestReply.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-topic/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-topic/pom.xml
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-topic/readme.md
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-topic/src/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-topic/src/main/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-topic/src/main/java/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-topic/src/main/java/example/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-topic/src/main/java/example/topic/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-topic/src/main/java/example/topic/Publisher.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-topic/src/main/java/example/topic/Subscriber.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-topic/src/main/resources/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-topic/src/main/resources/log4j.properties
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-transaction/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-transaction/pom.xml
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-transaction/readme.md
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-transaction/src/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-transaction/src/main/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-transaction/src/main/java/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-transaction/src/main/java/example/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-transaction/src/main/java/example/transaction/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-transaction/src/main/java/example/transaction/Client.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-util/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-util/pom.xml
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-util/src/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-util/src/main/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-util/src/main/java/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-util/src/main/java/example/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-util/src/main/java/example/util/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-util/src/main/java/example/util/Util.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-wildcard-consumer/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-wildcard-consumer/pom.xml
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-wildcard-consumer/readme.md
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-wildcard-consumer/src/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-wildcard-consumer/src/main/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-wildcard-consumer/src/main/java/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-wildcard-consumer/src/main/java/example/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-wildcard-consumer/src/main/java/example/wildcard/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-wildcard-consumer/src/main/java/example/wildcard/Client.java
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/pom.xml   (with props)
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/readme.md

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/pom.xml?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/pom.xml (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/pom.xml Wed Sep 26 23:26:16 2012
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>openwire-example</artifactId>
+        <groupId>example</groupId>
+        <version>0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>jms-example-composite-destinations</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>jms-example-util</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    <profiles>
+        <profile>
+            <id>consumer</id>
+            <build>
+                <defaultGoal>package</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>example.composite.dest.Consumer</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>producer</id>
+            <build>
+                <defaultGoal>package</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>example.composite.dest.Producer</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
\ No newline at end of file

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/readme.md
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/readme.md?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/readme.md (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/readme.md Wed Sep 26 23:26:16 2012
@@ -0,0 +1,38 @@
+## Overview
+
+This is an example of how to use the ActiveMQ 5.x / OpenWire protocol to communicate with Apollo
+
+This example demonstrates how to use composite destinations for both sending and receiving.
+
+## Prereqs
+
+- Install Java SDK
+- Install [Maven](http://maven.apache.org/download.html) 
+
+## Building
+
+Run:
+
+    mvn install
+
+## Running the Examples
+
+In one terminal window run:
+
+    mvn -P consumer
+
+In another terminal window run:
+
+    mvn -P producer
+
+## What to look for
+In the console of the producer, you should see log messages indicating messages have been successfully sent
+to the broker.
+
+In the console of the consumer, you should see log messages indicating messages have been received on each individual
+destination:
+
+* test-queue
+* test-queue-foo
+* test-queue-bar
+* test-topic-foo

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/java/example/composite/dest/Consumer.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/java/example/composite/dest/Consumer.java?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/java/example/composite/dest/Consumer.java (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/java/example/composite/dest/Consumer.java Wed Sep 26 23:26:16 2012
@@ -0,0 +1,123 @@
+/**
+ * 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 example.composite.dest;
+
+import example.util.Util;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jms.*;
+
+/**
+ * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
+ */
+public class Consumer {
+
+    private static final Logger LOG = LoggerFactory.getLogger(Consumer.class);
+    private static final String BROKER_HOST = "tcp://localhost:%d";
+    private static final int BROKER_PORT = Util.getBrokerPort();
+    private static final String BROKER_URL = String.format(BROKER_HOST, BROKER_PORT);
+    private static final Boolean NON_TRANSACTED = false;
+    private static final long TIMEOUT = 20000;
+
+    public static void main(String[] args) {
+        LOG.info("\nWaiting to receive messages... will timeout after " + TIMEOUT / 1000 +"s");
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "password", BROKER_URL);
+        Connection connection = null;
+
+        try {
+
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            Session session = connection.createSession(NON_TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+            Destination destination = session.createQueue("test-queue");
+            Destination destinationFoo = session.createQueue("test-queue-foo");
+            Destination destinationBar = session.createQueue("test-queue-bar");
+            Destination destinationTopicFoo = session.createTopic("test-topic-foo");
+
+            MessageConsumer consumer = session.createConsumer(destination);
+            MessageConsumer consumerFoo = session.createConsumer(destinationFoo);
+            MessageConsumer consumerBar = session.createConsumer(destinationBar);
+            MessageConsumer consumerTopicFoo = session.createConsumer(destinationTopicFoo);
+
+            int i = 0;
+            while (true) {
+                Message message = consumer.receive(TIMEOUT);
+
+                if (message != null) {
+                    if (message instanceof TextMessage) {
+                        String text = ((TextMessage) message).getText();
+                        LOG.info("Got " + i++ + ". message on test-queue: " + text);
+                    }
+                } else {
+                    break;
+                }
+
+                message = consumerFoo.receive(TIMEOUT);
+
+                if (message != null) {
+                    if (message instanceof TextMessage) {
+                        String text = ((TextMessage) message).getText();
+                        LOG.info("Got " + i++ + ". message on test-queue-foo: " + text);
+                    }
+                } else {
+                    break;
+                }
+
+                message = consumerBar.receive(TIMEOUT);
+
+                if (message != null) {
+                    if (message instanceof TextMessage) {
+                        String text = ((TextMessage) message).getText();
+                        LOG.info("Got " + i++ + ". message on test-queue-bar: " + text);
+                    }
+                } else {
+                    break;
+                }
+
+                message = consumerTopicFoo.receive(TIMEOUT);
+
+                if (message != null) {
+                    if (message instanceof TextMessage) {
+                        String text = ((TextMessage) message).getText();
+                        LOG.info("Got " + i++ + ". message on test-topic-bar: " + text);
+                    }
+                } else {
+                    break;
+                }
+
+            }
+
+            consumer.close();
+            session.close();
+
+        } catch (Exception e) {
+            LOG.error("Caught exception!", e);
+        }
+        finally {
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (JMSException e) {
+                    LOG.error("Could not close an open connection...", e);
+                }
+            }
+        }
+    }
+}

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/java/example/composite/dest/Producer.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/java/example/composite/dest/Producer.java?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/java/example/composite/dest/Producer.java (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-composite-destinations/src/main/java/example/composite/dest/Producer.java Wed Sep 26 23:26:16 2012
@@ -0,0 +1,76 @@
+/**
+ * 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 example.composite.dest;
+
+import example.util.Util;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jms.*;
+
+/**
+ * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
+ */
+public class Producer {
+    private static final Logger LOG = LoggerFactory.getLogger(Producer.class);
+    private static final String BROKER_HOST = "tcp://localhost:%d";
+    private static final int BROKER_PORT = Util.getBrokerPort();
+    private static final String BROKER_URL = String.format(BROKER_HOST, BROKER_PORT);
+    private static final Boolean NON_TRANSACTED = false;
+    private static final int NUM_MESSAGES_TO_SEND = 100;
+    private static final long DELAY = 100;
+
+    public static void main(String[] args) {
+
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "password", BROKER_URL);
+        Connection connection = null;
+
+        try {
+
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            Session session = connection.createSession(NON_TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+            Destination destination = session.createQueue("test-queue,test-queue-foo,test-queue-bar,topic://test-topic-foo");
+            MessageProducer producer = session.createProducer(destination);
+
+            for (int i = 0; i < NUM_MESSAGES_TO_SEND; i++) {
+                TextMessage message = session.createTextMessage("Message #" + i);
+                LOG.info("Sending message #" + i);
+                producer.send(message);
+                Thread.sleep(DELAY);
+            }
+
+            producer.close();
+            session.close();
+
+        } catch (Exception e) {
+            LOG.error("Caught exception!", e);
+        }
+        finally {
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (JMSException e) {
+                    LOG.error("Could not close an open connection...", e);
+                }
+            }
+        }
+    }
+
+}

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/pom.xml?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/pom.xml (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/pom.xml Wed Sep 26 23:26:16 2012
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>openwire-example</artifactId>
+        <groupId>example</groupId>
+        <version>0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>jms-example-util</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    <artifactId>jms-example-durable-sub</artifactId>
+    <profiles>
+        <profile>
+            <id>subscriber</id>
+            <build>
+                <defaultGoal>package</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>example.topic.durable.Subscriber</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>publisher</id>
+            <build>
+                <defaultGoal>package</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>example.topic.durable.Publisher</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>
\ No newline at end of file

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/readme.md
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/readme.md?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/readme.md (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/readme.md Wed Sep 26 23:26:16 2012
@@ -0,0 +1,29 @@
+## Overview
+
+This is an example of how to use the ActiveMQ 5.x / OpenWire protocol to communicate with Apollo
+
+This example does basic publish-subscribe messaging using Topics
+
+## Prereqs
+
+- Install Java SDK
+- Install [Maven](http://maven.apache.org/download.html) 
+
+## Building
+
+Run:
+
+    mvn install
+
+## Running the Examples
+
+In one terminal window run:
+
+    mvn -Psubscriber -DclientId=<client_id_goes_here>
+
+In another terminal window run:
+
+    mvn -Ppublisher
+
+You can kill the subscriber at any point and it will not miss messages because the subscription it creates
+is durable

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/java/example/topic/durable/Publisher.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/java/example/topic/durable/Publisher.java?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/java/example/topic/durable/Publisher.java (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/java/example/topic/durable/Publisher.java Wed Sep 26 23:26:16 2012
@@ -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 example.topic.durable;
+
+import example.util.Util;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jms.*;
+
+/**
+ * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
+ */
+public class Publisher {
+    private static final Logger LOG = LoggerFactory.getLogger(Publisher.class);
+    private static final String BROKER_HOST = "tcp://localhost:%d";
+    private static final int BROKER_PORT = Util.getBrokerPort();
+    private static final String BROKER_URL = String.format(BROKER_HOST, BROKER_PORT);
+    private static final Boolean NON_TRANSACTED = false;
+    private static final int NUM_MESSAGES_TO_SEND = 100;
+    private static final long DELAY = 100;
+
+    public static void main(String[] args) {
+
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "password", BROKER_URL);
+        Connection connection = null;
+
+        try {
+
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            Session session = connection.createSession(NON_TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+            Destination destination = session.createTopic("test-topic");
+            MessageProducer producer = session.createProducer(destination);
+
+            for (int i = 0; i < NUM_MESSAGES_TO_SEND; i++) {
+                TextMessage message = session.createTextMessage("Message #" + i);
+                LOG.info("Sending message #" + i);
+                producer.send(message);
+                Thread.sleep(DELAY);
+            }
+
+            // tell the subscribers we're done
+            producer.send(session.createTextMessage("END"));
+
+            producer.close();
+            session.close();
+
+        } catch (Exception e) {
+            LOG.error("Caught exception!", e);
+        }
+        finally {
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (JMSException e) {
+                    LOG.error("Could not close an open connection...", e);
+                }
+            }
+        }
+    }
+}

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/java/example/topic/durable/Subscriber.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/java/example/topic/durable/Subscriber.java?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/java/example/topic/durable/Subscriber.java (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-durable-sub/src/main/java/example/topic/durable/Subscriber.java Wed Sep 26 23:26:16 2012
@@ -0,0 +1,99 @@
+/**
+ * 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 example.topic.durable;
+
+import example.util.Util;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jms.*;
+import java.util.concurrent.CountDownLatch;
+
+/**
+ * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
+ */
+public class Subscriber implements MessageListener {
+    private static final Logger LOG = LoggerFactory.getLogger(Subscriber.class);
+
+    private static final String BROKER_HOST = "tcp://localhost:%d";
+    private static final int BROKER_PORT = Util.getBrokerPort();
+    private static final String BROKER_URL = String.format(BROKER_HOST, BROKER_PORT);
+    private static final Boolean NON_TRANSACTED = false;
+
+
+    private final CountDownLatch countDownLatch;
+    public Subscriber(CountDownLatch latch) {
+        countDownLatch = latch;
+    }
+
+    public static void main(String[] args) {
+        LOG.info("\nWaiting to receive messages... Either waiting for END message or press Ctrl+C to exit");
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "password", BROKER_URL);
+        Connection connection = null;
+        final CountDownLatch latch = new CountDownLatch(1);
+
+        try {
+
+            connection = connectionFactory.createConnection();
+            String clientId = System.getProperty("clientId");
+            connection.setClientID(clientId);
+
+            connection.start();
+
+            Session session = connection.createSession(NON_TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+            Topic destination = session.createTopic("test-topic");
+
+            MessageConsumer consumer = session.createDurableSubscriber(destination, clientId) ;
+            consumer.setMessageListener(new Subscriber(latch));
+
+            latch.await();
+            consumer.close();
+            session.close();
+
+        } catch (Exception e) {
+            LOG.error("Caught exception!", e);
+        }
+        finally {
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (JMSException e) {
+                    LOG.error("Could not close an open connection...", e);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void onMessage(Message message) {
+        try {
+            if (message instanceof TextMessage) {
+                String text = ((TextMessage) message).getText();
+                if ("END".equalsIgnoreCase(text)) {
+                    LOG.info("Received END message!");
+                    countDownLatch.countDown();
+                }
+                else {
+                    LOG.info("Received message:" +text);
+                }
+            }
+        } catch (JMSException e) {
+            LOG.error("Got a JMS Exception!", e);
+        }
+    }
+}

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/pom.xml?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/pom.xml (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/pom.xml Wed Sep 26 23:26:16 2012
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>openwire-example</artifactId>
+        <groupId>example</groupId>
+        <version>0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>jms-example-exclusive-consumer</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>jms-example-util</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    <profiles>
+        <profile>
+            <id>consumer</id>
+            <build>
+                <defaultGoal>package</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>example.queue.exclusive.Consumer</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>producer</id>
+            <build>
+                <defaultGoal>package</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>example.queue.exclusive.Producer</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
\ No newline at end of file

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/readme.md
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/readme.md?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/readme.md (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/readme.md Wed Sep 26 23:26:16 2012
@@ -0,0 +1,30 @@
+## Overview
+
+This is an example of how to use the ActiveMQ 5.x / OpenWire protocol to communicate with Apollo
+
+This example demos using exclusive consumers (one single consumer)
+
+## Prereqs
+
+- Install Java SDK
+- Install [Maven](http://maven.apache.org/download.html) 
+
+## Building
+
+Run:
+
+    mvn install
+
+## Running the Examples
+
+You will want to run **multiple** instances of a consumer. To run the consumer open a
+terminal and type
+
+    mvn -Pconsumer
+
+In another terminal window run:
+
+    mvn -Pproducer
+
+You'll notice that even though you have multiple consumers, only one consumer will be consuming messages. If you
+kill the consumer that's currently receiving messages, one of the other consumers will pick up the consumption.

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/java/example/queue/exclusive/Consumer.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/java/example/queue/exclusive/Consumer.java?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/java/example/queue/exclusive/Consumer.java (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/java/example/queue/exclusive/Consumer.java Wed Sep 26 23:26:16 2012
@@ -0,0 +1,82 @@
+/**
+ * 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 example.queue.exclusive;
+
+import example.util.Util;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jms.*;
+
+/**
+ * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
+ */
+public class Consumer {
+
+    private static final Logger LOG = LoggerFactory.getLogger(Consumer.class);
+    private static final String BROKER_HOST = "tcp://localhost:%d";
+    private static final int BROKER_PORT = Util.getBrokerPort();
+    private static final String BROKER_URL = String.format(BROKER_HOST, BROKER_PORT);
+    private static final Boolean NON_TRANSACTED = false;
+    private static final long TIMEOUT = 20000;
+
+    public static void main(String[] args) {
+        LOG.info("\nWaiting to receive messages... will timeout after " + TIMEOUT / 1000 +"s");
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "password", BROKER_URL);
+        Connection connection = null;
+
+        try {
+
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            Session session = connection.createSession(NON_TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+            Queue destination = session.createQueue("test-queue?consumer.exclusive=true");
+            MessageConsumer consumer = session.createConsumer(destination);
+
+            int i = 0;
+            while (true) {
+                Message message = consumer.receive(TIMEOUT);
+
+                if (message != null) {
+                    if (message instanceof TextMessage) {
+                        String text = ((TextMessage) message).getText();
+                        LOG.info("Got " + i++ + ". message: " + text);
+                    }
+                } else {
+                    break;
+                }
+            }
+
+            consumer.close();
+            session.close();
+
+        } catch (Exception e) {
+            LOG.error("Caught exception!", e);
+        }
+        finally {
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (JMSException e) {
+                    LOG.error("Could not close an open connection...", e);
+                }
+            }
+        }
+    }
+}

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/java/example/queue/exclusive/Producer.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/java/example/queue/exclusive/Producer.java?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/java/example/queue/exclusive/Producer.java (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-exclusive-consumer/src/main/java/example/queue/exclusive/Producer.java Wed Sep 26 23:26:16 2012
@@ -0,0 +1,76 @@
+/**
+ * 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 example.queue.exclusive;
+
+import example.util.Util;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jms.*;
+
+/**
+ * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
+ */
+public class Producer {
+    private static final Logger LOG = LoggerFactory.getLogger(Producer.class);
+    private static final String BROKER_HOST = "tcp://localhost:%d";
+    private static final int BROKER_PORT = Util.getBrokerPort();
+    private static final String BROKER_URL = String.format(BROKER_HOST, BROKER_PORT);
+    private static final Boolean NON_TRANSACTED = false;
+    private static final int NUM_MESSAGES_TO_SEND = 100;
+    private static final long DELAY = 100;
+
+    public static void main(String[] args) {
+
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "password", BROKER_URL);
+        Connection connection = null;
+
+        try {
+
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            Session session = connection.createSession(NON_TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+            Destination destination = session.createQueue("test-queue");
+            MessageProducer producer = session.createProducer(destination);
+
+            for (int i = 0; i < NUM_MESSAGES_TO_SEND; i++) {
+                TextMessage message = session.createTextMessage("Message #" + i);
+                LOG.info("Sending message #" + i);
+                producer.send(message);
+                Thread.sleep(DELAY);
+            }
+
+            producer.close();
+            session.close();
+
+        } catch (Exception e) {
+            LOG.error("Caught exception!", e);
+        }
+        finally {
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (JMSException e) {
+                    LOG.error("Could not close an open connection...", e);
+                }
+            }
+        }
+    }
+
+}

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/pom.xml?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/pom.xml (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/pom.xml Wed Sep 26 23:26:16 2012
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>openwire-example</artifactId>
+        <groupId>example</groupId>
+        <version>0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>jms-example-message-browser</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>jms-example-util</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <profiles>
+        <profile>
+            <id>browser</id>
+            <build>
+                <defaultGoal>package</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>example.browser.Browser</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>producer</id>
+            <build>
+                <defaultGoal>package</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>example.browser.Producer</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>
\ No newline at end of file

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/readme.md
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/readme.md?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/readme.md (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/readme.md Wed Sep 26 23:26:16 2012
@@ -0,0 +1,28 @@
+## Overview
+
+This is an example of how to use the ActiveMQ 5.x / OpenWire protocol to communicate with Apollo
+
+This example demos how to browse a queue without consuming from it
+
+## Prereqs
+
+- Install Java SDK
+- Install [Maven](http://maven.apache.org/download.html) 
+
+## Building
+
+Run:
+
+    mvn install
+
+## Running the Examples
+
+Run these steps in order:
+
+1. In one terminal window run:
+
+    mvn -Pproducer
+
+2. In another terminal window run:
+
+    mvn -Pbrowser
\ No newline at end of file

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/main/java/example/browser/Browser.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/main/java/example/browser/Browser.java?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/main/java/example/browser/Browser.java (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/main/java/example/browser/Browser.java Wed Sep 26 23:26:16 2012
@@ -0,0 +1,75 @@
+/**
+ * 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 example.browser;
+
+import example.util.Util;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jms.*;
+import java.util.Enumeration;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
+ */
+public class Browser {
+    private static final Logger LOG = LoggerFactory.getLogger(Browser.class);
+    private static final String BROKER_HOST = "tcp://localhost:%d";
+    private static final int BROKER_PORT = Util.getBrokerPort();
+    private static final String BROKER_URL = String.format(BROKER_HOST, BROKER_PORT);
+    private static final Boolean NON_TRANSACTED = false;
+    private static final long DELAY = 100;
+
+    public static void main(String[] args) {
+
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "password", BROKER_URL);
+        Connection connection = null;
+
+        try {
+
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            Session session = connection.createSession(NON_TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+            Queue destination = session.createQueue("test-queue");
+            QueueBrowser browser = session.createBrowser(destination);
+            Enumeration enumeration = browser.getEnumeration();
+
+            while (enumeration.hasMoreElements()) {
+                TextMessage message = (TextMessage) enumeration.nextElement();
+                System.out.println("Browsing: " + message);
+                TimeUnit.MILLISECONDS.sleep(DELAY);
+            }
+
+            session.close();
+
+        } catch (Exception e) {
+            LOG.error("Caught exception!", e);
+        }
+        finally {
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (JMSException e) {
+                    LOG.error("Could not close an open connection...", e);
+                }
+            }
+        }
+    }
+}

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/main/java/example/browser/Producer.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/main/java/example/browser/Producer.java?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/main/java/example/browser/Producer.java (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-message-browser/src/main/java/example/browser/Producer.java Wed Sep 26 23:26:16 2012
@@ -0,0 +1,76 @@
+/**
+ * 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 example.browser;
+
+import example.util.Util;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jms.*;
+
+/**
+ * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
+ */
+public class Producer {
+    private static final Logger LOG = LoggerFactory.getLogger(Producer.class);
+    private static final String BROKER_HOST = "tcp://localhost:%d";
+    private static final int BROKER_PORT = Util.getBrokerPort();
+    private static final String BROKER_URL = String.format(BROKER_HOST, BROKER_PORT);
+    private static final Boolean NON_TRANSACTED = false;
+    private static final int NUM_MESSAGES_TO_SEND = 100;
+    private static final long DELAY = 100;
+
+    public static void main(String[] args) {
+
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "password", BROKER_URL);
+        Connection connection = null;
+
+        try {
+
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            Session session = connection.createSession(NON_TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+            Destination destination = session.createQueue("test-queue");
+            MessageProducer producer = session.createProducer(destination);
+
+            for (int i = 0; i < NUM_MESSAGES_TO_SEND; i++) {
+                TextMessage message = session.createTextMessage("Message #" + i);
+                LOG.info("Sending message #" + i);
+                producer.send(message);
+                Thread.sleep(DELAY);
+            }
+
+            producer.close();
+            session.close();
+
+        } catch (Exception e) {
+            LOG.error("Caught exception!", e);
+        }
+        finally {
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (JMSException e) {
+                    LOG.error("Could not close an open connection...", e);
+                }
+            }
+        }
+    }
+
+}

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/pom.xml?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/pom.xml (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/pom.xml Wed Sep 26 23:26:16 2012
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>openwire-example</artifactId>
+        <groupId>example</groupId>
+        <version>0.1-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>jms-example-queue-selector</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>jms-example-util</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    <profiles>
+        <profile>
+            <id>consumer</id>
+            <build>
+                <defaultGoal>package</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>example.queue.selector.Consumer</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>producer</id>
+            <build>
+                <defaultGoal>package</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>example.queue.selector.Producer</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
\ No newline at end of file

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/readme.md
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/readme.md?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/readme.md (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/readme.md Wed Sep 26 23:26:16 2012
@@ -0,0 +1,29 @@
+## Overview
+
+This is an example of how to use the ActiveMQ 5.x / OpenWire protocol to communicate with Apollo
+
+This example shows how to use selectors to filter out messages based on criteria
+
+## Prereqs
+
+- Install Java SDK
+- Install [Maven](http://maven.apache.org/download.html) 
+
+## Building
+
+Run:
+
+    mvn install
+
+## Running the Examples
+
+In one terminal window run:
+
+    mvn -Pconsumer
+
+In another terminal window run:
+
+    mvn -Pproducer
+
+In the consumer's terminal, you'll notice that not all of the messages that the producer sent were consumed.
+Only those that had the property "intended" equal to "me"

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/java/example/queue/selector/Consumer.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/java/example/queue/selector/Consumer.java?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/java/example/queue/selector/Consumer.java (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/java/example/queue/selector/Consumer.java Wed Sep 26 23:26:16 2012
@@ -0,0 +1,82 @@
+/**
+ * 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 example.queue.selector;
+
+import example.util.Util;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jms.*;
+
+/**
+ * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
+ */
+public class Consumer {
+
+    private static final Logger LOG = LoggerFactory.getLogger(Consumer.class);
+    private static final String BROKER_HOST = "tcp://localhost:%d";
+    private static final int BROKER_PORT = Util.getBrokerPort();
+    private static final String BROKER_URL = String.format(BROKER_HOST, BROKER_PORT);
+    private static final Boolean NON_TRANSACTED = false;
+    private static final long TIMEOUT = 20000;
+
+    public static void main(String[] args) {
+        LOG.info("\nWaiting to receive messages... will timeout after " + TIMEOUT / 1000 +"s");
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "password", BROKER_URL);
+        Connection connection = null;
+
+        try {
+
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            Session session = connection.createSession(NON_TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+            Destination destination = session.createQueue("test-queue");
+            MessageConsumer consumer = session.createConsumer(destination, "intended = 'me'");
+
+            int i = 0;
+            while (true) {
+                Message message = consumer.receive(TIMEOUT);
+
+                if (message != null) {
+                    if (message instanceof TextMessage) {
+                        String text = ((TextMessage) message).getText();
+                        LOG.info("Got " + i++ + ". message: " + text);
+                    }
+                } else {
+                    break;
+                }
+            }
+
+            consumer.close();
+            session.close();
+
+        } catch (Exception e) {
+            LOG.error("Caught exception!", e);
+        }
+        finally {
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (JMSException e) {
+                    LOG.error("Could not close an open connection...", e);
+                }
+            }
+        }
+    }
+}

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/java/example/queue/selector/Producer.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/java/example/queue/selector/Producer.java?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/java/example/queue/selector/Producer.java (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue-selector/src/main/java/example/queue/selector/Producer.java Wed Sep 26 23:26:16 2012
@@ -0,0 +1,83 @@
+/**
+ * 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 example.queue.selector;
+
+import example.util.Util;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jms.*;
+
+/**
+ * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
+ */
+public class Producer {
+    private static final Logger LOG = LoggerFactory.getLogger(Producer.class);
+    private static final String BROKER_HOST = "tcp://localhost:%d";
+    private static final int BROKER_PORT = Util.getBrokerPort();
+    private static final String BROKER_URL = String.format(BROKER_HOST, BROKER_PORT);
+    private static final Boolean NON_TRANSACTED = false;
+    private static final int NUM_MESSAGES_TO_SEND = 100;
+    private static final long DELAY = 100;
+
+    public static void main(String[] args) {
+
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "password", BROKER_URL);
+        Connection connection = null;
+
+        try {
+
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            Session session = connection.createSession(NON_TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+            Destination destination = session.createQueue("test-queue");
+            MessageProducer producer = session.createProducer(destination);
+
+            for (int i = 0; i < NUM_MESSAGES_TO_SEND; i++) {
+                TextMessage message = session.createTextMessage("Message #" + i);
+                LOG.info("Sending message #" + i);
+                if (i % 2 == 0) {
+                    LOG.info("Sending to me");
+                    message.setStringProperty("intended", "me");
+                } else {
+                    LOG.info("Sending to you");
+                    message.setStringProperty("intended", "you");
+                }
+                producer.send(message);
+                Thread.sleep(DELAY);
+            }
+
+            producer.close();
+            session.close();
+
+        } catch (Exception e) {
+            LOG.error("Caught exception!", e);
+        }
+        finally {
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (JMSException e) {
+                    LOG.error("Could not close an open connection...", e);
+                }
+            }
+        }
+    }
+
+}

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/pom.xml?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/pom.xml (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/pom.xml Wed Sep 26 23:26:16 2012
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>openwire-example</artifactId>
+        <groupId>example</groupId>
+        <version>0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>jms-example-queue</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>jms-example-util</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    <profiles>
+        <profile>
+            <id>consumer</id>
+            <build>
+                <defaultGoal>package</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>example.queue.Consumer</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>producer</id>
+            <build>
+                <defaultGoal>package</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>example.queue.Producer</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
\ No newline at end of file

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/readme.md
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/readme.md?rev=1390775&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/readme.md (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/examples/openwire/jms-example-queue/readme.md Wed Sep 26 23:26:16 2012
@@ -0,0 +1,26 @@
+## Overview
+
+This is an example of how to use the ActiveMQ 5.x / OpenWire protocol to communicate with Apollo
+
+This example does basic point-to-point messaging using Queues
+
+## Prereqs
+
+- Install Java SDK
+- Install [Maven](http://maven.apache.org/download.html) 
+
+## Building
+
+Run:
+
+    mvn install
+
+## Running the Examples
+
+In one terminal window run:
+
+    mvn -Pconsumer
+
+In another terminal window run:
+
+    mvn -Pproducer



Mime
View raw message