WebSphere MQ class: MQMessageConsumer
java.lang.Object | +----com.ibm.mq.jms.MQMessageConsumer |
The parent interface for all message consumers.
A client uses a message consumer to receive messages from a
Destination.
public MessageListener getMessageListener() throws JMSException
Get the message consumer's MessageListener.
public java.lang.String getMessageSelector() throws JMSException
Get this message consumer's message selector expression.
public Message receive() throws JMSException
Receive the next message produced for this message consumer.
public Message receive(long timeOut) throws JMSException
Receive the next message that arrives within the specified timeout interval. A timeout value of zero causes the call to wait indefinitely until a message arrives.
public Message receiveNoWait() throws JMSException
Receive the next message if one is immediately available.
public void setMessageListener(MessageListener listener) throws JMSException
Set the message consumer's MessageListener.
public void close() throws JMSException
Because a provider may allocate some resources outside of the JVM on behalf of a MessageConsumer, clients should close them when they are not needed. You cannot rely on garbage collection to reclaim these resources eventually, because this may not occur soon enough.
This call blocks until a receive or message listener in progress has completed.