OCILIB (C and C++ Driver for Oracle)
4.7.5
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
|
AQ message. More...
#include <types.hpp>
Inherits ocilib::core::HandleHolder< OCI_Msg * >.
Public Types | |
enum | MessageStateValues { Ready = OCI_AMS_READY , Waiting = OCI_AMS_WAITING , Processed = OCI_AMS_PROCESSED , Expired = OCI_AMS_EXPIRED } |
Message state enumerated values. More... | |
typedef core::Enum< MessageStateValues > | MessageState |
Message state. | |
Public Member Functions | |
Message (const TypeInfo &typeInfo) | |
Create a message object based on the given payload type. | |
void | Reset () |
Reset all attributes of the message. | |
template<class T > | |
T | GetPayload () |
Get the object payload of the message. | |
template<class T > | |
void | SetPayload (const T &value) |
Set the object payload of the message. | |
Date | GetEnqueueTime () const |
return the time the message was enqueued | |
int | GetAttemptCount () const |
Return the number of attempts that have been made to dequeue the message. | |
MessageState | GetState () const |
Return the state of the message at the time of the dequeue. | |
Raw | GetID () const |
Return the ID of the message. | |
int | GetExpiration () const |
Return the duration that the message is available for dequeuing. | |
void | SetExpiration (int value) |
set the duration that the message is available for dequeuing | |
int | GetEnqueueDelay () const |
Return the number of seconds that a message is delayed for dequeuing. | |
void | SetEnqueueDelay (int value) |
set the number of seconds to delay the enqueued message | |
int | GetPriority () const |
Return the priority of the message. | |
void | SetPriority (int value) |
Set the priority of the message. | |
Raw | GetOriginalID () const |
Return the original ID of the message in the last queue that generated this message. | |
void | SetOriginalID (const Raw &value) |
Set the original ID of the message in the last queue that generated this message. | |
ostring | GetCorrelation () const |
Get the correlation identifier of the message. | |
void | SetCorrelation (const ostring &value) |
Set the correlation identifier of the message. | |
ostring | GetExceptionQueue () const |
Get the Exception queue name of the message. | |
void | SetExceptionQueue (const ostring &value) |
Set the name of the queue to which the message is moved to if it cannot be processed successfully. | |
Agent | GetSender () const |
Return the original sender of the message. | |
void | SetSender (const Agent &agent) |
Set the original sender of the message. | |
void | SetConsumers (std::vector< Agent > &agents) |
Set the recipient list of a message to enqueue. | |
AQ message.
This class wraps the OCILIB object handle OCI_Msg and its related methods
Message state.
Possible values are Message::MessageStateValues
|
inline |
Create a message object based on the given payload type.
typeInfo | - Type info object |
Definition at line 32 of file Message.hpp.
References ocilib::core::Check(), ocilib::TypeInfo::GetConnection(), and OCI_MsgCreate().
|
inline |
Reset all attributes of the message.
Definition at line 48 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgReset().
T ocilib::Message::GetPayload | ( | ) |
Get the object payload of the message.
void ocilib::Message::SetPayload | ( | const T & | value | ) |
Set the object payload of the message.
value | - Object payload |
|
inline |
return the time the message was enqueued
Definition at line 85 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgGetEnqueueTime().
|
inline |
Return the number of attempts that have been made to dequeue the message.
Definition at line 90 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgGetAttemptCount().
|
inline |
Return the state of the message at the time of the dequeue.
Definition at line 95 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgGetState().
|
inline |
Return the ID of the message.
Definition at line 100 of file Message.hpp.
References ocilib::core::Check(), ocilib::core::MakeRaw(), and OCI_MsgGetID().
|
inline |
Return the duration that the message is available for dequeuing.
Definition at line 111 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgGetExpiration().
|
inline |
set the duration that the message is available for dequeuing
value | - duration in seconds |
Definition at line 116 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgSetExpiration().
|
inline |
Return the number of seconds that a message is delayed for dequeuing.
Definition at line 121 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgGetEnqueueDelay().
|
inline |
set the number of seconds to delay the enqueued message
value | - Delay in seconds |
Definition at line 126 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgSetEnqueueDelay().
|
inline |
Return the priority of the message.
Definition at line 131 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgGetPriority().
|
inline |
Set the priority of the message.
value | - Message priority |
Definition at line 136 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgSetPriority().
|
inline |
Return the original ID of the message in the last queue that generated this message.
Definition at line 141 of file Message.hpp.
References ocilib::core::Check(), ocilib::core::MakeRaw(), and OCI_MsgGetOriginalID().
|
inline |
Set the original ID of the message in the last queue that generated this message.
value | - Message ID |
Definition at line 152 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgSetOriginalID().
|
inline |
Get the correlation identifier of the message.
Definition at line 159 of file Message.hpp.
References ocilib::core::Check(), ocilib::core::MakeString(), and OCI_MsgGetCorrelation().
|
inline |
Set the correlation identifier of the message.
value | - Message correlation text |
Definition at line 164 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgSetCorrelation().
|
inline |
Get the Exception queue name of the message.
Definition at line 169 of file Message.hpp.
References ocilib::core::Check(), ocilib::core::MakeString(), and OCI_MsgGetExceptionQueue().
|
inline |
Set the name of the queue to which the message is moved to if it cannot be processed successfully.
value | - Exception queue name |
"Messages are moved into exception queues in two cases : - If the number of unsuccessful dequeue attempts has exceeded the attribute 'max_retries' of given queue - if the message has expired. All messages in the exception queue are in the EXPIRED state. The default is the exception queue associated with the queue table. If the exception queue specified does not exist at the time of the move the message will be moved to the default exception queue associated with the queue table and a warning will be logged in the alert file. This attribute must refer to a valid queue name."
Definition at line 174 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgSetExceptionQueue().
|
inline |
Return the original sender of the message.
Definition at line 179 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgGetSender().
|
inline |
Set the original sender of the message.
agent | - Message sender |
Definition at line 184 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgSetSender().
|
inline |
Set the recipient list of a message to enqueue.
agents | - Recipients list |
Definition at line 189 of file Message.hpp.
References ocilib::core::Check(), and OCI_MsgSetConsumers().