org.apache.qpid.topic
Class Listener
java.lang.Object
org.apache.qpid.topic.Listener
- All Implemented Interfaces:
- MessageListener
public class Listener
- extends Object
- implements MessageListener
This class has not kept up to date with the topic_listener in the cpp tests. It should provide identical behaviour for
cross testing the java and cpp clients.
How the cpp topic_publisher operates:
It publishes text messages to the default topic exchange, on virtual host "/test", on the topic "topic_control", for
the specified number of test messages to be sent.
It publishes a report request message (on same topic), with the header text field "TYPE", value "REPORT_REQUEST",
optionally within a transaction, and waits for the specified number of consumers to reply to this request. The
listeners should reply to this message on a queue named "response", on virtual host "/test", with some sort of message
about the number of messages received and how long it took, although the publisher never looks at the message content.
The publisher then send a message (on the same topic), with the header text field "TYPE", value "TERMINATION_REQUEST",
which the listener should close its connection and terminate upon receipt of.
- Todo:
- I've added lots of field table types in the report message, just to check if the other end can decode them
correctly. Not really the right place to test this, so remove them from
createReportResponseMessage(String)
once a better test exists.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONTROL_TOPIC
public static final String CONTROL_TOPIC
- See Also:
- Constant Field Values
RESPONSE_QUEUE
public static final String RESPONSE_QUEUE
- See Also:
- Constant Field Values
Listener
Listener(Connection connection,
int ackMode,
String name)
throws Exception
- Throws:
Exception
main
public static void main(String[] argv)
throws Exception
- Throws:
Exception
onMessage
public void onMessage(Message message)
- Specified by:
onMessage
in interface MessageListener
createReportResponseMessage
Message createReportResponseMessage(String msg)
throws JMSException
- Throws:
JMSException
isShutdown
boolean isShutdown(Message m)
throws JMSException
- Throws:
JMSException
isReport
boolean isReport(Message m)
throws JMSException
- Throws:
JMSException
createTopicConsumer
MessageConsumer createTopicConsumer()
throws Exception
- Throws:
Exception
createDurableTopicConsumer
MessageConsumer createDurableTopicConsumer(String name)
throws Exception
- Throws:
Exception
createControlPublisher
MessageProducer createControlPublisher()
throws Exception
- Throws:
Exception
Licensed to the Apache Software Foundation