activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject [10/18] Porting apollo examples structure to ActiveMQ 5.9.
Date Thu, 10 Oct 2013 14:40:33 GMT
http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/pom.xml
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/pom.xml b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/pom.xml
new file mode 100644
index 0000000..6818210
--- /dev/null
+++ b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/pom.xml
@@ -0,0 +1,83 @@
+<?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>advanced-openwire-example</artifactId>
+        <groupId>example</groupId>
+        <version>0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>jms-example-topic</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.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.Publisher</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/readme.md
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/readme.md b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/readme.md
new file mode 100644
index 0000000..716ef36
--- /dev/null
+++ b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/readme.md
@@ -0,0 +1,26 @@
+## Overview
+
+This is an example of how to use the ActiveMQ 5.x / OpenWire protocol to communicate with ActiveMQ
+
+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
+
+In another terminal window run:
+
+    mvn -Ppublisher

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/src/main/java/example/topic/Publisher.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/src/main/java/example/topic/Publisher.java b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/src/main/java/example/topic/Publisher.java
new file mode 100644
index 0000000..2d2e095
--- /dev/null
+++ b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/src/main/java/example/topic/Publisher.java
@@ -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.topic;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+
+import javax.jms.*;
+
+/**
+ * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
+ */
+public class Publisher {
+    private static final String BROKER_URL = "tcp://localhost:61616";
+    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) {
+        String url = BROKER_URL;
+        if (args.length > 0) {
+            url = args[0].trim();
+        }
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "password", 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);
+                System.out.println("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) {
+            System.out.println("Caught exception!");
+        }
+        finally {
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (JMSException e) {
+                    System.out.println("Could not close an open connection...");
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/src/main/java/example/topic/Subscriber.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/src/main/java/example/topic/Subscriber.java b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/src/main/java/example/topic/Subscriber.java
new file mode 100644
index 0000000..89b2e2a
--- /dev/null
+++ b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/src/main/java/example/topic/Subscriber.java
@@ -0,0 +1,94 @@
+/**
+ * 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;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+
+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 String BROKER_URL = "tcp://localhost:61616";
+
+    private static final Boolean NON_TRANSACTED = false;
+
+
+    private final CountDownLatch countDownLatch;
+    public Subscriber(CountDownLatch latch) {
+        countDownLatch = latch;
+    }
+
+    public static void main(String[] args) {
+        String url = BROKER_URL;
+        if (args.length > 0) {
+            url = args[0].trim();
+        }
+        System.out.println("\nWaiting to receive messages... Either waiting for END message or press Ctrl+C to exit");
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "password", url);
+        Connection connection = null;
+        final CountDownLatch latch = new CountDownLatch(1);
+
+        try {
+
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            Session session = connection.createSession(NON_TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+            Destination destination = session.createTopic("test-topic");
+
+            MessageConsumer consumer = session.createConsumer(destination);
+            consumer.setMessageListener(new Subscriber(latch));
+
+            latch.await();
+            consumer.close();
+            session.close();
+
+        } catch (Exception e) {
+            System.out.println("Caught exception!");
+        }
+        finally {
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (JMSException e) {
+                    System.out.println("Could not close an open connection...");
+                }
+            }
+        }
+    }
+
+    @Override
+    public void onMessage(Message message) {
+        try {
+            if (message instanceof TextMessage) {
+                String text = ((TextMessage) message).getText();
+                if ("END".equalsIgnoreCase(text)) {
+                    System.out.println("Received END message!");
+                    countDownLatch.countDown();
+                }
+                else {
+                    System.out.println("Received message:" +text);
+                }
+            }
+        } catch (JMSException e) {
+            System.out.println("Got a JMS Exception!");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/src/main/resources/log4j.properties b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/src/main/resources/log4j.properties
new file mode 100644
index 0000000..c901eac
--- /dev/null
+++ b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-topic/src/main/resources/log4j.properties
@@ -0,0 +1,32 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+#
+# Setup the default logging levels
+#
+log4j.rootLogger=INFO, console
+
+#
+# Uncomment one of the following to enable debug logging
+#
+#log4j.logger.org.apache.activemq=TRACE
+
+# Console Settings
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%C %-5p | %m%n
+log4j.appender.console.threshold=TRACE

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-transaction/pom.xml
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-transaction/pom.xml b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-transaction/pom.xml
new file mode 100644
index 0000000..fee11c5
--- /dev/null
+++ b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-transaction/pom.xml
@@ -0,0 +1,58 @@
+<?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>advanced-openwire-example</artifactId>
+        <groupId>example</groupId>
+        <version>0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>jms-example-transaction</artifactId>
+
+    <profiles>
+        <profile>
+            <id>client</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.transaction.Client</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-transaction/readme.md
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-transaction/readme.md b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-transaction/readme.md
new file mode 100644
index 0000000..ff0b873
--- /dev/null
+++ b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-transaction/readme.md
@@ -0,0 +1,25 @@
+## Overview
+
+This is an example of how to use the ActiveMQ 5.x / OpenWire protocol to communicate with ActiveMQ
+
+This example demos using JMS transactions
+
+## Prereqs
+
+- Install Java SDK
+- Install [Maven](http://maven.apache.org/download.html) 
+
+## Building
+
+Run:
+
+    mvn install
+
+## Running the Examples
+
+    mvn -Pclient
+
+    You will be greeted with a prompt. You can type a message and press enter. Nothing will actually be sent to
+    a consumer until you type `COMMIT` and press enter. After doing so, you should see the built-in consumer
+    consume the message and output it. If you type `ROLLBACK`, your message will be rolledback and the consumer
+    will not have an opportunity to see it. Hit ^C to exit

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-transaction/src/main/java/example/transaction/Client.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-transaction/src/main/java/example/transaction/Client.java b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-transaction/src/main/java/example/transaction/Client.java
new file mode 100644
index 0000000..77c56ea
--- /dev/null
+++ b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-transaction/src/main/java/example/transaction/Client.java
@@ -0,0 +1,114 @@
+/**
+ * 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.transaction;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.command.ActiveMQTopic;
+
+import javax.jms.*;
+import java.util.Scanner;
+
+/**
+ * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
+ */
+public class Client {
+    private static final String BROKER_URL = "tcp://localhost:61616";
+
+    // this is set to true
+    private static final Boolean TRANSACTED = true;
+    private static final Boolean NON_TRANSACTED = false;
+
+    public static void main(String[] args) {
+        String url = BROKER_URL;
+        if (args.length > 0) {
+            url = args[0].trim();
+        }
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "password", url);
+        Connection connection = null;
+
+        try {
+            connection = connectionFactory.createConnection();
+            connection.start();
+            Topic destination = new ActiveMQTopic("transacted.client.example");
+
+            Session senderSession = connection.createSession(TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+            Session receiverSession = connection.createSession(NON_TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+            MessageConsumer receiver = receiverSession.createConsumer(destination);
+            receiver.setMessageListener(new MessageListener() {
+                @Override
+                public void onMessage(Message message) {
+                    if (message instanceof TextMessage) {
+                        try {
+                            String value = ((TextMessage) message).getText();
+                            System.out.println("We received a new message: " + value);
+                        } catch (JMSException e) {
+                            System.out.println("Could not read the receiver's topic because of a JMSException");
+                        }
+                    }
+                }
+            });
+
+            MessageProducer sender = senderSession.createProducer(destination);
+
+
+            connection.start();
+            acceptInputFromUser(senderSession, sender);
+            senderSession.close();
+            receiverSession.close();
+
+        } catch (Exception e) {
+            System.out.println("Caught exception!");
+        }
+        finally {
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (JMSException e) {
+                    System.out.println("Could not close an open connection...");
+                }
+            }
+        }
+    }
+
+    private static void acceptInputFromUser(Session senderSession, MessageProducer sender) throws JMSException {
+        System.out.println("Type a message. Type COMMIT to send to receiver, type ROLLBACK to cancel");
+        Scanner inputReader = new Scanner(System.in);
+
+        while (true) {
+            String line = inputReader.nextLine();
+            if (line == null) {
+                System.out.println("Done!");
+                break;
+            } else if (line.length() > 0) {
+                if (line.trim().equals("ROLLBACK")) {
+                    System.out.println("Rolling back...");
+                    senderSession.rollback();
+                    System.out.println("Messages have been rolledback");
+                } else if (line.trim().equals("COMMIT")) {
+                    System.out.println("Committing... ");
+                    senderSession.commit();
+                    System.out.println("Messages should have been sent");
+                } else {
+                    TextMessage message = senderSession.createTextMessage();
+                    message.setText(line);
+                    System.out.println("Batching up:'" + message.getText() + "'");
+                    sender.send(message);
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-wildcard-consumer/pom.xml
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-wildcard-consumer/pom.xml b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-wildcard-consumer/pom.xml
new file mode 100644
index 0000000..da047d9
--- /dev/null
+++ b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-wildcard-consumer/pom.xml
@@ -0,0 +1,56 @@
+<?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>advanced-openwire-example</artifactId>
+        <groupId>example</groupId>
+        <version>0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>jms-example-wildcard-consumer</artifactId>
+
+    <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.wildcard.Client</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-wildcard-consumer/readme.md
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-wildcard-consumer/readme.md b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-wildcard-consumer/readme.md
new file mode 100644
index 0000000..83241ac
--- /dev/null
+++ b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-wildcard-consumer/readme.md
@@ -0,0 +1,31 @@
+## Overview
+
+This is an example of how to use the ActiveMQ 5.x / OpenWire protocol to communicate with ActiveMQ
+
+This example demos using wildcards for consuming messages from hierarchies of destinations
+
+## Prereqs
+
+- Install Java SDK
+- Install [Maven](http://maven.apache.org/download.html) 
+
+## Building
+
+Run:
+
+    mvn install
+
+## Running the Examples
+
+    Run one consumer specifying which topicName to produce to (topicName) and what sort of wildcard
+    you'd like to use to listen to that same topic hierarchy (wildcard)
+
+    For example, to publish to "hello.world" topic and listen to "hello.world.*":
+
+    mvn -Pconsumer -DtopicName="hello.world" -Dwildcard=".*"
+
+    You start another consumer that listens to:
+
+    mvn -Pconsumer -DtopicName="hello.world.hungray" -Dwildcard=".*"
+
+    And when you type a message on this prompt, you should see it in the first consumer you started

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-wildcard-consumer/src/main/java/example/wildcard/Client.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-wildcard-consumer/src/main/java/example/wildcard/Client.java b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-wildcard-consumer/src/main/java/example/wildcard/Client.java
new file mode 100644
index 0000000..3d2b0b0
--- /dev/null
+++ b/assembly/src/release/examples/openwire/advanced-scenarios/jms-example-wildcard-consumer/src/main/java/example/wildcard/Client.java
@@ -0,0 +1,109 @@
+/**
+ * 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.wildcard;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.command.ActiveMQTopic;
+
+import javax.jms.*;
+import java.util.Scanner;
+
+/**
+ * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
+ */
+public class Client {
+    private static final Boolean NON_TRANSACTED = false;
+    private static final String BROKER_URL = "tcp://localhost:61616";
+
+    public static void main(String[] args) {
+        String url = BROKER_URL;
+        if (args.length > 0) {
+            url = args[0].trim();
+        }
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "password", url);
+        Connection connection = null;
+
+        try {
+            Topic senderTopic = new ActiveMQTopic(System.getProperty("topicName"));
+
+            connection = connectionFactory.createConnection("admin", "password");
+
+            Session senderSession = connection.createSession(NON_TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+            MessageProducer sender = senderSession.createProducer(senderTopic);
+
+            Session receiverSession = connection.createSession(NON_TRANSACTED, Session.AUTO_ACKNOWLEDGE);
+
+            String policyType = System.getProperty("wildcard", ".*");
+            String receiverTopicName = senderTopic.getTopicName() + policyType;
+            Topic receiverTopic = receiverSession.createTopic(receiverTopicName);
+
+            MessageConsumer receiver = receiverSession.createConsumer(receiverTopic);
+            receiver.setMessageListener(new MessageListener() {
+                public void onMessage(Message message) {
+                    try {
+                        if (message instanceof TextMessage) {
+                            String text = ((TextMessage) message).getText();
+                            System.out.println("We received a new message: " + text);
+                        }
+                    } catch (JMSException e) {
+                        System.out.println("Could not read the receiver's topic because of a JMSException");
+                    }
+                }
+            });
+
+            connection.start();
+            System.out.println("Listening on '" + receiverTopicName + "'");
+            System.out.println("Enter a message to send: ");
+
+            Scanner inputReader = new Scanner(System.in);
+
+            while (true) {
+                String line = inputReader.nextLine();
+                if (line == null) {
+                    System.out.println("Done!");
+                    break;
+                } else if (line.length() > 0) {
+                    try {
+                        TextMessage message = senderSession.createTextMessage();
+                        message.setText(line);
+                        System.out.println("Sending a message: " + message.getText());
+                        sender.send(message);
+                    } catch (JMSException e) {
+                        System.out.println("Exception during publishing a message: ");
+                    }
+                }
+            }
+
+            receiver.close();
+            receiverSession.close();
+            sender.close();
+            senderSession.close();
+
+        } catch (Exception e) {
+            System.out.println("Caught exception!");
+        } finally {
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (JMSException e) {
+                    System.out.println("When trying to close connection: ");
+                }
+            }
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/advanced-scenarios/pom.xml
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/advanced-scenarios/pom.xml b/assembly/src/release/examples/openwire/advanced-scenarios/pom.xml
new file mode 100755
index 0000000..3fb0a03
--- /dev/null
+++ b/assembly/src/release/examples/openwire/advanced-scenarios/pom.xml
@@ -0,0 +1,84 @@
+<?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/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>example</groupId>
+    <artifactId>advanced-openwire-example</artifactId>
+    <packaging>pom</packaging>
+    <version>0.1-SNAPSHOT</version>
+    <modules>
+        <module>jms-example-queue</module>
+        <module>jms-example-topic</module>
+        <module>jms-example-exclusive-consumer</module>
+        <module>jms-example-transaction</module>
+        <module>jms-example-durable-sub</module>
+        <module>jms-example-wildcard-consumer</module>
+        <module>jms-example-temp-destinations</module>
+        <module>jms-example-message-browser</module>
+        <module>jms-example-queue-selector</module>
+        <module>jms-example-composite-destinations</module>
+    </modules>
+
+    <name>JMS / OpeWire Examples for ActiveMQ</name>
+    <description>ActiveMQ OpenWire Java Examples</description>
+
+    <repositories>
+        <repository>
+            <id>Fusesource Snapshots</id>
+            <url>http://repo.fusesource.com/nexus/content/repositories/snapshots</url>
+        </repository>
+    </repositories>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jms_1.1_spec</artifactId>
+            <version>1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>activemq-client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-nop</artifactId>
+            <version>${slf4j-version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.1</version>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
+

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/advanced-scenarios/readme.md
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/advanced-scenarios/readme.md b/assembly/src/release/examples/openwire/advanced-scenarios/readme.md
new file mode 100644
index 0000000..7acff0b
--- /dev/null
+++ b/assembly/src/release/examples/openwire/advanced-scenarios/readme.md
@@ -0,0 +1,3 @@
+## Overview
+
+This directory contains more advanced examples of how to use AcitveMQ's OpenWire based JMS API.

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/ecommerce/README.txt
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/ecommerce/README.txt b/assembly/src/release/examples/openwire/ecommerce/README.txt
new file mode 100644
index 0000000..2c3238a
--- /dev/null
+++ b/assembly/src/release/examples/openwire/ecommerce/README.txt
@@ -0,0 +1,40 @@
+Transactions Demo
+=================
+This example is an ActiveMQ implementation of the "TransactedExample" from
+Sun's JMS Tutorial (http://java.sun.com/products/jms/tutorial/index.html).
+
+The example simulates a simplified eCommerce application with four parts:
+the retailer who places the orders, the vendor who assemples the computers,
+and two suppliers--one for hard drives and another for monitors.
+
+The retailer sends a message to the vendor's queue and awaits a reply.
+The vendor receives the message and sends a message to each of the
+supplier's queues. It does this in a single transaction, and will randomly
+throw an exception simulating a database error, triggering a rollback.
+Each supplier receives the order, checks inventory and replies to the
+message stating how many items were sent.
+The vendor collects both responses and responds to the retailer, notifying
+wheather it cna fulfill the complete order or not.
+The retailer receives the message from the vendor.
+
+Running the Example
+===================
+To run the complete demo in a single JVM, with ActiveMQ running on the local
+computer:
+  ant transactions_demo
+
+If you are running ActiveMQ on a non-standard port, or on a different host,
+you can pass a url on the commandline:
+  ant -Durl=tcp://localhost:61616 transactions_demo
+
+If your ActiveMQ instance is password-protected, you can also pass a
+username and password on the command line:
+  ant -Duser=myusername -Dpassword=supersecret transactions_demo
+
+You can also run the individual components seperately, again with optional
+url and/or authentication parameters:
+  ant retailer &
+  ant vendor &
+  ant hdsupplier &
+  ant monitorsupplier &
+

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/ecommerce/build.xml
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/ecommerce/build.xml b/assembly/src/release/examples/openwire/ecommerce/build.xml
new file mode 100644
index 0000000..83ae093
--- /dev/null
+++ b/assembly/src/release/examples/openwire/ecommerce/build.xml
@@ -0,0 +1,113 @@
+<?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 name="transactions" default="help" basedir=".">
+
+    <property name="class.dir" value="target/classes" />
+    <property name="activemq.home" value="../../.." />
+
+    <!-- example program defaults -->
+    <property name="url" value="tcp://localhost:61616" />
+    <target name="help">
+        <echo>
+      For the full demo:
+         ant transactions_demo -Durl=tcp://hostname:1234
+      For the indicual components:
+         ant retailer -Durl=tcp://hostname:1234
+         ant vendor -Durl=tcp://hostname:1234
+         ant hdsupplier -Durl=tcp://hostname:1234
+         ant monitorsupplier -Durl=tcp://hostname:1234
+        </echo>
+    </target>
+
+    <target name="clean">
+        <delete dir="target" quiet="true" />
+        <delete dir="${class.dir}" quiet="true" />
+    </target>
+
+    <target name="init">
+        <mkdir dir="${class.dir}" />
+
+        <path id="javac.classpath">
+            <pathelement path="${class.dir}" />
+            <pathelement path="../conf" />
+            <fileset dir="${activemq.home}/lib">
+                <include name="**/*.jar" />
+            </fileset>
+        </path>
+    </target>
+
+    <target name="compile" depends="init" description="Compile all Java">
+        <javac srcdir="src" destdir="${class.dir}" debug="true">
+            <classpath refid="javac.classpath" />
+        </javac>
+    </target>
+
+    <target name="transactions_demo" depends="compile" description="Runs the full demo">
+        <java classname="TransactionsDemo" fork="yes">
+            <classpath refid="javac.classpath" />
+            <jvmarg value="-server" />
+            <sysproperty key="activemq.home" value="${activemq.home}"/>
+            <arg value="${url}" />
+            <arg value="${user}" />
+            <arg value="${password}" />
+        </java>
+    </target>
+
+    <target name="retailer" depends="compile" description="Runs the retailer">
+        <java classname="Retailer" fork="yes">
+            <classpath refid="javac.classpath" />
+            <jvmarg value="-server" />
+            <sysproperty key="activemq.home" value="${activemq.home}"/>
+            <arg value="${url}" />
+            <arg value="${user}" />
+            <arg value="${password}" />
+        </java>
+    </target>
+    <target name="vendor" depends="compile" description="Runs the vendor">
+        <java classname="Vendor" fork="yes">
+            <classpath refid="javac.classpath" />
+            <jvmarg value="-server" />
+            <sysproperty key="activemq.home" value="${activemq.home}"/>
+            <arg value="${url}" />
+            <arg value="${user}" />
+            <arg value="${password}" />
+        </java>
+    </target>
+    <target name="hdsupplier" depends="compile" description="Runs the Hard Drive Supplier">
+        <java classname="Supplier" fork="yes">
+            <classpath refid="javac.classpath" />
+            <jvmarg value="-server" />
+            <sysproperty key="activemq.home" value="${activemq.home}"/>
+            <arg value="HardDrive" />
+            <arg value="${url}" />
+            <arg value="${user}" />
+            <arg value="${password}" />
+        </java>
+    </target>
+    <target name="monitorsupplier" depends="compile" description="Runs the Monitor Supplier">
+        <java classname="Supplier" fork="yes">
+            <classpath refid="javac.classpath" />
+            <jvmarg value="-server" />
+            <sysproperty key="activemq.home" value="${activemq.home}"/>
+            <arg value="Monitor" />
+            <arg value="${url}" />
+            <arg value="${user}" />
+            <arg value="${password}" />
+        </java>
+    </target>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/ecommerce/src/Retailer.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/ecommerce/src/Retailer.java b/assembly/src/release/examples/openwire/ecommerce/src/Retailer.java
new file mode 100644
index 0000000..01ecfef
--- /dev/null
+++ b/assembly/src/release/examples/openwire/ecommerce/src/Retailer.java
@@ -0,0 +1,107 @@
+/*
+ *  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.
+ */
+import org.apache.activemq.ActiveMQConnectionFactory;
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.MapMessage;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TemporaryQueue;
+
+/**
+ * The Retailer orders computers from the Vendor by sending a message via
+ * the VendorOrderQueue. It then syncronously receives the reponse message
+ * and reports if the order was successful or not.
+ */
+public class Retailer implements Runnable {
+	private String url;
+	private String user;
+	private String password;
+	
+	public Retailer(String url, String user, String password) {
+		this.url = url;
+		this.user = user;
+		this.password = password;
+	}
+	
+	public void run() {
+		ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, url);
+		try {
+			Connection connection = connectionFactory.createConnection();
+			
+			// The Retailer's session is non-trasacted.
+			Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+			Destination vendorOrderQueue = session.createQueue("VendorOrderQueue");
+			TemporaryQueue retailerConfirmQueue = session.createTemporaryQueue();
+			
+			MessageProducer producer = session.createProducer(vendorOrderQueue);
+			MessageConsumer replyConsumer = session.createConsumer(retailerConfirmQueue);
+
+			connection.start();
+
+			for (int i = 0; i < 5; i++) {
+				MapMessage message = session.createMapMessage();
+				message.setString("Item", "Computer(s)");
+				int quantity = (int)(Math.random() * 4) + 1;
+				message.setInt("Quantity", quantity);
+				message.setJMSReplyTo(retailerConfirmQueue);
+				producer.send(message);
+				System.out.println("Retailer: Ordered " + quantity + " computers.");
+				
+				MapMessage reply = (MapMessage) replyConsumer.receive();
+				if (reply.getBoolean("OrderAccepted")) {
+					System.out.println("Retailer: Order Filled");
+				} else {
+					System.out.println("Retailer: Order Not Filled");
+				}
+			}
+			
+			// Send a non-MapMessage to signal the end
+			producer.send(session.createMessage());
+			
+			replyConsumer.close();
+			connection.close();
+			
+		} catch (JMSException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public static void main(String[] args) {
+		String url = "tcp://localhost:61616";
+		String user = null;
+		String password = null;
+		
+		if (args.length >= 1) {
+			url = args[0];
+		}
+		
+		if (args.length >= 2) {
+			user = args[1];
+		}
+
+		if (args.length >= 3) {
+			password = args[2];
+		}
+		
+		Retailer r = new Retailer(url, user, password);
+		
+		new Thread(r, "Retailer").start();
+	}
+}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/ecommerce/src/Supplier.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/ecommerce/src/Supplier.java b/assembly/src/release/examples/openwire/ecommerce/src/Supplier.java
new file mode 100644
index 0000000..ed02cc2
--- /dev/null
+++ b/assembly/src/release/examples/openwire/ecommerce/src/Supplier.java
@@ -0,0 +1,135 @@
+/*
+ *  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.
+ */
+import java.util.Random;
+
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+
+/**
+ * The Supplier synchronously receives the order from the Vendor and
+ * randomly responds with either the number ordered, or some lower
+ * quantity. 
+ */
+public class Supplier implements Runnable {
+	private String url;
+	private String user;
+	private String password;
+	private final String ITEM;
+	private final String QUEUE;
+	
+	public Supplier(String item, String queue, String url, String user, String password) {
+		this.url = url;
+		this.user = user;
+		this.password = password;
+		this.ITEM = item;
+		this.QUEUE = queue;
+	}
+	
+	public void run() {
+		ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, url);
+		Session session = null;
+		Destination orderQueue;
+		try {
+			Connection connection = connectionFactory.createConnection();
+
+			session = connection.createSession(true, Session.SESSION_TRANSACTED);
+			orderQueue = session.createQueue(QUEUE);
+			MessageConsumer consumer = session.createConsumer(orderQueue);
+			
+			connection.start();
+			
+			while (true) {
+				Message message = consumer.receive();
+				MessageProducer producer = session.createProducer(message.getJMSReplyTo());
+				MapMessage orderMessage;
+				if (message instanceof MapMessage) {
+					orderMessage = (MapMessage) message;
+				} else {
+					// End of Stream
+					producer.send(session.createMessage());
+					session.commit();
+					producer.close();
+					break;
+				}
+				
+				int quantity = orderMessage.getInt("Quantity");
+				System.out.println(ITEM + " Supplier: Vendor ordered " + quantity + " " + orderMessage.getString("Item"));
+				
+				MapMessage outMessage = session.createMapMessage();
+				outMessage.setInt("VendorOrderNumber", orderMessage.getInt("VendorOrderNumber"));
+				outMessage.setString("Item", ITEM);
+				
+				quantity = Math.min(
+						orderMessage.getInt("Quantity"),
+						new Random().nextInt(orderMessage.getInt("Quantity") * 10));
+				outMessage.setInt("Quantity", quantity);
+				
+				producer.send(outMessage);
+				System.out.println(ITEM + " Supplier: Sent " + quantity + " " + ITEM + "(s)");
+				session.commit();
+				System.out.println(ITEM + " Supplier: committed transaction");
+				producer.close();
+			}
+			connection.close();
+		} catch (JMSException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public static void main(String[] args) {
+		String url = "tcp://localhost:61616";
+		String user = null;
+		String password = null;
+		String item = "HardDrive";
+		
+		if (args.length >= 1) {
+			item = args[0];
+		}
+		String queue;
+		if ("HardDrive".equals(item)) {
+			queue = "StorageOrderQueue";
+		} else if ("Monitor".equals(item)) {
+			queue = "MonitorOrderQueue";
+		} else {
+			throw new IllegalArgumentException("Item must be either HardDrive or Monitor");
+		}
+		
+		if (args.length >= 2) {
+			url = args[1];
+		}
+		
+		if (args.length >= 3) {
+			user = args[2];
+		}
+
+		if (args.length >= 4) {
+			password = args[3];
+		}
+		
+		Supplier s = new Supplier(item, queue, url, user, password);
+		
+		new Thread(s, "Supplier " + item).start();
+	}
+}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/ecommerce/src/TransactionsDemo.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/ecommerce/src/TransactionsDemo.java b/assembly/src/release/examples/openwire/ecommerce/src/TransactionsDemo.java
new file mode 100644
index 0000000..4dc1171
--- /dev/null
+++ b/assembly/src/release/examples/openwire/ecommerce/src/TransactionsDemo.java
@@ -0,0 +1,47 @@
+/*
+ *  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.
+ */
+public class TransactionsDemo {
+
+	public static void main(String[] args) {
+		String url = "tcp://localhost:61616";
+		String user = null;
+		String password = null;
+		
+		if (args.length >= 1) {
+			url = args[0];
+		}
+		
+		if (args.length >= 2) {
+			user = args[1];
+		}
+
+		if (args.length >= 3) {
+			password = args[2];
+		}
+		
+		Retailer r = new Retailer(url, user, password);
+		Vendor v = new Vendor(url, user, password);
+		Supplier s1 = new Supplier("HardDrive", "StorageOrderQueue", url, user, password);
+		Supplier s2 = new Supplier("Monitor", "MonitorOrderQueue", url, user, password);
+		
+		new Thread(r, "Retailer").start();
+		new Thread(v, "Vendor").start();
+		new Thread(s1, "Supplier 1").start();
+		new Thread(s2, "Supplier 2").start();
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/ecommerce/src/Vendor.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/ecommerce/src/Vendor.java b/assembly/src/release/examples/openwire/ecommerce/src/Vendor.java
new file mode 100644
index 0000000..0f2ce93
--- /dev/null
+++ b/assembly/src/release/examples/openwire/ecommerce/src/Vendor.java
@@ -0,0 +1,302 @@
+/*
+ *  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.
+ */
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
+
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TemporaryQueue;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+
+/**
+ * The Vendor synchronously, and in a single transaction, receives the
+ * order from VendorOrderQueue and sends messages to the two Suppliers via
+ * MonitorOrderQueue and StorageOrderQueue.
+ * The responses are received asynchronously; when both responses come
+ * back, the order confirmation message is sent back to the Retailer.
+ */
+public class Vendor implements Runnable, MessageListener {
+	private String url;
+	private String user;
+	private String password;
+	private	Session asyncSession;
+	private int numSuppliers = 2;
+	private Object supplierLock = new Object();
+	
+	public Vendor(String url, String user, String password) {
+		this.url = url;
+		this.user = user;
+		this.password = password;
+	}
+	
+	public void run() {
+		ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, url);
+		Session session = null;
+		Destination orderQueue;
+		Destination monitorOrderQueue;
+		Destination storageOrderQueue;
+		TemporaryQueue vendorConfirmQueue;
+		MessageConsumer orderConsumer = null;
+		MessageProducer monitorProducer = null;
+		MessageProducer storageProducer = null;
+
+		try {
+			Connection connection = connectionFactory.createConnection();
+
+			session = connection.createSession(true, Session.SESSION_TRANSACTED);
+			orderQueue = session.createQueue("VendorOrderQueue");
+			monitorOrderQueue = session.createQueue("MonitorOrderQueue");
+			storageOrderQueue = session.createQueue("StorageOrderQueue");
+			
+			orderConsumer = session.createConsumer(orderQueue);
+			monitorProducer = session.createProducer(monitorOrderQueue);
+			storageProducer = session.createProducer(storageOrderQueue);
+			
+			Connection asyncconnection = connectionFactory.createConnection();
+			asyncSession = asyncconnection.createSession(true, Session.SESSION_TRANSACTED);
+			
+			vendorConfirmQueue = asyncSession.createTemporaryQueue();
+			MessageConsumer confirmConsumer = asyncSession.createConsumer(vendorConfirmQueue);
+			confirmConsumer.setMessageListener(this);
+			
+			asyncconnection.start();
+
+			connection.start();
+
+		
+			while (true) {
+				Order order = null;
+				try {
+					Message inMessage = orderConsumer.receive();
+					MapMessage message;
+					if (inMessage instanceof MapMessage) {
+						message = (MapMessage) inMessage;
+						
+					} else {
+						// end of stream
+						Message outMessage = session.createMessage();
+						outMessage.setJMSReplyTo(vendorConfirmQueue);
+						monitorProducer.send(outMessage);
+						storageProducer.send(outMessage);
+						session.commit();
+						break;
+					}
+					
+					// Randomly throw an exception in here to simulate a Database error
+					// and trigger a rollback of the transaction
+					if (new Random().nextInt(3) == 0) {
+						throw new JMSException("Simulated Database Error.");
+					}
+					
+					order = new Order(message);
+					
+					MapMessage orderMessage = session.createMapMessage();
+					orderMessage.setJMSReplyTo(vendorConfirmQueue);
+					orderMessage.setInt("VendorOrderNumber", order.getOrderNumber());
+					int quantity = message.getInt("Quantity");
+					System.out.println("Vendor: Retailer ordered " + quantity + " " + message.getString("Item"));
+					
+					orderMessage.setInt("Quantity", quantity);
+					orderMessage.setString("Item", "Monitor");
+					monitorProducer.send(orderMessage);
+					System.out.println("Vendor: ordered " + quantity + " Monitor(s)");
+					
+					orderMessage.setString("Item", "HardDrive");
+					storageProducer.send(orderMessage);
+					System.out.println("Vendor: ordered " + quantity + " Hard Drive(s)");
+					
+					session.commit();
+					System.out.println("Vendor: Comitted Transaction 1");
+					
+				} catch (JMSException e) {
+					System.out.println("Vendor: JMSException Occured: " + e.getMessage());
+					e.printStackTrace();
+					session.rollback();
+					System.out.println("Vendor: Rolled Back Transaction.");
+				}
+			}
+			
+			synchronized (supplierLock) {
+				while (numSuppliers > 0) {
+					try {
+						supplierLock.wait();
+					} catch (InterruptedException e) {
+						e.printStackTrace();
+					}
+				}
+			}
+			
+			connection.close();
+			asyncconnection.close();
+		
+		} catch (JMSException e) {
+			e.printStackTrace();
+		}
+
+	}
+
+	public void onMessage(Message message) {
+		if (!(message instanceof MapMessage)) {
+			synchronized(supplierLock) {
+				numSuppliers--;
+				supplierLock.notifyAll();
+			}
+			try {
+				asyncSession.commit();
+				return;
+			} catch (JMSException e) {
+				e.printStackTrace();
+			}
+		}
+		
+		int orderNumber = -1;
+		try {
+			MapMessage componentMessage = (MapMessage) message;
+			
+			orderNumber = componentMessage.getInt("VendorOrderNumber");
+			Order order = Order.getOrder(orderNumber);
+			order.processSubOrder(componentMessage);
+			asyncSession.commit();
+			
+			if (! "Pending".equals(order.getStatus())) {
+				System.out.println("Vendor: Completed processing for order " + orderNumber);
+				
+				MessageProducer replyProducer = asyncSession.createProducer(order.getMessage().getJMSReplyTo());
+				MapMessage replyMessage = asyncSession.createMapMessage();
+				if ("Fulfilled".equals(order.getStatus())) {
+					replyMessage.setBoolean("OrderAccepted", true);
+					System.out.println("Vendor: sent " + order.quantity + " computer(s)");
+				} else {
+					replyMessage.setBoolean("OrderAccepted", false);
+					System.out.println("Vendor: unable to send " + order.quantity + " computer(s)");
+				}
+				replyProducer.send(replyMessage);
+				asyncSession.commit();
+				System.out.println("Vender: committed transaction 2");
+			}
+		} catch (JMSException e) {
+			e.printStackTrace();
+		}
+	}
+
+	public static class Order {
+		private static Map<Integer, Order> pendingOrders = new HashMap<Integer, Order>();
+		private static int nextOrderNumber = 1;
+
+		private int orderNumber;
+		private int quantity;
+		private MapMessage monitor = null;
+		private MapMessage storage = null;
+		private MapMessage message;
+		private String status;
+		
+		public Order(MapMessage message) {
+			this.orderNumber = nextOrderNumber++;
+			this.message = message;
+			try {
+				this.quantity = message.getInt("Quantity");
+			} catch (JMSException e) {
+				e.printStackTrace();
+				this.quantity = 0;
+			}
+			status = "Pending";
+			pendingOrders.put(orderNumber, this);
+		}
+		
+		public Object getStatus() {
+			return status;
+		}
+		
+		public int getOrderNumber() {
+			return orderNumber;
+		}
+		
+		public static int getOutstandingOrders() {
+			return pendingOrders.size();
+		}
+		
+		public static Order getOrder(int number) {
+			return pendingOrders.get(number);
+		}
+		
+		public MapMessage getMessage() {
+			return message;
+		}
+		
+		public void processSubOrder(MapMessage message) {
+			String itemName = null;
+			try {
+				itemName = message.getString("Item");
+			} catch (JMSException e) {
+				e.printStackTrace();
+			}
+			
+			if ("Monitor".equals(itemName)) {
+				monitor = message;
+			} else if ("HardDrive".equals(itemName)) {
+				storage = message;
+			}
+			
+			if (null != monitor && null != storage) {
+				// Received both messages
+				try {
+					if (quantity > monitor.getInt("Quantity")) {
+						status = "Cancelled";
+					} else if (quantity > storage.getInt("Quantity")) {
+						status = "Cancelled";
+					} else {
+						status = "Fulfilled";
+					}
+				} catch (JMSException e) {
+					e.printStackTrace();
+					status = "Cancelled";
+				}
+			}
+		}		
+	}
+
+	public static void main(String[] args) {
+		String url = "tcp://localhost:61616";
+		String user = null;
+		String password = null;
+		
+		if (args.length >= 1) {
+			url = args[0];
+		}
+		
+		if (args.length >= 2) {
+			user = args[1];
+		}
+
+		if (args.length >= 3) {
+			password = args[2];
+		}
+		
+		Vendor v = new Vendor(url, user, password);
+		
+		new Thread(v, "Vendor").start();
+	}	
+}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.java b/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.java
new file mode 100644
index 0000000..b780771
--- /dev/null
+++ b/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.java
@@ -0,0 +1,352 @@
+/*
+ * � 2001-2009, Progress Software Corporation and/or its subsidiaries or affiliates.  All rights reserved.
+ *
+ * Licensed 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.
+ 
+Sample Application
+
+Writing a Basic JMS Application using:
+    - QueueBrowser
+    - JMS with a Graphical Interface
+    - behavior based on message type
+
+When you run this program, it will read all the parameters out
+of the QueueMonitor.properties file. In this file you can specify
+which queues you want to monitor. Then a Java window will open and
+every time you click the Browse button, The current contents of the queues
+will be displayed in the text window.
+
+Usage:
+  java QueueMonitor
+
+Suggested demonstration:
+  - Start one instance of this application:
+        java QueueMonitor
+  - Run on or more Talk applications (without the receiving queue).
+  - Enter messages on various Talk windows.
+  - Watch the QueueMonitor display the messages.
+
+*/
+import org.apache.activemq.*;
+
+import javax.swing.JTextArea;
+import javax.swing.JFrame;
+import javax.swing.JScrollPane;
+import javax.swing.JButton;
+
+import javax.swing.text.Highlighter;
+import javax.swing.text.DefaultHighlighter;
+import javax.swing.text.BadLocationException;
+
+import javax.swing.border.CompoundBorder;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.BevelBorder;
+import javax.swing.border.SoftBevelBorder;
+
+import java.awt.Toolkit;
+import java.awt.Dimension;
+import java.awt.BorderLayout;
+import java.awt.Rectangle;
+
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+
+import java.io.FileInputStream;
+
+import java.util.Vector;
+import java.util.Enumeration;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+public class QueueMonitor
+extends JFrame
+{
+    private static final String DEFAULT_PROPERTIES_FILE = "QueueMonitor.properties";
+
+    String propertiesFile = DEFAULT_PROPERTIES_FILE;
+    String broker = "tcp://localhost:61616";
+    String connectID = "QueueMonitor";
+    String username = "QueueMonitor";
+    String password = "QueueMonitor";
+    String browseQueues  = "Q1,Q2,Q3";
+    String textFontName = "Dialog";
+    String textFontStyle = "PLAIN";
+    String textFontSize = "12";
+    String title = "QueueMonitor";
+
+    JTextArea textArea = new JTextArea();
+    JScrollPane scrollPane = new JScrollPane(textArea);
+    JButton browseButton = new JButton("Browse Queues");
+
+    Vector theQueues = new Vector();
+
+    private javax.jms.Connection connect = null;
+    private javax.jms.Session session = null;
+
+/** Constructor for MessageMonitor window. */
+    public QueueMonitor()
+    {
+        loadProperties();
+
+        setTitle(title);
+
+        // Connect to Message Broker
+        try
+        {
+            javax.jms.ConnectionFactory factory;
+            factory = new ActiveMQConnectionFactory(username, password, broker);
+
+            connect = factory.createConnection (username, password);
+            session = connect.createSession(false,javax.jms.Session.AUTO_ACKNOWLEDGE);
+        }
+        catch (javax.jms.JMSException jmse)
+        {
+            System.err.println("Cannot connect to Broker");
+            jmse.printStackTrace();
+            System.exit(1);
+        }
+
+        // Set up Queues:
+        StringTokenizer queues = new StringTokenizer(browseQueues, ",");
+        while (queues.hasMoreTokens())
+        {
+            try{
+                String queueName = queues.nextToken();
+                System.out.println ("Monitoring  " + queueName);
+                theQueues.addElement(session.createQueue(queueName));
+            }
+            catch (javax.jms.JMSException jmse)
+            {
+                jmse.printStackTrace();
+            }
+        }
+
+
+        // After init it is time to start the connection
+        try
+        {
+            connect.start();
+        }
+        catch (javax.jms.JMSException jmse)
+        {
+            System.err.println("Cannot start connection");
+            jmse.printStackTrace();
+            System.exit(1);
+        }
+
+        //Elements visible on the screen
+        textArea.setEditable(false);
+        scrollPane.setBorder(new CompoundBorder(new EmptyBorder(6,6,6,6),
+                                                new SoftBevelBorder(BevelBorder.LOWERED)));
+        getContentPane().add(scrollPane,BorderLayout.CENTER);
+        getContentPane().add(browseButton,BorderLayout.SOUTH);
+
+        browseButton.addActionListener(new OnBrowse());
+
+    }
+
+
+
+    /** Main program entry point. */
+    public static void main(String[] args)
+    {
+        // There should be no arguments to this program.
+        if (args.length > 0) {
+            printUsage();
+            System.exit(1);
+        }
+
+        QueueMonitor queueMonitor = new QueueMonitor();
+
+        queueMonitor.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent e)
+            {
+                System.exit(0);
+            }
+        });
+
+        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+        screenSize.height = screenSize.height / 2 ;
+        screenSize.width = screenSize.width / 2 ;
+        queueMonitor.setSize(screenSize);
+        queueMonitor.setVisible(true);
+
+    }
+
+    /** Prints the usage. */
+    private static void printUsage()
+    {
+        StringBuffer use = new StringBuffer();
+        use.append("\nusage: QueueMonitor\n\n");
+        use.append("Properties for this sample can be set in a properties file.\n");
+        String dfltFile = System.getProperty("propertiesFile", DEFAULT_PROPERTIES_FILE);
+        use.append("[Default file: " + dfltFile +"]\n\n");
+        System.out.print(use);
+    }
+
+    /** Load the window and JMS properties from a file. */
+    private void loadProperties()
+    {
+        try
+        {
+            Properties properties = new Properties();
+
+            propertiesFile = System.getProperty("propertiesFile", propertiesFile);
+
+            properties.load(new FileInputStream(propertiesFile));
+
+            // Connection Properties
+            broker = properties.getProperty("broker",broker).trim();
+            connectID = properties.getProperty("connectID",connectID).trim();
+            username = properties.getProperty("username",username).trim();
+            password = properties.getProperty("password",password).trim();
+
+            // Queue Properties
+            browseQueues = properties.getProperty("browseQueues", browseQueues).trim();
+
+            // Text Properties
+            textFontName = properties.getProperty("textFontName", textFontName).trim();
+            textFontStyle = properties.getProperty("textFontStyle", textFontStyle).trim();
+            textFontSize = properties.getProperty("textFontSize", textFontSize).trim();
+
+            // Window Properties
+            title = properties.getProperty("title", title).trim();
+
+        }
+        catch (java.io.FileNotFoundException fnfe)
+        {
+            System.out.println (propertiesFile + " not found: using defaults"); // Use Defaults
+        }
+        catch (java.io.IOException ioe)
+        {
+            ioe.printStackTrace();
+        }
+    }
+
+   /** Class to handle the "Browse" button action. */
+    public class OnBrowse implements ActionListener
+    {
+
+        public void actionPerformed(ActionEvent evt)
+        {
+            // Clear the textArea.
+            textArea.setText("");
+            textArea.paintImmediately(textArea.getBounds());
+
+            if(theQueues.size() == 0){
+                textArea.setText("No Queues to be monitored");
+            }
+            else{
+                for(int i = 0; i<theQueues.size();i++)
+                {
+                    try
+                    {
+                        // Create a browser on the queue and show the messages waiting in it.
+                        javax.jms.Queue q = (javax.jms.Queue) theQueues.elementAt(i);
+                       textArea.append("--------------------------------------------------\n");
+                       textArea.append("Messages on queue " + q.getQueueName() + ":\n");
+  
+                        // Create a queue browser
+                        System.out.print ("Browsing messages in queue " + q.getQueueName() + "\"...");
+                        javax.jms.QueueBrowser browser = session.createBrowser(q);
+                        System.out.println ("[done]");
+                        int cnt = 0;
+                        Enumeration e = browser.getEnumeration();
+                        if(!e.hasMoreElements())
+                        {
+                            textArea.append ("(This queue is empty.)");
+                        }
+                        else
+                        {
+                            while(e.hasMoreElements())
+                            {
+                                System.out.print(" --> getting message " + String.valueOf(++cnt) + "...");
+                                javax.jms.Message message = (javax.jms.Message) e.nextElement();
+                                System.out.println("[" + message + "]");
+                                if (message != null)
+                                {
+                                    String msgText = getContents (message);
+                                    textArea.append(msgText + "\n");
+                                    try
+                                    {
+                                        // Scroll the text area to show the message
+                                        Rectangle area = textArea.modelToView(textArea.getText().length());
+                                        textArea.scrollRectToVisible(area);
+                                        textArea.paintImmediately(textArea.getBounds());
+                                    }
+                                    catch(Exception jle) { jle.printStackTrace();}
+                                }
+                            }
+                        }
+                        // Free any resources in the browser.
+                        browser.close();
+                        textArea.append ("\n");
+                    }
+                    catch (javax.jms.JMSException jmse){
+                        jmse.printStackTrace();
+                    }
+                }
+                try
+                {
+                    // Scroll the text area to show the message
+                    Rectangle area = textArea.modelToView(textArea.getText().length());
+                    textArea.scrollRectToVisible(area);
+                    textArea.paintImmediately(textArea.getBounds());
+                }
+                catch(Exception jle) { jle.printStackTrace();}
+            }
+        }
+    }
+
+    public String getContents (javax.jms.Message message){
+
+
+            String msgBody = null;
+            String msgClass = message.getClass().getName();
+
+            if (message instanceof javax.jms.TextMessage)
+            {
+                msgClass = "javax.jms.TextMessage";
+                try
+                {
+                    msgBody = ((javax.jms.TextMessage)message).getText();
+                }
+                catch (javax.jms.JMSException jmse)
+                {
+                    msgBody = "";
+                }
+            }
+          
+            else if (message instanceof org.apache.activemq.command.ActiveMQMapMessage)
+            {
+		  			    System.out.println ("(Name value pairs in the MapMessage are not displayed.)");
+            }
+            else if (message instanceof javax.jms.BytesMessage)
+          			{
+		  			    System.out.println ("Warning: A bytes message was discarded because it could not be processed as a javax.jms.TextMessage.");
+		  			 }
+            else if (message instanceof javax.jms.ObjectMessage)
+          			{
+		  			    System.out.println ("Warning: An object message was discarded because it could not be processed as a javax.jms.TextMessage.");
+		  			 }
+
+            else if (message instanceof javax.jms.StreamMessage)
+					{
+			   			System.out.println ("Warning: A stream message was discarded because it could not be processed as a javax.jms.TextMessage.");
+					 }
+        return "- " + msgClass + " from " + msgBody ;
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.properties
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.properties b/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.properties
new file mode 100644
index 0000000..1db7b82
--- /dev/null
+++ b/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.properties
@@ -0,0 +1,56 @@
+#
+# This is the properties file for the QueueMonitor Class.
+#
+# A QueueMonitor object will load this file when constructed.
+# By default, a QueueMonitor object searches for and load a 
+# file named "QueueMonitor.properties" in the JVM's "current" directory.
+#
+# This behavior may be overriden by assigning an alternate property file
+# name and location to the System property "propertiesFile".
+#
+# Property:         broker
+# Default Value:    localhost   
+# Description:      Specifies the host and port of the Messaging Broker to connect to.
+broker              tcp://localhost:61616
+#
+# Property:         connectID
+# Default Value:    QueueMonitor 
+# Description:      Specifies the program identifier used to connect to the Messaging Broker.
+connectID           QueueMonitor 
+#
+# Property:         userID
+# Default Value:    Administrator 
+# Description:      Specifies the user identifier used to connect to the Messaging Broker.
+username            Administrator 
+#
+# Property:         password
+# Default Value:    Administrator 
+# Description:      Specifies the password used to connect to the Messaging Broker.
+password            Administrator 
+#
+# Property:         browseQueues
+# Default Value:     
+# Description:      A comma-separated list of queue names that QueueMonitor browses.
+#                   NOTE: An empty list will subscribe to no queues.
+browseQueues        Q1,Q2,Q3,Q4
+##
+# Property:         textFontName
+# Default Value:    Dialog
+# Description:      The name of the font used to display recieved messages.
+textFontName        Dialog   
+#
+# Property:         textFontStyle
+# Default Value:    PLAIN
+# Description:      The style of the font used to display received messages.
+textFontStyle       PLAIN   
+#
+# Property:         textFontSize
+# Default Value:    12
+# Description:      The size of the font used to display recieved messages.
+textFontSize        12   
+#
+# Property:         title
+# Default Value:    QueueMonitor
+# Description:      The title of the QueueMonitor Window.
+title               QueueMonitor   
+..


Mime
View raw message