From b5df74c2a2b4b62783f05b8801a5d0233dda5791 Mon Sep 17 00:00:00 2001 From: Robert Godfrey Date: Tue, 20 Jan 2015 16:50:09 +0000 Subject: QPID-6294 : revert unintended hanges to example file git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1653295 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/qpid/example/Hello.java | 37 ++-------------------- 1 file changed, 3 insertions(+), 34 deletions(-) (limited to 'qpid/java/client/example/src') diff --git a/qpid/java/client/example/src/main/java/org/apache/qpid/example/Hello.java b/qpid/java/client/example/src/main/java/org/apache/qpid/example/Hello.java index aab08ebf0f..109a72bcbf 100644 --- a/qpid/java/client/example/src/main/java/org/apache/qpid/example/Hello.java +++ b/qpid/java/client/example/src/main/java/org/apache/qpid/example/Hello.java @@ -34,9 +34,6 @@ import javax.jms.TextMessage; import javax.naming.Context; import javax.naming.InitialContext; -import org.apache.qpid.client.AMQConnection; -import org.apache.qpid.configuration.ClientProperties; - public class Hello { @@ -45,38 +42,10 @@ public class Hello { } - public static void main(String[] args) throws Exception + public static void main(String[] args) { - System.setProperty(ClientProperties.AMQP_VERSION, "0-91"); - System.setProperty(ClientProperties.MAX_PREFETCH_PROP_NAME, "0"); - System.setProperty(ClientProperties.DEST_SYNTAX, "BURL"); - - Connection conn = new AMQConnection("127.0.0.1", 5672, "admin","admin", "client", "/"); - - conn.start(); - - Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); - Destination destination = session.createQueue("queue"); - - MessageConsumer consumer = session.createConsumer(destination); - MessageProducer producer = session.createProducer(destination); - - for(int i = 0 ; i < 2 ; i ++) - { - TextMessage message = (TextMessage) consumer.receive(1000l); - System.out.println(message == null ? "null" : message.getText()); - } - for(int i = 0 ; i < 2 ; i ++) - { - TextMessage message = session.createTextMessage("Hello " + i); - producer.send(message); - } - - for(int i = 0 ; i < 2 ; i ++) - { - TextMessage message = (TextMessage) consumer.receive(1000l); - System.out.println(message == null ? "null" : message.getText()); - } + Hello hello = new Hello(); + hello.runTest(); } private void runTest() -- cgit v1.2.1