Package org.apache.activemq.artemis.jms.client

## Class ActiveMQMessageConsumer

- java.lang.Object
- - org.apache.activemq.artemis.jms.client.ActiveMQMessageConsumer

- All Implemented Interfaces:
    `java.lang.AutoCloseable`, `javax.jms.MessageConsumer`, `javax.jms.QueueReceiver`, `javax.jms.TopicSubscriber`

      public final class ActiveMQMessageConsumer
      extends java.lang.Object
      implements javax.jms.QueueReceiver, javax.jms.TopicSubscriber

  ActiveMQ Artemis implementation of a JMS MessageConsumer.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `ActiveMQMessageConsumer​(ConnectionFactoryOptions options, ActiveMQConnection connection, ActiveMQSession session, ClientConsumer consumer, boolean noLocal, ActiveMQDestination destination, java.lang.String selector, org.apache.activemq.artemis.api.core.SimpleString autoDeleteQueueName)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `close()` |
    `javax.jms.MessageListener` | `getMessageListener()` |
    `java.lang.String` | `getMessageSelector()` |
    `boolean` | `getNoLocal()` |
    `javax.jms.Queue` | `getQueue()` |
    `javax.jms.Topic` | `getTopic()` |
    `boolean` | `isClosed()` |
    `javax.jms.Message` | `receive()` |
    `javax.jms.Message` | `receive​(long timeout)` |
    `javax.jms.Message` | `receiveNoWait()` |
    `void` | `setMessageListener​(javax.jms.MessageListener listener)` |
    `java.lang.String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ActiveMQMessageConsumer

          protected ActiveMQMessageConsumer​(ConnectionFactoryOptions options,
                                            ActiveMQConnection connection,
                                            ActiveMQSession session,
                                            ClientConsumer consumer,
                                            boolean noLocal,
                                            ActiveMQDestination destination,
                                            java.lang.String selector,
                                            org.apache.activemq.artemis.api.core.SimpleString autoDeleteQueueName)
                                     throws javax.jms.JMSException

      Throws:
        `javax.jms.JMSException`

  - ### Method Detail

    - #### getMessageSelector

          public java.lang.String getMessageSelector()
                                              throws javax.jms.JMSException

      Specified by:
        `getMessageSelector` in interface `javax.jms.MessageConsumer`
      Throws:
        `javax.jms.JMSException`

    - #### getMessageListener

          public javax.jms.MessageListener getMessageListener()
                                                       throws javax.jms.JMSException

      Specified by:
        `getMessageListener` in interface `javax.jms.MessageConsumer`
      Throws:
        `javax.jms.JMSException`

    - #### setMessageListener

          public void setMessageListener​(javax.jms.MessageListener listener)
                                  throws javax.jms.JMSException

      Specified by:
        `setMessageListener` in interface `javax.jms.MessageConsumer`
      Throws:
        `javax.jms.JMSException`

    - #### receive

          public javax.jms.Message receive()
                                    throws javax.jms.JMSException

      Specified by:
        `receive` in interface `javax.jms.MessageConsumer`
      Throws:
        `javax.jms.JMSException`

    - #### receive

          public javax.jms.Message receive​(long timeout)
                                    throws javax.jms.JMSException

      Specified by:
        `receive` in interface `javax.jms.MessageConsumer`
      Throws:
        `javax.jms.JMSException`

    - #### receiveNoWait

          public javax.jms.Message receiveNoWait()
                                          throws javax.jms.JMSException

      Specified by:
        `receiveNoWait` in interface `javax.jms.MessageConsumer`
      Throws:
        `javax.jms.JMSException`

    - #### close

          public void close()
                     throws javax.jms.JMSException

      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Specified by:
        `close` in interface `javax.jms.MessageConsumer`
      Throws:
        `javax.jms.JMSException`

    - #### getQueue

          public javax.jms.Queue getQueue()
                                   throws javax.jms.JMSException

      Specified by:
        `getQueue` in interface `javax.jms.QueueReceiver`
      Throws:
        `javax.jms.JMSException`

    - #### getTopic

          public javax.jms.Topic getTopic()
                                   throws javax.jms.JMSException

      Specified by:
        `getTopic` in interface `javax.jms.TopicSubscriber`
      Throws:
        `javax.jms.JMSException`

    - #### getNoLocal

          public boolean getNoLocal()
                             throws javax.jms.JMSException

      Specified by:
        `getNoLocal` in interface `javax.jms.TopicSubscriber`
      Throws:
        `javax.jms.JMSException`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### isClosed

          public boolean isClosed()