WebLogic Messaging API Class Library |

# IMessageConsumer Methods

The methods of the IMessageConsumer interface are listed below. For a complete list of IMessageConsumer interface members, see the IMessageConsumer Members topic.

#### Public Instance Methods

Close | Closes the message consumer. Since JMS allocates some resources on behalf of a `IMessageConsumer` outside the .NET CLR, clients should Close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough. There is no need to close a message consumer if the consumer's parent session or connection is closed, or if its parent context has been closed with CloseAll. This call blocks until a `Receive` or message listener in progress has completed. A blocked message consumer `Receive` call returns null when this message consumer is closed.
Receive | Overloaded. Receives the next message produced for this message consumer. This call blocks indefinitely until a message is produced, the connection is stopped, or until this message consumer is closed. If this `Receive` is done within a transaction, the consumer retains the message until the transaction commits or rolls back.
ReceiveNoWait | Receives the next message if one is immediately available.

#### See Also

IMessageConsumer Interface | WebLogic.Messaging Namespace | ISession