activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject [17/18] Porting apollo examples structure to ActiveMQ 5.9.
Date Thu, 10 Oct 2013 14:40:40 GMT
http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/example/src/Log4jJMSAppenderExample.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/src/Log4jJMSAppenderExample.java b/assembly/src/release/example/src/Log4jJMSAppenderExample.java
deleted file mode 100644
index 657b9b2..0000000
--- a/assembly/src/release/example/src/Log4jJMSAppenderExample.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import javax.jms.Connection;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.Session;
-
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.command.ActiveMQObjectMessage;
-import org.apache.log4j.Logger;
-import org.apache.log4j.spi.LoggingEvent;
-
-
-/**
- * A simple example of log4j jms appender in conjuction with ActiveMQ
- */
-public class Log4jJMSAppenderExample implements MessageListener {
-
-	public Log4jJMSAppenderExample() throws Exception {
-		// create a logTopic topic consumer
-		ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:61616");
-		Connection conn = factory.createConnection();
-		Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-		conn.start();
-		MessageConsumer consumer = sess.createConsumer(sess.createTopic("logTopic"));
-		consumer.setMessageListener(this);
-		// log a message
-		Logger log = Logger.getLogger(Log4jJMSAppenderExample.class);
-		log.info("Test log");
-		// clean up
-		Thread.sleep(1000);
-		consumer.close();
-		sess.close();
-		conn.close();
-		System.exit(1);
-	}
-	
-	public static void main(String[] args) throws Exception {
-		new Log4jJMSAppenderExample();
-	}
-
-	public void onMessage(Message message) {
-		try {
-			// receive log event in your consumer
-			LoggingEvent event = (LoggingEvent)((ActiveMQObjectMessage)message).getObject();
-			System.out.println("Received log [" + event.getLevel() + "]: "+ event.getMessage());
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-	
-	
-	
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/example/src/ProducerAndConsumerTool.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/src/ProducerAndConsumerTool.java b/assembly/src/release/example/src/ProducerAndConsumerTool.java
deleted file mode 100644
index a1b96ff..0000000
--- a/assembly/src/release/example/src/ProducerAndConsumerTool.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.util.Arrays;
-import java.util.HashSet;
-
-import javax.jms.MessageListener;
-
-/**
- * A simple tool for producing and consuming messages
- * 
- * 
- */
-public class ProducerAndConsumerTool extends ConsumerTool implements MessageListener {
-
-    public static void main(String[] args) {
-
-        ConsumerTool consumerTool = new ConsumerTool();
-        String[] unknown = CommandLineSupport.setOptions(consumerTool, args);
-        HashSet<String> set1 = new HashSet<String>(Arrays.asList(unknown));
-
-        ProducerTool producerTool = new ProducerTool();
-        unknown = CommandLineSupport.setOptions(producerTool, args);
-        HashSet<String> set2 = new HashSet<String>(Arrays.asList(unknown));
-
-        set1.retainAll(set2);
-        if (set1.size() > 0) {
-            System.out.println("Unknown options: " + set1);
-            System.exit(-1);
-        }
-
-        consumerTool.run();
-        producerTool.run();
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/example/src/ProducerTool.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/src/ProducerTool.java b/assembly/src/release/example/src/ProducerTool.java
deleted file mode 100755
index 3693fd7..0000000
--- a/assembly/src/release/example/src/ProducerTool.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-
-import javax.jms.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.activemq.ActiveMQConnection;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.util.IndentPrinter;
-
-/**
- * A simple tool for publishing messages
- * 
- * 
- */
-public class ProducerTool extends Thread {
-
-    private Destination destination;
-    private int messageCount = 10;
-    private long sleepTime;
-    private boolean verbose = true;
-    private int messageSize = 255;
-    private static int parallelThreads = 1;
-    private long timeToLive;
-    private String user = ActiveMQConnection.DEFAULT_USER;
-    private String password = ActiveMQConnection.DEFAULT_PASSWORD;
-    private String url = ActiveMQConnection.DEFAULT_BROKER_URL;
-    private String subject = "TOOL.DEFAULT";
-    private boolean topic;
-    private boolean transacted;
-    private boolean persistent;
-    private long batch = 10;
-    private static Object lockResults = new Object();
-
-    public static void main(String[] args) {
-        ArrayList<ProducerTool> threads = new ArrayList();
-        ProducerTool producerTool = new ProducerTool();
-        String[] unknown = CommandLineSupport.setOptions(producerTool, args);
-        if (unknown.length > 0) {
-            System.out.println("Unknown options: " + Arrays.toString(unknown));
-            System.exit(-1);
-        }
-        producerTool.showParameters();
-        for (int threadCount = 1; threadCount <= parallelThreads; threadCount++) {
-            producerTool = new ProducerTool();
-            CommandLineSupport.setOptions(producerTool, args);
-            producerTool.start();
-            threads.add(producerTool);
-        }
-
-        while (true) {
-            Iterator<ProducerTool> itr = threads.iterator();
-            int running = 0;
-            while (itr.hasNext()) {
-                ProducerTool thread = itr.next();
-                if (thread.isAlive()) {
-                    running++;
-                }
-            }
-            if (running <= 0) {
-                System.out.println("All threads completed their work");
-                break;
-            }
-            try {
-                Thread.sleep(1000);
-            } catch (Exception e) {
-            }
-        }
-    }
-
-    public void showParameters() {
-        System.out.println("Connecting to URL: " + url + " (" + user + ":" + password + ")");
-        System.out.println("Publishing a Message with size " + messageSize + " to " + (topic ? "topic" : "queue") + ": " + subject);
-        System.out.println("Using " + (persistent ? "persistent" : "non-persistent") + " messages");
-        System.out.println("Sleeping between publish " + sleepTime + " ms");
-        System.out.println("Running " + parallelThreads + " parallel threads");
-
-        if (timeToLive != 0) {
-            System.out.println("Messages time to live " + timeToLive + " ms");
-        }
-    }
-
-    public void run() {
-        Connection connection = null;
-        try {
-            // Create the connection.
-            ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, url);
-            connection = connectionFactory.createConnection();
-            connection.start();
-
-            // Create the session
-            Session session = connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
-            if (topic) {
-                destination = session.createTopic(subject);
-            } else {
-                destination = session.createQueue(subject);
-            }
-
-            // Create the producer.
-            MessageProducer producer = session.createProducer(destination);
-            if (persistent) {
-                producer.setDeliveryMode(DeliveryMode.PERSISTENT);
-            } else {
-                producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-            }
-            if (timeToLive != 0) {
-                producer.setTimeToLive(timeToLive);
-            }
-
-            // Start sending messages
-            sendLoop(session, producer);
-
-            System.out.println("[" + this.getName() + "] Done.");
-
-            synchronized (lockResults) {
-                ActiveMQConnection c = (ActiveMQConnection) connection;
-                System.out.println("[" + this.getName() + "] Results:\n");
-                c.getConnectionStats().dump(new IndentPrinter());
-            }
-
-        } catch (Exception e) {
-            System.out.println("[" + this.getName() + "] Caught: " + e);
-            e.printStackTrace();
-        } finally {
-            try {
-                connection.close();
-            } catch (Throwable ignore) {
-            }
-        }
-    }
-
-    protected void sendLoop(Session session, MessageProducer producer) throws Exception {
-
-        for (int i = 0; i < messageCount || messageCount == 0; i++) {
-
-            TextMessage message = session.createTextMessage(createMessageText(i));
-
-            if (verbose) {
-                String msg = message.getText();
-                if (msg.length() > 50) {
-                    msg = msg.substring(0, 50) + "...";
-                }
-                System.out.println("[" + this.getName() + "] Sending message: '" + msg + "'");
-            }
-
-            producer.send(message);
-
-            if (transacted && (i % batch == 0)) {
-                System.out.println("[" + this.getName() + "] Committing " + messageCount + " messages");
-                session.commit();
-            }
-            Thread.sleep(sleepTime);
-        }
-    }
-
-    private String createMessageText(int index) {
-        StringBuffer buffer = new StringBuffer(messageSize);
-        buffer.append("Message: " + index + " sent at: " + new Date());
-        if (buffer.length() > messageSize) {
-            return buffer.substring(0, messageSize);
-        }
-        for (int i = buffer.length(); i < messageSize; i++) {
-            buffer.append(' ');
-        }
-        return buffer.toString();
-    }
-
-    public void setPersistent(boolean durable) {
-        this.persistent = durable;
-    }
-
-    public void setMessageCount(int messageCount) {
-        this.messageCount = messageCount;
-    }
-
-    public void setMessageSize(int messageSize) {
-        this.messageSize = messageSize;
-    }
-
-    public void setPassword(String pwd) {
-        this.password = pwd;
-    }
-
-    public void setSleepTime(long sleepTime) {
-        this.sleepTime = sleepTime;
-    }
-
-    public void setSubject(String subject) {
-        this.subject = subject;
-    }
-
-    public void setTimeToLive(long timeToLive) {
-        this.timeToLive = timeToLive;
-    }
-
-    public void setParallelThreads(int parallelThreads) {
-        if (parallelThreads < 1) {
-            parallelThreads = 1;
-        }
-        this.parallelThreads = parallelThreads;
-    }
-
-    public void setTopic(boolean topic) {
-        this.topic = topic;
-    }
-
-    public void setQueue(boolean queue) {
-        this.topic = !queue;
-    }
-
-    public void setTransacted(boolean transacted) {
-        this.transacted = transacted;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-    public void setUser(String user) {
-        this.user = user;
-    }
-
-    public void setVerbose(boolean verbose) {
-        this.verbose = verbose;
-    }
-
-    public void setBatch(long batch) {
-        this.batch = batch;
-    }
-}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/example/src/RequesterTool.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/src/RequesterTool.java b/assembly/src/release/example/src/RequesterTool.java
deleted file mode 100644
index cd1a650..0000000
--- a/assembly/src/release/example/src/RequesterTool.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import java.util.Arrays;
-import java.util.Date;
-
-import javax.jms.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.activemq.ActiveMQConnection;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.util.IndentPrinter;
-
-/**
- * A simple tool for publishing messages
- * 
- * 
- */
-public class RequesterTool {
-
-    private int messageCount = 10;
-    private long sleepTime;
-    private boolean verbose = true;
-    private int messageSize = 255;
-    private long timeToLive;
-    private String subject = "TOOL.DEFAULT";
-    private String replySubject;
-    private boolean topic;
-    private String user = ActiveMQConnection.DEFAULT_USER;
-    private String password = ActiveMQConnection.DEFAULT_PASSWORD;
-    private String url = ActiveMQConnection.DEFAULT_BROKER_URL;
-    private boolean transacted;
-    private boolean persistent;
-    private String clientId;
-
-    private Destination destination;
-    private Destination replyDest;
-    private MessageProducer producer;
-    private MessageConsumer consumer;
-    private Session session;
-
-    public static void main(String[] args) {
-        RequesterTool requesterTool = new RequesterTool();
-        String[] unknown = CommandLineSupport.setOptions(requesterTool, args);
-        if (unknown.length > 0) {
-            System.out.println("Unknown options: " + Arrays.toString(unknown));
-            System.exit(-1);
-        }
-        requesterTool.run();
-    }
-
-    public void run() {
-
-        Connection connection = null;
-        try {
-
-            System.out.println("Connecting to URL: " + url);
-            System.out.println("Publishing a Message with size " + messageSize + " to " + (topic ? "topic" : "queue") + ": " + subject);
-            System.out.println("Using " + (persistent ? "persistent" : "non-persistent") + " messages");
-            System.out.println("Sleeping between publish " + sleepTime + " ms");
-
-            // Create the connection
-            ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, url);
-            connection = connectionFactory.createConnection();
-            if (persistent && clientId != null && clientId.length() > 0 && !"null".equals(clientId)) {
-                connection.setClientID(clientId);
-            }
-            connection.start();
-
-            // Create the Session
-            session = connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
-
-            // And the Destinations..
-            if (topic) {
-                destination = session.createTopic(subject);
-                if (replySubject == null || replySubject.equals("")) {
-                    replyDest = session.createTemporaryTopic();
-                } else {
-                    replyDest = session.createTopic(replySubject);
-                }
-            } else {
-                destination = session.createQueue(subject);
-                if (replySubject == null || replySubject.equals("")) {
-                    replyDest = session.createTemporaryQueue();
-                } else {
-                    replyDest = session.createQueue(replySubject);
-                }
-            }
-            System.out.println("Reply Destination: " + replyDest);
-
-            // Create the producer
-            producer = session.createProducer(destination);
-            if (persistent) {
-                producer.setDeliveryMode(DeliveryMode.PERSISTENT);
-            } else {
-                producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-            }
-            if (timeToLive != 0) {
-                System.out.println("Messages time to live " + timeToLive + " ms");
-                producer.setTimeToLive(timeToLive);
-            }
-
-            // Create the reply consumer
-            consumer = session.createConsumer(replyDest);
-
-            // Start sending reqests.
-            requestLoop();
-
-            System.out.println("Done.");
-
-            // Use the ActiveMQConnection interface to dump the connection
-            // stats.
-            ActiveMQConnection c = (ActiveMQConnection)connection;
-            c.getConnectionStats().dump(new IndentPrinter());
-
-        } catch (Exception e) {
-            System.out.println("Caught: " + e);
-            e.printStackTrace();
-        } finally {
-            try {
-                connection.close();
-            } catch (Throwable ignore) {
-            }
-        }
-    }
-
-    protected void requestLoop() throws Exception {
-
-        for (int i = 0; i < messageCount || messageCount == 0; i++) {
-
-            TextMessage message = session.createTextMessage(createMessageText(i));
-            message.setJMSReplyTo(replyDest);
-
-            if (verbose) {
-                String msg = message.getText();
-                if (msg.length() > 50) {
-                    msg = msg.substring(0, 50) + "...";
-                }
-                System.out.println("Sending message: " + msg);
-            }
-
-            producer.send(message);
-            if (transacted) {
-                session.commit();
-            }
-
-            System.out.println("Waiting for reponse message...");
-            Message message2 = consumer.receive();
-            if (message2 instanceof TextMessage) {
-                System.out.println("Reponse message: " + ((TextMessage)message2).getText());
-            } else {
-                System.out.println("Reponse message: " + message2);
-            }
-            if (transacted) {
-                session.commit();
-            }
-
-            Thread.sleep(sleepTime);
-
-        }
-    }
-
-    /**
-     * @param i
-     * @return
-     */
-    private String createMessageText(int index) {
-        StringBuffer buffer = new StringBuffer(messageSize);
-        buffer.append("Message: " + index + " sent at: " + new Date());
-        if (buffer.length() > messageSize) {
-            return buffer.substring(0, messageSize);
-        }
-        for (int i = buffer.length(); i < messageSize; i++) {
-            buffer.append(' ');
-        }
-        return buffer.toString();
-    }
-
-    public void setClientId(String clientId) {
-        this.clientId = clientId;
-    }
-
-    public void setPersistent(boolean durable) {
-        this.persistent = durable;
-    }
-
-    public void setMessageCount(int messageCount) {
-        this.messageCount = messageCount;
-    }
-
-    public void setMessageSize(int messageSize) {
-        this.messageSize = messageSize;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    public void setSleepTime(long sleepTime) {
-        this.sleepTime = sleepTime;
-    }
-
-    public void setSubject(String subject) {
-        this.subject = subject;
-    }
-
-    public void setTimeToLive(long timeToLive) {
-        this.timeToLive = timeToLive;
-    }
-
-    public void setTopic(boolean topic) {
-        this.topic = topic;
-    }
-
-    public void setQueue(boolean queue) {
-        this.topic = !queue;
-    }
-
-    public void setTransacted(boolean transacted) {
-        this.transacted = transacted;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-    public void setUser(String user) {
-        this.user = user;
-    }
-
-    public void setVerbose(boolean verbose) {
-        this.verbose = verbose;
-    }
-
-    public void setReplySubject(String replySubject) {
-        this.replySubject = replySubject;
-    }
-}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/example/src/StompExample.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/src/StompExample.java b/assembly/src/release/example/src/StompExample.java
deleted file mode 100644
index 56446c4..0000000
--- a/assembly/src/release/example/src/StompExample.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import org.apache.activemq.transport.stomp.Stomp;
-import org.apache.activemq.transport.stomp.StompConnection;
-import org.apache.activemq.transport.stomp.StompFrame;
-import org.apache.activemq.transport.stomp.Stomp.Headers.Subscribe;
-
-/**
- * 
- * This example demonstrates Stomp Java API
- * 
- * 
- *
- */
-public class StompExample {
-
-	public static void main(String args[]) throws Exception {
-		StompConnection connection = new StompConnection();
-		connection.open("localhost", 61613);
-		
-		connection.connect("system", "manager");
-		
-		connection.begin("tx1");
-		connection.send("/queue/test", "message1");
-		connection.send("/queue/test", "message2");
-		connection.commit("tx1");
-		
-		connection.subscribe("/queue/test", Subscribe.AckModeValues.CLIENT);
-		
-		connection.begin("tx2");
-		
-		StompFrame message = connection.receive();
-		System.out.println(message.getBody());
-		connection.ack(message, "tx2");
-		
-		message = connection.receive();
-		System.out.println(message.getBody());
-		connection.ack(message, "tx2");
-		
-		connection.commit("tx2");
-		
-		connection.disconnect();
-	}
-	
-}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/example/src/TopicListener.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/src/TopicListener.java b/assembly/src/release/example/src/TopicListener.java
deleted file mode 100644
index dbecafd..0000000
--- a/assembly/src/release/example/src/TopicListener.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import java.util.Arrays;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-
-import org.apache.activemq.ActiveMQConnectionFactory;
-
-/**
- * Use in conjunction with TopicPublisher to test the performance of ActiveMQ
- * Topics.
- */
-public class TopicListener implements MessageListener {
-
-    private Connection connection;
-    private MessageProducer producer;
-    private Session session;
-    private int count;
-    private long start;
-    private Topic topic;
-    private Topic control;
-
-    private String url = "tcp://localhost:61616";
-
-    public static void main(String[] argv) throws Exception {
-        TopicListener l = new TopicListener();
-        String[] unknown = CommandLineSupport.setOptions(l, argv);
-        if (unknown.length > 0) {
-            System.out.println("Unknown options: " + Arrays.toString(unknown));
-            System.exit(-1);
-        }
-        l.run();
-    }
-
-    public void run() throws JMSException {
-        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(url);
-        connection = factory.createConnection();
-        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-        topic = session.createTopic("topictest.messages");
-        control = session.createTopic("topictest.control");
-
-        MessageConsumer consumer = session.createConsumer(topic);
-        consumer.setMessageListener(this);
-
-        connection.start();
-
-        producer = session.createProducer(control);
-        System.out.println("Waiting for messages...");
-    }
-
-    private static boolean checkText(Message m, String s) {
-        try {
-            return m instanceof TextMessage && ((TextMessage)m).getText().equals(s);
-        } catch (JMSException e) {
-            e.printStackTrace(System.out);
-            return false;
-        }
-    }
-
-    public void onMessage(Message message) {
-        if (checkText(message, "SHUTDOWN")) {
-
-            try {
-                connection.close();
-            } catch (Exception e) {
-                e.printStackTrace(System.out);
-            }
-
-        } else if (checkText(message, "REPORT")) {
-            // send a report:
-            try {
-                long time = System.currentTimeMillis() - start;
-                String msg = "Received " + count + " in " + time + "ms";
-                producer.send(session.createTextMessage(msg));
-            } catch (Exception e) {
-                e.printStackTrace(System.out);
-            }
-            count = 0;
-
-        } else {
-
-            if (count == 0) {
-                start = System.currentTimeMillis();
-            }
-
-            if (++count % 1000 == 0) {
-                System.out.println("Received " + count + " messages.");
-            }
-        }
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/example/src/TopicPublisher.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/src/TopicPublisher.java b/assembly/src/release/example/src/TopicPublisher.java
deleted file mode 100644
index dd99846..0000000
--- a/assembly/src/release/example/src/TopicPublisher.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import java.util.Arrays;
-
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-
-import org.apache.activemq.ActiveMQConnectionFactory;
-
-/**
- * Use in conjunction with TopicListener to test the performance of ActiveMQ
- * Topics.
- */
-public class TopicPublisher implements MessageListener {
-
-    private static final char[] DATA = "abcdefghijklmnopqrstuvwxyz".toCharArray();
-
-    private final Object mutex = new Object();
-    private Connection connection;
-    private Session session;
-    private MessageProducer publisher;
-    private Topic topic;
-    private Topic control;
-
-    private String url = "tcp://localhost:61616";
-    private int size = 256;
-    private int subscribers = 1;
-    private int remaining;
-    private int messages = 10000;
-    private long delay;
-    private int batch = 2000;
-
-    private byte[] payload;
-
-    public static void main(String[] argv) throws Exception {
-        TopicPublisher p = new TopicPublisher();
-        String[] unknown = CommandLineSupport.setOptions(p, argv);
-        if (unknown.length > 0) {
-            System.out.println("Unknown options: " + Arrays.toString(unknown));
-            System.exit(-1);
-        }
-        p.run();
-    }
-
-    private void run() throws Exception {
-        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(url);
-        connection = factory.createConnection();
-        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-        topic = session.createTopic("topictest.messages");
-        control = session.createTopic("topictest.control");
-
-        publisher = session.createProducer(topic);
-        publisher.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-
-        payload = new byte[size];
-        for (int i = 0; i < size; i++) {
-            payload[i] = (byte)DATA[i % DATA.length];
-        }
-
-        session.createConsumer(control).setMessageListener(this);
-        connection.start();
-
-        long[] times = new long[batch];
-        for (int i = 0; i < batch; i++) {
-            if (i > 0) {
-                Thread.sleep(delay * 1000);
-            }
-            times[i] = batch(messages);
-            System.out.println("Batch " + (i + 1) + " of " + batch + " completed in " + times[i] + " ms.");
-        }
-
-        long min = min(times);
-        long max = max(times);
-        System.out.println("min: " + min + ", max: " + max + " avg: " + avg(times, min, max));
-
-        // request shutdown
-        publisher.send(session.createTextMessage("SHUTDOWN"));
-
-        connection.stop();
-        connection.close();
-    }
-
-    private long batch(int msgCount) throws Exception {
-        long start = System.currentTimeMillis();
-        remaining = subscribers;
-        publish();
-        waitForCompletion();
-        return System.currentTimeMillis() - start;
-    }
-
-    private void publish() throws Exception {
-
-        // send events
-        BytesMessage msg = session.createBytesMessage();
-        msg.writeBytes(payload);
-        for (int i = 0; i < messages; i++) {
-            publisher.send(msg);
-            if ((i + 1) % 1000 == 0) {
-                System.out.println("Sent " + (i + 1) + " messages");
-            }
-        }
-
-        // request report
-        publisher.send(session.createTextMessage("REPORT"));
-    }
-
-    private void waitForCompletion() throws Exception {
-        System.out.println("Waiting for completion...");
-        synchronized (mutex) {
-            while (remaining > 0) {
-                mutex.wait();
-            }
-        }
-    }
-
-    public void onMessage(Message message) {
-        synchronized (mutex) {
-            System.out.println("Received report " + getReport(message) + " " + --remaining + " remaining");
-            if (remaining == 0) {
-                mutex.notify();
-            }
-        }
-    }
-
-    Object getReport(Message m) {
-        try {
-            return ((TextMessage)m).getText();
-        } catch (JMSException e) {
-            e.printStackTrace(System.out);
-            return e.toString();
-        }
-    }
-
-    static long min(long[] times) {
-        long min = times.length > 0 ? times[0] : 0;
-        for (int i = 0; i < times.length; i++) {
-            min = Math.min(min, times[i]);
-        }
-        return min;
-    }
-
-    static long max(long[] times) {
-        long max = times.length > 0 ? times[0] : 0;
-        for (int i = 0; i < times.length; i++) {
-            max = Math.max(max, times[i]);
-        }
-        return max;
-    }
-
-    static long avg(long[] times, long min, long max) {
-        long sum = 0;
-        for (int i = 0; i < times.length; i++) {
-            sum += times[i];
-        }
-        sum -= min;
-        sum -= max;
-        return sum / times.length - 2;
-    }
-
-    public void setBatch(int batch) {
-        this.batch = batch;
-    }
-
-    public void setDelay(long delay) {
-        this.delay = delay;
-    }
-
-    public void setMessages(int messages) {
-        this.messages = messages;
-    }
-
-    public void setSize(int size) {
-        this.size = size;
-    }
-
-    public void setSubscribers(int subscribers) {
-        this.subscribers = subscribers;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/example/src/jndi.properties
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/src/jndi.properties b/assembly/src/release/example/src/jndi.properties
deleted file mode 100644
index 19dad58..0000000
--- a/assembly/src/release/example/src/jndi.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-## 
-## http://www.apache.org/licenses/LICENSE-2.0
-## 
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-topic.logTopic=logTopic
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/example/src/log4j-jms.properties
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/src/log4j-jms.properties b/assembly/src/release/example/src/log4j-jms.properties
deleted file mode 100644
index e28d6d6..0000000
--- a/assembly/src/release/example/src/log4j-jms.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-## 
-## http://www.apache.org/licenses/LICENSE-2.0
-## 
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-log4j.rootLogger=INFO, stdout, jms
-
-## Be sure that ActiveMQ messages are not logged to 'jms' appender
-log4j.logger.org.apache.activemq=INFO, stdout
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p %c - %m%n
-
-## Configure 'jms' appender. You'll also need jndi.properties file in order to make it work
-log4j.appender.jms=org.apache.log4j.net.JMSAppender
-log4j.appender.jms.InitialContextFactoryName=org.apache.activemq.jndi.ActiveMQInitialContextFactory
-log4j.appender.jms.ProviderURL=tcp://localhost:61616
-log4j.appender.jms.TopicBindingName=logTopic
-log4j.appender.jms.TopicConnectionFactoryBindingName=ConnectionFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/example/transactions/README.txt
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/transactions/README.txt b/assembly/src/release/example/transactions/README.txt
deleted file mode 100644
index 2c3238a..0000000
--- a/assembly/src/release/example/transactions/README.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-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/example/transactions/build.xml
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/transactions/build.xml b/assembly/src/release/example/transactions/build.xml
deleted file mode 100644
index 839cde2..0000000
--- a/assembly/src/release/example/transactions/build.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-<?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/example/transactions/src/Retailer.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/transactions/src/Retailer.java b/assembly/src/release/example/transactions/src/Retailer.java
deleted file mode 100644
index 01ecfef..0000000
--- a/assembly/src/release/example/transactions/src/Retailer.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-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/example/transactions/src/Supplier.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/transactions/src/Supplier.java b/assembly/src/release/example/transactions/src/Supplier.java
deleted file mode 100644
index ed02cc2..0000000
--- a/assembly/src/release/example/transactions/src/Supplier.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-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/example/transactions/src/TransactionsDemo.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/transactions/src/TransactionsDemo.java b/assembly/src/release/example/transactions/src/TransactionsDemo.java
deleted file mode 100644
index 4dc1171..0000000
--- a/assembly/src/release/example/transactions/src/TransactionsDemo.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-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/example/transactions/src/Vendor.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/example/transactions/src/Vendor.java b/assembly/src/release/example/transactions/src/Vendor.java
deleted file mode 100644
index 0f2ce93..0000000
--- a/assembly/src/release/example/transactions/src/Vendor.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-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/amqp/java/pom.xml
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/amqp/java/pom.xml b/assembly/src/release/examples/amqp/java/pom.xml
new file mode 100644
index 0000000..dd1db26
--- /dev/null
+++ b/assembly/src/release/examples/amqp/java/pom.xml
@@ -0,0 +1,80 @@
+<?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>amqp-example</artifactId>
+  <version>0.1-SNAPSHOT</version>
+  
+  <name>example</name>
+  <description>ActiveMQ AMQP 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.qpid</groupId>
+      <artifactId>qpid-amqp-1-0-client-jms</artifactId>
+      <version>${qpid-jms-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>
+
+      <!-- include all the dependencies into the jar so it's easier to execute the example -->
+      <plugin>
+        <groupId>org.fusesource.mvnplugins</groupId>
+        <artifactId>maven-uberize-plugin</artifactId>
+        <version>1.14</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals><goal>uberize</goal></goals>
+          </execution>
+        </executions>
+      </plugin>
+      
+    </plugins>
+  </build>
+  
+</project>
+

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/amqp/java/readme.md
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/amqp/java/readme.md b/assembly/src/release/examples/amqp/java/readme.md
new file mode 100644
index 0000000..6e68a4b
--- /dev/null
+++ b/assembly/src/release/examples/amqp/java/readme.md
@@ -0,0 +1,32 @@
+## Overview
+
+This is an example of how use the Java JMS api with ActiveMQ via the AMQP protocol.
+
+## Prereqs
+
+- Install Java SDK
+- Install [Maven](http://maven.apache.org/download.html) 
+
+## Building
+
+Run:
+
+    mvn install
+
+## Running the Examples
+
+In one terminal window run:
+
+    java -cp target/amqp-example-0.1-SNAPSHOT.jar example.Listener
+
+In another terminal window run:
+
+    java -cp target/amqp-example-0.1-SNAPSHOT.jar example.Publisher
+
+You can control to which AMQP server the examples try to connect to by
+setting the following environment variables: 
+
+* `ACTIVEMQ_HOST`
+* `ACTIVEMQ_PORT`
+* `ACTIVEMQ_USER`
+* `ACTIVEMQ_PASSWORD`

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/amqp/java/src/main/java/example/Listener.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/amqp/java/src/main/java/example/Listener.java b/assembly/src/release/examples/amqp/java/src/main/java/example/Listener.java
new file mode 100644
index 0000000..bd8d198
--- /dev/null
+++ b/assembly/src/release/examples/amqp/java/src/main/java/example/Listener.java
@@ -0,0 +1,90 @@
+/**
+ * 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;
+
+import org.apache.qpid.amqp_1_0.jms.impl.*;
+import javax.jms.*;
+
+class Listener {
+
+    public static void main(String []args) throws JMSException {
+
+        String user = env("ACTIVEMQ_USER", "admin");
+        String password = env("ACTIVEMQ_PASSWORD", "password");
+        String host = env("ACTIVEMQ_HOST", "localhost");
+        int port = Integer.parseInt(env("ACTIVEMQ_PORT", "5672"));
+        String destination = arg(args, 0, "topic://event");
+
+        ConnectionFactoryImpl factory = new ConnectionFactoryImpl(host, port, user, password);
+        Destination dest = null;
+        if( destination.startsWith("topic://") ) {
+            dest = new TopicImpl(destination);
+        } else {
+            dest = new QueueImpl(destination);
+        }
+
+        Connection connection = factory.createConnection(user, password);
+        connection.start();
+        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        MessageConsumer consumer = session.createConsumer(dest);
+        long start = System.currentTimeMillis();
+        long count = 1;
+        System.out.println("Waiting for messages...");
+        while(true) {
+            Message msg = consumer.receive();
+            if( msg instanceof  TextMessage ) {
+                String body = ((TextMessage) msg).getText();
+                if( "SHUTDOWN".equals(body)) {
+                    long diff = System.currentTimeMillis() - start;
+                    System.out.println(String.format("Received %d in %.2f seconds", count, (1.0*diff/1000.0)));
+                    connection.close();
+                    System.exit(1);
+                } else {
+                    try {
+                        if( count != msg.getIntProperty("id") ) {
+                            System.out.println("mismatch: "+count+"!="+msg.getIntProperty("id"));
+                        }
+                    } catch (NumberFormatException ignore) {
+                    }
+                    if( count == 1 ) {
+                        start = System.currentTimeMillis();
+                    } else if( count % 1000 == 0 ) {
+                        System.out.println(String.format("Received %d messages.", count));
+                    }
+                    count ++;
+                }
+
+            } else {
+                System.out.println("Unexpected message type: "+msg.getClass());
+            }
+        }
+    }
+
+    private static String env(String key, String defaultValue) {
+        String rc = System.getenv(key);
+        if( rc== null )
+            return defaultValue;
+        return rc;
+    }
+
+    private static String arg(String []args, int index, String defaultValue) {
+        if( index < args.length )
+            return args[index];
+        else
+            return defaultValue;
+    }
+}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/amqp/java/src/main/java/example/Publisher.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/amqp/java/src/main/java/example/Publisher.java b/assembly/src/release/examples/amqp/java/src/main/java/example/Publisher.java
new file mode 100644
index 0000000..70c46bd
--- /dev/null
+++ b/assembly/src/release/examples/amqp/java/src/main/java/example/Publisher.java
@@ -0,0 +1,84 @@
+/**
+ * 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;
+
+import org.apache.qpid.amqp_1_0.jms.impl.*;
+import javax.jms.*;
+
+class Publisher {
+
+    public static void main(String []args) throws Exception {
+
+        String user = env("ACTIVEMQ_USER", "admin");
+        String password = env("ACTIVEMQ_PASSWORD", "password");
+        String host = env("ACTIVEMQ_HOST", "localhost");
+        int port = Integer.parseInt(env("ACTIVEMQ_PORT", "5672"));
+        String destination = arg(args, 0, "topic://event");
+
+        int messages = 10000;
+        int size = 256;
+
+        String DATA = "abcdefghijklmnopqrstuvwxyz";
+        String body = "";
+        for( int i=0; i < size; i ++) {
+            body += DATA.charAt(i%DATA.length());
+        }
+
+        ConnectionFactoryImpl factory = new ConnectionFactoryImpl(host, port, user, password);
+        Destination dest = null;
+        if( destination.startsWith("topic://") ) {
+            dest = new TopicImpl(destination);
+        } else {
+            dest = new QueueImpl(destination);
+        }
+
+        Connection connection = factory.createConnection(user, password);
+        connection.start();
+        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        MessageProducer producer = session.createProducer(dest);
+        producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+        for( int i=1; i <= messages; i ++) {
+            TextMessage msg = session.createTextMessage("#:"+i);
+            msg.setIntProperty("id", i);
+            producer.send(msg);
+            if( (i % 1000) == 0) {
+                System.out.println(String.format("Sent %d messages", i));
+            }
+        }
+
+        producer.send(session.createTextMessage("SHUTDOWN"));
+        Thread.sleep(1000*3);
+        connection.close();
+        System.exit(0);
+    }
+
+    private static String env(String key, String defaultValue) {
+        String rc = System.getenv(key);
+        if( rc== null )
+            return defaultValue;
+        return rc;
+    }
+
+    private static String arg(String []args, int index, String defaultValue) {
+        if( index < args.length )
+            return args[index];
+        else
+            return defaultValue;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/amqp/python/listener.py
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/amqp/python/listener.py b/assembly/src/release/examples/amqp/python/listener.py
new file mode 100755
index 0000000..dd647f3
--- /dev/null
+++ b/assembly/src/release/examples/amqp/python/listener.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+"""
+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 os
+import sys
+import time
+
+from proton import *
+
+user = os.getenv('ACTIVEMQ_USER') or 'admin'
+password = os.getenv('ACTIVEMQ_PASSWORD') or 'password'
+host = os.getenv('ACTIVEMQ_HOST') or '127.0.0.1'
+port = int(os.getenv('ACTIVEMQ_PORT') or 5672)
+destination = sys.argv[1:2] or ['topic://event']
+destination = destination[0]
+
+msg = Message()
+mng = Messenger()
+mng.password=password
+mng.start()
+mng.subscribe("amqp://%s@%s:%d/%s"%(user, host, port, destination))
+
+count = 0
+start = time.time()
+while True:
+  mng.recv(10)
+  while mng.incoming:
+    mng.get(msg)
+    if msg.body=="SHUTDOWN":
+      diff = time.time() - start
+      print 'Received %d frames in %f seconds' % (count, diff)
+      exit(0)
+    else:
+      if count==0:
+        start = time.time()
+      count+=1
+      if count % 1000 == 0:
+        print 'Received %d messages.' % (count)
+
+mng.stop()

http://git-wip-us.apache.org/repos/asf/activemq/blob/2ecf41d0/assembly/src/release/examples/amqp/python/publisher.py
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/amqp/python/publisher.py b/assembly/src/release/examples/amqp/python/publisher.py
new file mode 100755
index 0000000..23372ea
--- /dev/null
+++ b/assembly/src/release/examples/amqp/python/publisher.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+"""
+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 os
+import sys
+import time
+
+from proton import *
+
+user = os.getenv('ACTIVEMQ_USER') or 'admin'
+password = os.getenv('ACTIVEMQ_PASSWORD') or 'password'
+host = os.getenv('ACTIVEMQ_HOST') or '127.0.0.1'
+port = int(os.getenv('ACTIVEMQ_PORT') or 5672)
+destination = sys.argv[1:2] or ['topic://event']
+destination = destination[0]
+address = "amqp://%s@%s:%d/%s"%(user, host, port, destination)
+
+msg = Message()
+mng = Messenger()
+mng.password=password
+mng.start()
+
+messages = 10000
+
+msg.address = address
+msg.body = unicode('Hello World from Python')
+
+count = 0
+start = time.time()
+for _ in xrange(messages):
+  mng.put(msg)
+  count += 1
+  if count % 1000 == 0 :
+    print("Sent %d messages"%(count))
+
+msg.body = unicode("SHUTDOWN")
+mng.put(msg)
+mng.send
+
+diff = time.time() - start
+print 'Sent %s frames in %f seconds' % (count, diff)
+
+mng.stop()


Mime
View raw message