org.apache.qpid.example.pubsub
Class Subscriber

java.lang.Object
  extended by org.apache.qpid.example.pubsub.Client
      extended by org.apache.qpid.example.pubsub.Subscriber
All Implemented Interfaces:
MessageListener

public class Subscriber
extends Client
implements MessageListener

Simple client that listens for the specified number of msgs on the given Destinaton The class can take two arguments. java Subscriber Where: destination is either 'topic' or 'queue' (Default: topic) msgCount is the number of messages to send (Default : 100)


Field Summary
(package private)  CountDownLatch _count
           
 
Fields inherited from class org.apache.qpid.example.pubsub.Client
_connection, _destination, _session, _setup
 
Constructor Summary
Subscriber(String destination, int msgCount)
           
 
Method Summary
static void main(String[] args)
           
 void onMessage(Message message)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_count

CountDownLatch _count
Constructor Detail

Subscriber

public Subscriber(String destination,
                  int msgCount)
Method Detail

start

public void start()
Specified by:
start in class Client

main

public static void main(String[] args)

onMessage

public void onMessage(Message message)
Specified by:
onMessage in interface MessageListener


Licensed to the Apache Software Foundation