Class TopicSubscriber

  • All Implemented Interfaces:
    jakarta.jms.MessageConsumer, jakarta.jms.TopicSubscriber, AutoCloseable

    public class TopicSubscriber
    extends MessageConsumer
    implements jakarta.jms.TopicSubscriber
    Implements the jakarta.jms.TopicSubscriber interface.
    • Constructor Detail

      • TopicSubscriber

        TopicSubscriber​(Session sess,
                        Destination topic,
                        String name,
                        String selector,
                        boolean noLocal,
                        boolean durableSubscriber)
                 throws jakarta.jms.JMSException
        Constructs a subscriber.
        Parameters:
        sess - The session the subscriber belongs to.
        topic - The topic the subscriber subscribes to.
        name - The subscription name, for durable subs only.
        selector - The selector for filtering messages.
        noLocal - true if the subscriber does not wish to consume messages published through the same connection.
        durableSubscriber - true if durable
        Throws:
        jakarta.jms.InvalidDestinationException - if an invalid destination is specified.
        jakarta.jms.IllegalStateException - If the connection is broken.
        jakarta.jms.JMSException - If the creation fails for any other reason.
    • Method Detail

      • getNoLocal

        public boolean getNoLocal()
                           throws jakarta.jms.JMSException
        API method.
        Specified by:
        getNoLocal in interface jakarta.jms.TopicSubscriber
        Throws:
        jakarta.jms.IllegalStateException - If the subscriber is closed.
        jakarta.jms.JMSException
      • getTopic

        public jakarta.jms.Topic getTopic()
                                   throws jakarta.jms.JMSException
        API method.
        Specified by:
        getTopic in interface jakarta.jms.TopicSubscriber
        Throws:
        jakarta.jms.IllegalStateException - If the subscriber is closed.
        jakarta.jms.JMSException