Class Subscriber

  • All Implemented Interfaces:
    Runnable

    public class Subscriber
    extends Object
    implements Runnable
    This is used to listen to messages on a destination. You can control the durability (topics only) and selector used using the properties.
    • Field Detail

      • logger

        private static final org.slf4j.Logger logger
      • stop

        protected boolean stop
      • stopped

        protected boolean stopped
      • started

        protected boolean started
      • limitCount

        protected int limitCount
      • sleepTime

        protected long sleepTime
      • maxCount

        protected int maxCount
      • durable

        protected boolean durable
      • selector

        protected String selector
      • username

        protected String username
      • password

        protected String password
    • Constructor Detail

      • Subscriber

        public Subscriber​(String name)
    • Method Detail

      • setDestination

        public void setDestination​(Destination destination)
      • getCount

        public int getCount()
      • setSleepTime

        public void setSleepTime​(long sleepTime)
      • setMaxCount

        public void setMaxCount​(int maxCount)
      • setDurable

        public void setDurable​(boolean durable)
      • setSelector

        public void setSelector​(String selector)
      • clearMessages

        public void clearMessages()
      • stop

        public void stop()
      • isStopped

        public boolean isStopped()
      • isStarted

        public boolean isStarted()
      • setUsername

        public void setUsername​(String username)
      • setPassword

        public void setPassword​(String password)
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • main

        public static void main​(String[] args)