- com
- pcbsys
- nirvana
- client
- nQueueSyncTransactionReader
This reader provides a synchronous queue reader model. More...
#include <nQueueSyncTransactionReader.h>
Public Member Functions | |
virtual void | commit () |
Commits all received events so far. More... | |
virtual void | commit (longlong eventId) |
Commits all events up to the event id specified. More... | |
virtual void | rollback () |
Rolls back all received events that have not been committed or rolled back previously. More... | |
virtual void | rollback (longlong eventId) |
Rolls back all events up to the specified event id that have not been committed or rolled back previously. More... | |
![]() | |
virtual void | close () |
Close the subscription, and notify the server. | |
virtual void | closeLocally () |
Close the subscription, but do not notify the server. | |
nConsumeEvent * | pop () |
This method places the client on the queue and will block until an event is placed onto the queue. More... | |
nConsumeEvent * | pop (longlong timeout) |
This method places the client on the queue and will block until an event is placed onto the queue or the specified timeout expires. More... | |
nConsumeEvent * | pop (longlong timeout, std::string selector) |
This method places the client on the queue and will block until an event is placed onto the queue or the specified timeout expires. More... | |
std::list< nConsumeEvent * > * | popEvents (int prefetchSize) |
This method places the client on the queue and will block until an event is placed onto the queue. More... | |
std::list< nConsumeEvent * > * | popEvents (int prefetchSize, longlong timeout) |
This method places the client on the queue and will block until an event is placed onto the queue or the specified timeout expires. More... | |
std::list< nConsumeEvent * > * | popEvents (int prefetchSize, longlong timeout, std::string selector) |
This method places the client on the queue and will block until an event is placed onto the queue or the specified timeout expires. More... | |
![]() | |
void | destroyReader () |
This call will release any outstanding resources on the server and close the reader. More... | |
void | destroyReaderLocally () |
This call will close local reader resources but remain subscribed at the server Any future calls to this object will work unless destroyReader() is called. More... | |
bool | hasConsumedEvents () |
Method to see whether the reader has consumed any events. More... | |
bool | isClosed () |
When a reader is closed, the physical subscription is closed at the server. More... | |
bool | isClosedLocally () |
A reader can be closed, but the physical subscription queue is not closed at the server. More... | |
nConsumeEvent ** | peek (nQueuePeekContext *pContext, int &nEvent) |
Performs a non destructive read. More... | |
Additional Inherited Members | |
![]() | |
static nQueuePeekContext * | createContext (int windowSize=0, const std::string &selector="") |
Creates a Queue Peek Context, which is used to traverse the queue. More... | |
![]() | |
nQueueReader (nQueue *pQueue, nQueueReaderContext *pContext) | |
Creates a reader for the specified queue using the given reader context. The reader will have its reader unique ID assigned implicitly. More... | |
nQueueReader (nQueue *pQueue, nQueueReaderContext *pContext, longlong readerUniqueId) | |
Creates a reader for the specified queue using the given reader context and reader unique identifier. Note: This constructor must only be used for asynchronous readers, which require special reader ID assignment, for all other cases use the constructor which implicitly assigns the reader unique identifier. More... | |
![]() | |
longlong | m_readerUniqueId |
An identifier that uniquely identifies the reader which performs this queue operation within the session. This will be paired with the connection id to uniquely identify the reader within the Universal Messaging server. Note: This should be considered final, it must be set during reader creation and not modified afterwards. More... | |
This reader provides a synchronous queue reader model.
Where the client can pop()
events from the queue and then decide either to commit the event, i.e. successfully processed it or to rollback, i.e. unable to process this event.
When the window size is reached and the client has yet to call commit or rollback the server will raise an exception on the pop()
command until the client has called either method.
|
virtual |
Commits all received events so far.
nSessionNotConnectedException | Client is not currently connected to the server |
nSessionPausedException | The session is currently paused |
nIllegalStateException | The operation could not complete because of a session/connection error |
Implements com::pcbsys::nirvana::client::nQueueTransactionReader.
|
virtual |
Commits all events up to the event id specified.
This means you can partially commit received events.
eventId | Event ID to commit to, inclusive |
nSessionNotConnectedException | Client is not currently connected to the server |
nSessionPausedException | The session is currently paused |
nIllegalStateException | The operation could not complete because of a session/connection error |
Implements com::pcbsys::nirvana::client::nQueueTransactionReader.
|
virtual |
Rolls back all received events that have not been committed or rolled back previously.
These events are then pushed back onto the queue for redelivery.
nSessionNotConnectedException | Client is not currently connected to the server |
nSessionPausedException | The session is currently paused |
nIllegalStateException | The operation could not complete because of a session/connection error |
Implements com::pcbsys::nirvana::client::nQueueTransactionReader.
|
virtual |
Rolls back all events up to the specified event id that have not been committed or rolled back previously.
These events are then pushed back onto the queue for redelivery.
eventId | Event Id to rollback to, inclusive |
nSessionNotConnectedException | Client is not currently connected to the server |
nSessionPausedException | The session is currently paused |
nIllegalStateException | The operation could not complete because of a session/connection error |
Implements com::pcbsys::nirvana::client::nQueueTransactionReader.