summaryrefslogtreecommitdiff
path: root/qpid/java/client/example
diff options
context:
space:
mode:
authorJonathan Robie <jonathan@apache.org>2010-04-16 19:37:31 +0000
committerJonathan Robie <jonathan@apache.org>2010-04-16 19:37:31 +0000
commit4bd14c765ab28a92e81271b69defbb0f163ff8c5 (patch)
tree29ff2005f8d1844d183ae0d543f2f03780f078f3 /qpid/java/client/example
parentdc3cb48f2c9f33447705e78c2ffb0fb3c7549c82 (diff)
downloadqpid-python-4bd14c765ab28a92e81271b69defbb0f163ff8c5.tar.gz
Simplifying with Rajith's help
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@935058 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/client/example')
-rw-r--r--qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/hello/Hello.java11
1 files changed, 2 insertions, 9 deletions
diff --git a/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/hello/Hello.java b/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/hello/Hello.java
index 1cc46a8cef..ef8d4725fe 100644
--- a/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/hello/Hello.java
+++ b/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/hello/Hello.java
@@ -27,8 +27,6 @@ import java.util.Properties;
public class Hello {
- private static final String CLASS = "Hello";
-
public Hello() {
}
@@ -51,6 +49,7 @@ public class Hello {
e.printStackTrace();
}
});
+ connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination destination = (Destination) context.lookup("topicExchange");
@@ -62,18 +61,12 @@ public class Hello {
messageProducer.send(message);
message = messageConsumer.receive();
- if (message instanceof TextMessage) {
- String text = ((TextMessage) message).getText();
- System.out.println(text);
- } else {
- System.out.println("Ooops, not a TextMessage!");
- }
+ System.out.println(message.getText());
connection.close();
context.close();
}
catch (Exception exp) {
- System.err.println(CLASS + ": Caught an Exception: " + exp);
exp.printStackTrace();
}
}