Qore oracle Module  3.1
 All Classes Namespaces Functions Variables Groups
Qore::Oracle::AQMessage Class Reference

Implementation of message to enqueue/dequeue from/to queues. More...

Public Member Functions

 constructor (*hash obj)
 Create a message object. More...
 
int getAttemptCount ()
 Return the number of attempts that have been made to dequeue the message. More...
 
string getCorrelation ()
 Get the correlation identifier of the message. More...
 
int getEnqueueDelay ()
 Return the number of seconds that a message is delayed for dequeuing. More...
 
int getExpiration ()
 Return the duration that the message is available for dequeuing. More...
 
*hash getObject ()
 Get the qore hash from the message (Oracle NTY object) More...
 
int getPriority ()
 Return the priority of the message. More...
 
int getState ()
 Return the state of the message at the time of the dequeue. More...
 
nothing setCorrelation (string c)
 Set the correlation identifier of the message. More...
 
nothing setEnqueueDelay (int delay)
 Set the number of seconds to delay the enqueued message. More...
 
nothing setExpiration (int exp)
 Set the duration that the message is available for dequeuing. More...
 
nothing setObject (hash h)
 Set hash as Oracle object for this message instance. More...
 
nothing setPriority (int prio)
 Set the priority of the message. More...
 

Detailed Description

Implementation of message to enqueue/dequeue from/to queues.

Restrictions:
Qore::PO_NO_DATABASE

Advanced properties can be set to base hash.

Member Function Documentation

Qore::Oracle::AQMessage::constructor ( *hash  obj)

Create a message object.

Parameters
objhash, or NOTHING. An Oracle object created with bindOracleObject
int Qore::Oracle::AQMessage::getAttemptCount ( )

Return the number of attempts that have been made to dequeue the message.

Return values
intthe count of dequeue attempts
string Qore::Oracle::AQMessage::getCorrelation ( )

Get the correlation identifier of the message.

Return values
stringa correlation identifier
int Qore::Oracle::AQMessage::getEnqueueDelay ( )

Return the number of seconds that a message is delayed for dequeuing.

Return values
inta delay value
int Qore::Oracle::AQMessage::getExpiration ( )

Return the duration that the message is available for dequeuing.

Parameters
intseconds count
*hash Qore::Oracle::AQMessage::getObject ( )

Get the qore hash from the message (Oracle NTY object)

Return values
hashor NOTHING
int Qore::Oracle::AQMessage::getPriority ( )

Return the priority of the message.

Return values
inta message priority
int Qore::Oracle::AQMessage::getState ( )

Return the state of the message at the time of the dequeue.

Return values
inta state of message

These constants are defined to handle this status:

  • OCI_UNKNOWN : the function has failed to get the message state
  • OCI_AMS_READY : the message is ready to be processed
  • OCI_AMS_WAITING : the message delay has not yet completed
  • OCI_AMS_PROCESSED : the message has been processed
  • OCI_AMS_EXPIRED : the message has moved to exception queue
nothing Qore::Oracle::AQMessage::setCorrelation ( string  c)

Set the correlation identifier of the message.

Parameters
ca message correlation text

Special pattern matching characters, such as "%" or "_" can be used. If more than one message satisfies the pattern, the order of dequeuing is undetermined.

nothing Qore::Oracle::AQMessage::setEnqueueDelay ( int  delay)

Set the number of seconds to delay the enqueued message.

Parameters
delayDelay in seconds

The delay represents the number of seconds after which a message is available for dequeuing. When the message is enqueued, its state is set to OCI_AMS_WAITING. When the delay expires, its state is set to OCI_AMS_READY.

If parameter 'value' is set to zero (default value), the message will be immediately available for dequeuing

nothing Qore::Oracle::AQMessage::setExpiration ( int  exp)

Set the duration that the message is available for dequeuing.

Parameters
expa expiration in seconds or -1

This parameter is an offset from the delay. While waiting for expiration, the message state is set to OCI_AMS_READY. If the message is not dequeued before it expires, it will be moved to the exception queue with the state OCI_AMS_EXPIRED. If parameter 'value' is set to -1 (default value), the message will not expire

nothing Qore::Oracle::AQMessage::setObject ( hash  h)

Set hash as Oracle object for this message instance.

Parameters
objhash, or NOTHING. An Oracle object created with bindOracleObject
nothing Qore::Oracle::AQMessage::setPriority ( int  prio)

Set the priority of the message.

Parameters
prioa priority value

The priority can be any number, including negative numbers. A smaller number indicates higher priority. Default value is zero.


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