A local queue to collect messages retrieved from a remote broker queue.
More...
#include <qpid/client/LocalQueue.h>
List of all members.
Detailed Description
A local queue to collect messages retrieved from a remote broker queue.
Create a queue and subscribe it using the SubscriptionManager. Messages from the remote queue on the broker will be stored in the local queue until you retrieve them.
Using a Local Queue
LocalQueue local_queue;
subscriptions.subscribe(local_queue, string("message_queue"));
for (int i=0; i<10; i++) {
Message message = local_queue.get();
std::cout << message.getData() << std::endl;
}
Getting Messages
-
get()
Message message = local_queue.get();
// Specifying timeouts (TIME_SEC, TIME_MSEC, TIME_USEC, TIME_NSEC)
include <qpid/sys/Time.h>
Message message;
local_queue.get(message, 5*sys::TIME_SEC);
Checking size
Definition at line 74 of file LocalQueue.h.
Constructor & Destructor Documentation
qpid::client::LocalQueue::LocalQueue |
( |
|
) |
|
qpid::client::LocalQueue::LocalQueue |
( |
const LocalQueue & |
|
) |
|
qpid::client::LocalQueue::~LocalQueue |
( |
|
) |
|
qpid::client::LocalQueue::LocalQueue |
( |
LocalQueueImpl * |
|
) |
|
Member Function Documentation
bool qpid::client::LocalQueue::empty |
( |
|
) |
const |
Return true if local queue is empty.
Wait up to timeout for the next message from the local queue.
- Parameters:
-
| result | Set to the message from the queue. |
| timeout | wait up this timeout for a message to appear. |
- Returns:
- true if result was set, false if queue was empty after timeout.
Get the next message off the local queue, or wait up to the timeout for message from the broker queue.
- Parameters:
-
| timeout | wait up this timeout for a message to appear. |
- Returns:
- message from the queue.
- Exceptions:
-
- Returns:
- true if handle is null. It is an error to call any function on a null handle.
Definition at line 46 of file Handle.h.
- Returns:
- true if handle is valid, i.e. not null.
Definition at line 43 of file Handle.h.
Conversion to bool supports idiom if (handle) { handle->...
}
Definition at line 49 of file Handle.h.
Operator ! supports idiom if (!handle) { do_if_handle_is_null(); }.
Definition at line 52 of file Handle.h.
size_t qpid::client::LocalQueue::size |
( |
|
) |
const |
Number of messages on the local queue.
Member Data Documentation
The documentation for this class was generated from the following file: