Qpid C++ Messaging API  1.39.0
qpid::messaging::Receiver Class Reference

#include <Receiver.h>

Inheritance diagram for qpid::messaging::Receiver:
qpid::messaging::Handle< ReceiverImpl >

Public Member Functions

QPID_MESSAGING_EXTERN Receiver (ReceiverImpl *impl=0)
 
QPID_MESSAGING_EXTERN Receiver (const Receiver &)
 
QPID_MESSAGING_EXTERN Receiveroperator= (const Receiver &)
 
QPID_MESSAGING_EXTERN bool get (Message &message, Duration timeout=Duration::FOREVER)
 
QPID_MESSAGING_EXTERN Message get (Duration timeout=Duration::FOREVER)
 
QPID_MESSAGING_EXTERN bool fetch (Message &message, Duration timeout=Duration::FOREVER)
 
QPID_MESSAGING_EXTERN Message fetch (Duration timeout=Duration::FOREVER)
 
QPID_MESSAGING_EXTERN void setCapacity (uint32_t)
 
QPID_MESSAGING_EXTERN uint32_t getCapacity ()
 
QPID_MESSAGING_EXTERN uint32_t getAvailable ()
 
QPID_MESSAGING_EXTERN uint32_t getUnsettled ()
 
QPID_MESSAGING_EXTERN void close ()
 
QPID_MESSAGING_EXTERN bool isClosed () const
 
QPID_MESSAGING_EXTERN const std::string & getName () const
 
QPID_MESSAGING_EXTERN Session getSession () const
 
QPID_MESSAGING_EXTERN Address getAddress () const
 
- Public Member Functions inherited from qpid::messaging::Handle< ReceiverImpl >
QPID_MESSAGING_INLINE_EXTERN bool isValid () const
 
QPID_MESSAGING_INLINE_EXTERN bool isNull () const
 
QPID_MESSAGING_INLINE_EXTERN operator bool () const
 
QPID_MESSAGING_INLINE_EXTERN bool operator! () const
 
void swap (Handle< ReceiverImpl > &h)
 

Friends

class qpid::messaging::PrivateImplRef< Receiver >
 

Additional Inherited Members

- Protected Types inherited from qpid::messaging::Handle< ReceiverImpl >
typedef ReceiverImpl Impl
 
- Protected Attributes inherited from qpid::messaging::Handle< ReceiverImpl >
Impl * impl
 

Detailed Description

Interface through which messages are received.

Member Function Documentation

◆ close()

QPID_MESSAGING_EXTERN void qpid::messaging::Receiver::close ( )

Cancels this Receiver.

◆ fetch() [1/2]

QPID_MESSAGING_EXTERN bool qpid::messaging::Receiver::fetch ( Message message,
Duration  timeout = Duration::FOREVER 
)

Retrieves a message from this Receiver's subscription or waits for up to the specified timeout for one to become available. Unlike get(), this method will check with the server that there is no message for the subscription this receiver is serving before returning false.

Returns
false if there is no message available after waiting for the specified time period, or if the receiver is closed, in which case isClosed() will be true.

◆ fetch() [2/2]

QPID_MESSAGING_EXTERN Message qpid::messaging::Receiver::fetch ( Duration  timeout = Duration::FOREVER)

Retrieves a message for this Receiver's subscription or waits for up to the specified timeout for one to become available. Unlike get(), this method will check with the server that there is no message for the subscription this receiver is serving before throwing an exception.

Exceptions
NoMessageAvailableif there is no message available after waiting for the specified timeout, or if the Receiver is closed, in which case isClose() will be true.

◆ get() [1/2]

QPID_MESSAGING_EXTERN bool qpid::messaging::Receiver::get ( Message message,
Duration  timeout = Duration::FOREVER 
)

Retrieves a message from this Receiver's local queue or waits for up to the specified timeout for a message to become available.

◆ get() [2/2]

QPID_MESSAGING_EXTERN Message qpid::messaging::Receiver::get ( Duration  timeout = Duration::FOREVER)

Retrieves a message from this Receiver's local queue or waits for up to the specified timeout for a message to become available.

Exceptions
NoMessageAvailableif there is no message to give after waiting for the specified timeout, or if the Receiver is closed, in which case isClosed() will be true.

◆ getAddress()

QPID_MESSAGING_EXTERN Address qpid::messaging::Receiver::getAddress ( ) const

Returns an address for this Receiver.

◆ getAvailable()

QPID_MESSAGING_EXTERN uint32_t qpid::messaging::Receiver::getAvailable ( )
Returns
the number of messages received and waiting to be fetched.

◆ getCapacity()

QPID_MESSAGING_EXTERN uint32_t qpid::messaging::Receiver::getCapacity ( )
Returns
the capacity of the Receiver. The capacity determines how many incoming messages can be held in the Receiver before being requested by a client via fetch() (or pushed to a listener).

◆ getName()

QPID_MESSAGING_EXTERN const std::string& qpid::messaging::Receiver::getName ( ) const

Returns the name of this Receiver.

◆ getSession()

QPID_MESSAGING_EXTERN Session qpid::messaging::Receiver::getSession ( ) const

Returns a handle to the session associated with this Receiver.

◆ getUnsettled()

QPID_MESSAGING_EXTERN uint32_t qpid::messaging::Receiver::getUnsettled ( )
Returns
the number of messages received on this Receiver that have been acknowledged, but for which that acknowledgement has not yet been confirmed as processed by the server.

◆ isClosed()

QPID_MESSAGING_EXTERN bool qpid::messaging::Receiver::isClosed ( ) const

Return true if the Receiver was closed by a call to close().

◆ setCapacity()

QPID_MESSAGING_EXTERN void qpid::messaging::Receiver::setCapacity ( uint32_t  )

Sets the capacity for the Receiver. The capacity determines how many incoming messages can be held in the Receiver before being requested by a client via fetch() (or pushed to a listener).


The documentation for this class was generated from the following file: