OCILIB (C Driver for Oracle) 3.12.1
|
OCILIB supports Oracle Advanced Queues features
Let's Oracle talk about this features !
Oracle Streams AQ provides database-integrated message queuing functionality. It is built on top of Oracle Streams and leverages the functions of Oracle Database so that messages can be stored persistently, propagated between queues on different computers and databases, and transmitted using Oracle Net Services and HTTP(S). Because Oracle Streams AQ is implemented in database tables, all operational benefits of high availability, scalability, and reliability are also applicable to queue data. Standard database features such as recovery, restart, and security are supported by Oracle Streams AQ. You can use database development and management tools such as Oracle Enterprise Manager to monitor queues. Like other database tables, queue tables can be imported and exported.
OCILIB provides a (nearly) full C implementation of Advanced Queues available in Oracle OCI and proposes the following datatypes :
OCILIB support AQ messages notification with Oracle Client 10gR2 or above
Note that the only AQ features not supported yet by OCILIB are :
OCILIB provides as well a C API to administrate queues and queue tables initially reserved to PL/SQL and Java (wrappers around PL/SQL calls). This API, based on internal PL/SQL calls wrapping the DBMS_AQADM packages procedures, allow the following actions :
Note that the user connected to the database needs particular privileges to manipulate or administrate queues (See Oracle Streams - Advanced Queuing User's Guide for more informations on these privileges)
#include "ocilib.h" int main(int argc, char *argv[]) { OCI_Connection *con; OCI_Enqueue *enq; OCI_Dequeue *deq; OCI_Msg *msg; OCI_TypeInfo *inf; OCI_Object *obj; OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT); con = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT); inf = OCI_TypeInfoGet(con, "MY_MESSAGE", OCI_TIF_TYPE); enq = OCI_EnqueueCreate(inf, "my_queue"); deq = OCI_DequeueCreate(inf, "my_queue"); msg = OCI_MsgCreate(inf); obj = OCI_ObjectCreate(con, inf); OCI_ObjectSetString(obj, "TITLE", "NEXT MEETING"); OCI_ObjectSetString(obj, "CONTENT", "12:00 PM IN STARBUCKS"); OCI_MsgSetObject(msg, obj); OCI_EnqueuePut(enq, msg); OCI_MsgFree(msg); OCI_ObjectFree(obj); OCI_Commit(con); msg = OCI_DequeueGet(deq); obj = OCI_MsgGetObject(msg); printf("MSG '%s' => %s\n", OCI_ObjectGetString(obj, "TITLE"), OCI_ObjectGetString(obj, "CONTENT")); OCI_EnqueueFree(enq); OCI_DequeueFree(deq); OCI_ConnectionFree(con); OCI_Cleanup(); return EXIT_SUCCESS; }
Functions | |
OCI_EXPORT OCI_Msg *OCI_API | OCI_MsgCreate (OCI_TypeInfo *typinf) |
Create a message object based on the given payload type. | |
OCI_EXPORT boolean OCI_API | OCI_MsgFree (OCI_Msg *msg) |
Free a message object. | |
OCI_EXPORT boolean OCI_API | OCI_MsgReset (OCI_Msg *msg) |
Reset all attributes of a message object. | |
OCI_EXPORT OCI_Object *OCI_API | OCI_MsgGetObject (OCI_Msg *msg) |
Get the object payload of the given message. | |
OCI_EXPORT boolean OCI_API | OCI_MsgSetObject (OCI_Msg *msg, OCI_Object *obj) |
Set the object payload of the given message. | |
OCI_EXPORT boolean OCI_API | OCI_MsgGetRaw (OCI_Msg *msg, void *raw, unsigned int *size) |
Get the RAW payload of the given message. | |
OCI_EXPORT boolean OCI_API | OCI_MsgSetRaw (OCI_Msg *msg, const void *raw, unsigned int size) |
Set the RAW payload of the given message. | |
OCI_EXPORT int OCI_API | OCI_MsgGetAttemptCount (OCI_Msg *msg) |
Return the number of attempts that have been made to dequeue the message. | |
OCI_EXPORT int OCI_API | OCI_MsgGetEnqueueDelay (OCI_Msg *msg) |
Return the number of seconds that a message is delayed for dequeuing. | |
OCI_EXPORT boolean OCI_API | OCI_MsgSetEnqueueDelay (OCI_Msg *msg, int value) |
set the number of seconds to delay the enqueued message | |
OCI_EXPORT OCI_Date *OCI_API | OCI_MsgGetEnqueueTime (OCI_Msg *msg) |
return the time the message was enqueued | |
OCI_EXPORT int OCI_API | OCI_MsgGetExpiration (OCI_Msg *msg) |
Return the duration that the message is available for dequeuing. | |
OCI_EXPORT boolean OCI_API | OCI_MsgSetExpiration (OCI_Msg *msg, int value) |
set the duration that the message is available for dequeuing | |
OCI_EXPORT unsigned int OCI_API | OCI_MsgGetState (OCI_Msg *msg) |
Return the state of the message at the time of the dequeue. | |
OCI_EXPORT int OCI_API | OCI_MsgGetPriority (OCI_Msg *msg) |
Return the priority of the message. | |
OCI_EXPORT boolean OCI_API | OCI_MsgSetPriority (OCI_Msg *msg, int value) |
Set the priority of the message. | |
OCI_EXPORT boolean OCI_API | OCI_MsgGetID (OCI_Msg *msg, void *id, unsigned int *len) |
Return the ID of the message. | |
OCI_EXPORT boolean OCI_API | OCI_MsgGetOriginalID (OCI_Msg *msg, void *id, unsigned int *len) |
Return the original ID of the message in the last queue that generated this message. | |
OCI_EXPORT boolean OCI_API | OCI_MsgSetOriginalID (OCI_Msg *msg, const void *id, unsigned int len) |
Set the original ID of the message in the last queue that generated this message. | |
OCI_EXPORT OCI_Agent *OCI_API | OCI_MsgGetSender (OCI_Msg *msg) |
Return the original sender of a message. | |
OCI_EXPORT boolean OCI_API | OCI_MsgSetSender (OCI_Msg *msg, OCI_Agent *sender) |
Set the original sender of a message. | |
OCI_EXPORT boolean OCI_API | OCI_MsgSetConsumers (OCI_Msg *msg, OCI_Agent **consumers, unsigned int count) |
Set the recipient list of a message to enqueue. | |
OCI_EXPORT const mtext *OCI_API | OCI_MsgGetCorrelation (OCI_Msg *msg) |
Get the correlation identifier of the message. | |
OCI_EXPORT boolean OCI_API | OCI_MsgSetCorrelation (OCI_Msg *msg, const mtext *correlation) |
set the correlation identifier of the message | |
OCI_EXPORT const mtext *OCI_API | OCI_MsgGetExceptionQueue (OCI_Msg *msg) |
Get the Exception queue name of the message. | |
OCI_EXPORT boolean OCI_API | OCI_MsgSetExceptionQueue (OCI_Msg *msg, const mtext *queue) |
Set the name of the queue to which the message is moved to if it cannot be processed successfully. | |
OCI_EXPORT OCI_Enqueue *OCI_API | OCI_EnqueueCreate (OCI_TypeInfo *typinf, const mtext *name) |
Create a Enqueue object for the given queue. | |
OCI_EXPORT boolean OCI_API | OCI_EnqueueFree (OCI_Enqueue *enqueue) |
Free a Enqueue object. | |
OCI_EXPORT boolean OCI_API | OCI_EnqueuePut (OCI_Enqueue *enqueue, OCI_Msg *msg) |
Enqueue a message on queue associated to the Enqueue object. | |
OCI_EXPORT boolean OCI_API | OCI_EnqueueSetSequenceDeviation (OCI_Enqueue *enqueue, unsigned int sequence) |
Set the enqueing sequence of messages to put in the queue. | |
OCI_EXPORT unsigned int OCI_API | OCI_EnqueueGetSequenceDeviation (OCI_Enqueue *enqueue) |
Return the sequence deviation of messages to enqueue to the queue. | |
OCI_EXPORT boolean OCI_API | OCI_EnqueueSetVisibility (OCI_Enqueue *enqueue, unsigned int visibility) |
Set whether the new message is enqueued as part of the current transaction. | |
OCI_EXPORT unsigned int OCI_API | OCI_EnqueueGetVisibility (OCI_Enqueue *enqueue) |
Get the enqueueing/locking behavior. | |
OCI_EXPORT boolean OCI_API | OCI_EnqueueSetRelativeMsgID (OCI_Enqueue *enqueue, const void *id, unsigned int len) |
Set a message identifier to use for enqueuing messages using a sequence deviation. | |
OCI_EXPORT boolean OCI_API | OCI_EnqueueGetRelativeMsgID (OCI_Enqueue *enqueue, void *id, unsigned int *len) |
Get the current associated message identifier used for enqueuing messages using a sequence deviation. | |
OCI_EXPORT OCI_Dequeue *OCI_API | OCI_DequeueCreate (OCI_TypeInfo *typinf, const mtext *name) |
Create a Dequeue object for the given queue. | |
OCI_EXPORT boolean OCI_API | OCI_DequeueFree (OCI_Dequeue *dequeue) |
Free a Dequeue object. | |
OCI_EXPORT OCI_Msg *OCI_API | OCI_DequeueGet (OCI_Dequeue *dequeue) |
Dequeue messages from the given queue. | |
OCI_EXPORT boolean OCI_API | OCI_DequeueSubscribe (OCI_Dequeue *dequeue, unsigned int port, unsigned int timeout, POCI_NOTIFY_AQ callback) |
Subscribe for asynchronous messages notifications. | |
OCI_EXPORT boolean OCI_API | OCI_DequeueUnsubscribe (OCI_Dequeue *dequeue) |
Unsubscribe for asynchronous messages notifications. | |
OCI_EXPORT boolean OCI_API | OCI_DequeueSetConsumer (OCI_Dequeue *dequeue, const mtext *consumer) |
Set the current consumer name to retrieve message for. | |
OCI_EXPORT const mtext *OCI_API | OCI_DequeueGetConsumer (OCI_Dequeue *dequeue) |
Get the current consumer name associated with the dequeueing process. | |
OCI_EXPORT boolean OCI_API | OCI_DequeueSetCorrelation (OCI_Dequeue *dequeue, const mtext *pattern) |
set the correlation identifier of the message to be dequeued | |
OCI_EXPORT const mtext *OCI_API | OCI_DequeueGetCorrelation (OCI_Dequeue *dequeue) |
Get the correlation identifier of the message to be dequeued. | |
OCI_EXPORT boolean OCI_API | OCI_DequeueSetRelativeMsgID (OCI_Dequeue *dequeue, const void *id, unsigned int len) |
Set the message identifier of the message to be dequeued. | |
OCI_EXPORT boolean OCI_API | OCI_DequeueGetRelativeMsgID (OCI_Dequeue *dequeue, void *id, unsigned int *len) |
Get the message identifier of the message to be dequeued. | |
OCI_EXPORT boolean OCI_API | OCI_DequeueSetVisibility (OCI_Dequeue *dequeue, unsigned int visibility) |
Set whether the new message is dequeued as part of the current transaction. | |
OCI_EXPORT unsigned int OCI_API | OCI_DequeueGetVisibility (OCI_Dequeue *dequeue) |
Get the dequeueing/locking behavior. | |
OCI_EXPORT boolean OCI_API | OCI_DequeueSetMode (OCI_Dequeue *dequeue, unsigned int mode) |
Set the dequeueing/locking behavior. | |
OCI_EXPORT unsigned int OCI_API | OCI_DequeueGetMode (OCI_Dequeue *dequeue) |
Get the dequeueing/locking behavior. | |
OCI_EXPORT boolean OCI_API | OCI_DequeueSetNavigation (OCI_Dequeue *dequeue, unsigned int position) |
Set the position of messages to be retrieved. | |
OCI_EXPORT unsigned int OCI_API | OCI_DequeueGetNavigation (OCI_Dequeue *dequeue) |
Return the navigation position of messages to retrieve from the queue. | |
OCI_EXPORT boolean OCI_API | OCI_DequeueSetWaitTime (OCI_Dequeue *dequeue, int timeout) |
set the time that OCIDequeueGet() waits for messages if no messages are currently available | |
OCI_EXPORT int OCI_API | OCI_DequeueGetWaitTime (OCI_Dequeue *dequeue) |
Return the time that OCIDequeueGet() waits for messages if no messages are currently available. | |
OCI_EXPORT boolean OCI_API | OCI_DequeueSetAgentList (OCI_Dequeue *dequeue, OCI_Agent **consumers, unsigned int count) |
Set the Agent list to listen to message for. | |
OCI_EXPORT OCI_Agent *OCI_API | OCI_DequeueListen (OCI_Dequeue *dequeue, int timeout) |
Listen for messages that match any recipient of the associated Agent list. | |
OCI_EXPORT OCI_Agent *OCI_API | OCI_AgentCreate (OCI_Connection *con, const mtext *name, const mtext *address) |
Create an AQ agent object. | |
OCI_EXPORT boolean OCI_API | OCI_AgentFree (OCI_Agent *agent) |
Free an AQ agent object. | |
OCI_EXPORT boolean OCI_API | OCI_AgentSetName (OCI_Agent *agent, const mtext *name) |
Set the given AQ agent name. | |
OCI_EXPORT const mtext *OCI_API | OCI_AgentGetName (OCI_Agent *agent) |
Get the given AQ agent name. | |
OCI_EXPORT boolean OCI_API | OCI_AgentSetAddress (OCI_Agent *agent, const mtext *address) |
Set the given AQ agent address. | |
OCI_EXPORT const mtext *OCI_API | OCI_AgentGetAddress (OCI_Agent *agent) |
Get the given AQ agent address. | |
OCI_EXPORT boolean OCI_API | OCI_QueueCreate (OCI_Connection *con, const mtext *queue_name, const mtext *queue_table, unsigned int queue_type, unsigned int max_retries, unsigned int retry_delay, unsigned int retention_time, boolean dependency_tracking, const mtext *comment) |
Create a queue. | |
OCI_EXPORT boolean OCI_API | OCI_QueueAlter (OCI_Connection *con, const mtext *queue_name, unsigned int max_retries, unsigned int retry_delay, unsigned int retention_time, const mtext *comment) |
Alter the given queue. | |
OCI_EXPORT boolean OCI_API | OCI_QueueDrop (OCI_Connection *con, const mtext *queue_name) |
Drop the given queue. | |
OCI_EXPORT boolean OCI_API | OCI_QueueStart (OCI_Connection *con, const mtext *queue_name, boolean enqueue, boolean dequeue) |
Start the given queue. | |
OCI_EXPORT boolean OCI_API | OCI_QueueStop (OCI_Connection *con, const mtext *queue_name, boolean enqueue, boolean dequeue, boolean wait) |
Stop enqueuing or dequeuing or both on the given queue. | |
OCI_EXPORT boolean OCI_API | OCI_QueueTableCreate (OCI_Connection *con, const mtext *queue_table, const mtext *queue_payload_type, const mtext *storage_clause, const mtext *sort_list, boolean multiple_consumers, unsigned int message_grouping, const mtext *comment, unsigned int primary_instance, unsigned int secondary_instance, const mtext *compatible) |
Create a queue table for messages of the given type. | |
OCI_EXPORT boolean OCI_API | OCI_QueueTableAlter (OCI_Connection *con, const mtext *queue_table, const mtext *comment, unsigned int primary_instance, unsigned int secondary_instance) |
Alter the given queue table. | |
OCI_EXPORT boolean OCI_API | OCI_QueueTableDrop (OCI_Connection *con, const mtext *queue_table, boolean force) |
Drop the given queue table. | |
OCI_EXPORT boolean OCI_API | OCI_QueueTablePurge (OCI_Connection *con, const mtext *queue_table, const mtext *purge_condition, boolean block, unsigned int delivery_mode) |
Purge messages from the given queue table. | |
OCI_EXPORT boolean OCI_API | OCI_QueueTableMigrate (OCI_Connection *con, const mtext *queue_table, const mtext *compatible) |
Migrate a queue table from one version to another. |
OCI_EXPORT OCI_Msg* OCI_API OCI_MsgCreate | ( | OCI_TypeInfo * | typinf | ) |
Create a message object based on the given payload type.
typinf | - Type info handle |
Definition at line 46 of file msg.c.
References OCI_MsgFree(), and OCI_ObjectCreate().
Referenced by OCI_DequeueCreate().
OCI_EXPORT boolean OCI_API OCI_MsgFree | ( | OCI_Msg * | msg | ) |
Free a message object.
msg | - Message handle |
Definition at line 106 of file msg.c.
References OCI_AgentFree(), and OCI_ObjectFree().
Referenced by OCI_DequeueFree(), and OCI_MsgCreate().
OCI_EXPORT boolean OCI_API OCI_MsgReset | ( | OCI_Msg * | msg | ) |
Reset all attributes of a message object.
msg | - Message handle |
Definition at line 173 of file msg.c.
References OCI_MsgSetConsumers(), OCI_MsgSetCorrelation(), OCI_MsgSetEnqueueDelay(), OCI_MsgSetExceptionQueue(), OCI_MsgSetExpiration(), OCI_MsgSetObject(), OCI_MsgSetOriginalID(), OCI_MsgSetPriority(), OCI_MsgSetRaw(), and OCI_MsgSetSender().
Referenced by OCI_DequeueGet().
OCI_EXPORT OCI_Object* OCI_API OCI_MsgGetObject | ( | OCI_Msg * | msg | ) |
OCI_EXPORT boolean OCI_API OCI_MsgSetObject | ( | OCI_Msg * | msg, |
OCI_Object * | obj | ||
) |
Set the object payload of the given message.
msg | - Message handle |
obj | - Object handle |
Definition at line 237 of file msg.c.
References OCI_ObjectAssign().
Referenced by OCI_MsgReset().
OCI_EXPORT boolean OCI_API OCI_MsgGetRaw | ( | OCI_Msg * | msg, |
void * | raw, | ||
unsigned int * | size | ||
) |
Get the RAW payload of the given message.
msg | - Message handle |
raw | - Input buffer |
size | - Input buffer maximum size |
OCI_EXPORT boolean OCI_API OCI_MsgSetRaw | ( | OCI_Msg * | msg, |
const void * | raw, | ||
unsigned int | size | ||
) |
Set the RAW payload of the given message.
msg | - Message handle |
raw | - Raw data |
size | - Raw data size |
Definition at line 312 of file msg.c.
Referenced by OCI_MsgReset().
OCI_EXPORT int OCI_API OCI_MsgGetAttemptCount | ( | OCI_Msg * | msg | ) |
OCI_EXPORT int OCI_API OCI_MsgGetEnqueueDelay | ( | OCI_Msg * | msg | ) |
Return the number of seconds that a message is delayed for dequeuing.
msg | - Message handle |
OCI_EXPORT boolean OCI_API OCI_MsgSetEnqueueDelay | ( | OCI_Msg * | msg, |
int | value | ||
) |
set the number of seconds to delay the enqueued message
msg | - Message handle |
value | - Delay in seconds |
Definition at line 413 of file msg.c.
Referenced by OCI_MsgReset().
OCI_EXPORT int OCI_API OCI_MsgGetExpiration | ( | OCI_Msg * | msg | ) |
Return the duration that the message is available for dequeuing.
msg | - Message handle |
OCI_EXPORT boolean OCI_API OCI_MsgSetExpiration | ( | OCI_Msg * | msg, |
int | value | ||
) |
set the duration that the message is available for dequeuing
msg | - Message handle |
value | - duration in seconds |
Definition at line 515 of file msg.c.
Referenced by OCI_MsgReset().
OCI_EXPORT unsigned int OCI_API OCI_MsgGetState | ( | OCI_Msg * | msg | ) |
Return the state of the message at the time of the dequeue.
msg | - Message handle |
OCI_EXPORT int OCI_API OCI_MsgGetPriority | ( | OCI_Msg * | msg | ) |
Return the priority of the message.
msg | - Message handle |
OCI_EXPORT boolean OCI_API OCI_MsgSetPriority | ( | OCI_Msg * | msg, |
int | value | ||
) |
Set the priority of the message.
msg | - Message handle |
value | - Message priority |
Definition at line 620 of file msg.c.
Referenced by OCI_MsgReset().
OCI_EXPORT boolean OCI_API OCI_MsgGetID | ( | OCI_Msg * | msg, |
void * | id, | ||
unsigned int * | len | ||
) |
Return the ID of the message.
msg | - Message handle |
id | - Input buffer |
len | - Input buffer maximum size |
OCI_EXPORT boolean OCI_API OCI_MsgGetOriginalID | ( | OCI_Msg * | msg, |
void * | id, | ||
unsigned int * | len | ||
) |
Return the original ID of the message in the last queue that generated this message.
msg | - Message handle |
id | - Input buffer |
len | - Input buffer maximum size |
OCI_EXPORT boolean OCI_API OCI_MsgSetOriginalID | ( | OCI_Msg * | msg, |
const void * | id, | ||
unsigned int | len | ||
) |
Set the original ID of the message in the last queue that generated this message.
msg | - Message handle |
id | - Message ID |
len | - Message ID size |
Definition at line 742 of file msg.c.
Referenced by OCI_MsgReset().
Set the original sender of a message.
msg | - Message handle |
sender | - Message sender |
Definition at line 926 of file msg.c.
Referenced by OCI_MsgReset().
OCI_EXPORT boolean OCI_API OCI_MsgSetConsumers | ( | OCI_Msg * | msg, |
OCI_Agent ** | consumers, | ||
unsigned int | count | ||
) |
Set the recipient list of a message to enqueue.
msg | - Message handle |
consumers | - Recipients list (array of agent handles) |
count | - Number of recipients |
Definition at line 957 of file msg.c.
Referenced by OCI_MsgReset().
OCI_EXPORT const mtext* OCI_API OCI_MsgGetCorrelation | ( | OCI_Msg * | msg | ) |
Get the correlation identifier of the message.
msg | - Message handle |
OCI_EXPORT boolean OCI_API OCI_MsgSetCorrelation | ( | OCI_Msg * | msg, |
const mtext * | correlation | ||
) |
set the correlation identifier of the message
msg | - Message handle |
correlation | - Message correlation text |
Definition at line 810 of file msg.c.
Referenced by OCI_MsgReset().
OCI_EXPORT const mtext* OCI_API OCI_MsgGetExceptionQueue | ( | OCI_Msg * | msg | ) |
Get the Exception queue name of the message.
msg | - Message handle |
OCI_EXPORT boolean OCI_API OCI_MsgSetExceptionQueue | ( | OCI_Msg * | msg, |
const mtext * | queue | ||
) |
Set the name of the queue to which the message is moved to if it cannot be processed successfully.
msg | - Message handle |
queue | - Exception queue name |
"Messages are moved into exception queues in two cases :
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 863 of file msg.c.
Referenced by OCI_MsgReset().
OCI_EXPORT OCI_Enqueue* OCI_API OCI_EnqueueCreate | ( | OCI_TypeInfo * | typinf, |
const mtext * | name | ||
) |
Create a Enqueue object for the given queue.
typinf | - Type info handle |
name | - Queue name |
Definition at line 46 of file enqueue.c.
References OCI_EnqueueFree().
OCI_EXPORT boolean OCI_API OCI_EnqueueFree | ( | OCI_Enqueue * | enqueue | ) |
Free a Enqueue object.
enqueue | - Enqueue handle |
Definition at line 96 of file enqueue.c.
Referenced by OCI_EnqueueCreate().
OCI_EXPORT boolean OCI_API OCI_EnqueuePut | ( | OCI_Enqueue * | enqueue, |
OCI_Msg * | msg | ||
) |
OCI_EXPORT boolean OCI_API OCI_EnqueueSetSequenceDeviation | ( | OCI_Enqueue * | enqueue, |
unsigned int | sequence | ||
) |
Set the enqueing sequence of messages to put in the queue.
enqueue | - Enqueue handle |
sequence | - enqueuing sequence |
OCI_EXPORT unsigned int OCI_API OCI_EnqueueGetSequenceDeviation | ( | OCI_Enqueue * | enqueue | ) |
Return the sequence deviation of messages to enqueue to the queue.
enqueue | - Enqueue handle |
OCI_EXPORT boolean OCI_API OCI_EnqueueSetVisibility | ( | OCI_Enqueue * | enqueue, |
unsigned int | visibility | ||
) |
Set whether the new message is enqueued as part of the current transaction.
enqueue | - Enqueue handle |
visibility | - Equeueing mode |
OCI_EXPORT unsigned int OCI_API OCI_EnqueueGetVisibility | ( | OCI_Enqueue * | enqueue | ) |
Get the enqueueing/locking behavior.
enqueue | - Enqueue handle |
OCI_EXPORT boolean OCI_API OCI_EnqueueSetRelativeMsgID | ( | OCI_Enqueue * | enqueue, |
const void * | id, | ||
unsigned int | len | ||
) |
Set a message identifier to use for enqueuing messages using a sequence deviation.
enqueue | - Enqueue handle |
id | - message identifier |
len | - pointer to message identifier length |
OCI_EXPORT boolean OCI_API OCI_EnqueueGetRelativeMsgID | ( | OCI_Enqueue * | enqueue, |
void * | id, | ||
unsigned int * | len | ||
) |
Get the current associated message identifier used for enqueuing messages using a sequence deviation.
enqueue | - Enqueue handle |
id | - buffer to receive the message identifier |
len | - pointer to buffer max length |
OCI_EXPORT OCI_Dequeue* OCI_API OCI_DequeueCreate | ( | OCI_TypeInfo * | typinf, |
const mtext * | name | ||
) |
Create a Dequeue object for the given queue.
typinf | - Type info handle |
name | - Queue name |
Definition at line 46 of file dequeue.c.
References OCI_DequeueFree(), and OCI_MsgCreate().
OCI_EXPORT boolean OCI_API OCI_DequeueFree | ( | OCI_Dequeue * | dequeue | ) |
Free a Dequeue object.
dequeue | - Dequeue handle |
Definition at line 105 of file dequeue.c.
References OCI_AgentFree(), OCI_DequeueUnsubscribe(), and OCI_MsgFree().
Referenced by OCI_DequeueCreate().
OCI_EXPORT OCI_Msg* OCI_API OCI_DequeueGet | ( | OCI_Dequeue * | dequeue | ) |
Dequeue messages from the given queue.
dequeue | - Dequeue handle |
Definition at line 214 of file dequeue.c.
References OCI_MsgReset().
OCI_EXPORT boolean OCI_API OCI_DequeueSubscribe | ( | OCI_Dequeue * | dequeue, |
unsigned int | port, | ||
unsigned int | timeout, | ||
POCI_NOTIFY_AQ | callback | ||
) |
Subscribe for asynchronous messages notifications.
dequeue | - Dequeue handle |
port | - Port to use for notifications |
timeout | - notification timeout |
callback | - User handler callback fired when messages are ready to be dequeued |
Definition at line 801 of file dequeue.c.
References OCI_DequeueUnsubscribe().
OCI_EXPORT boolean OCI_API OCI_DequeueUnsubscribe | ( | OCI_Dequeue * | dequeue | ) |
Unsubscribe for asynchronous messages notifications.
dequeue | - Dequeue handle |
Definition at line 1008 of file dequeue.c.
Referenced by OCI_DequeueFree(), and OCI_DequeueSubscribe().
OCI_EXPORT boolean OCI_API OCI_DequeueSetConsumer | ( | OCI_Dequeue * | dequeue, |
const mtext * | consumer | ||
) |
Set the current consumer name to retrieve message for.
dequeue | - Dequeue handle |
consumer | - consumer name |
OCI_EXPORT const mtext* OCI_API OCI_DequeueGetConsumer | ( | OCI_Dequeue * | dequeue | ) |
Get the current consumer name associated with the dequeueing process.
dequeue | - Dequeue handle |
OCI_EXPORT boolean OCI_API OCI_DequeueSetCorrelation | ( | OCI_Dequeue * | dequeue, |
const mtext * | pattern | ||
) |
set the correlation identifier of the message to be dequeued
dequeue | - Dequeue handle |
pattern | - correlation identifier |
OCI_EXPORT const mtext* OCI_API OCI_DequeueGetCorrelation | ( | OCI_Dequeue * | dequeue | ) |
Get the correlation identifier of the message to be dequeued.
dequeue | - Dequeue handle |
OCI_EXPORT boolean OCI_API OCI_DequeueSetRelativeMsgID | ( | OCI_Dequeue * | dequeue, |
const void * | id, | ||
unsigned int | len | ||
) |
Set the message identifier of the message to be dequeued.
dequeue | - Dequeue handle |
id | - message identitier |
len | - size of the message identitier |
OCI_EXPORT boolean OCI_API OCI_DequeueGetRelativeMsgID | ( | OCI_Dequeue * | dequeue, |
void * | id, | ||
unsigned int * | len | ||
) |
Get the message identifier of the message to be dequeued.
dequeue | - Dequeue handle |
id | - message identitier |
len | - size of the message identitier |
OCI_EXPORT boolean OCI_API OCI_DequeueSetVisibility | ( | OCI_Dequeue * | dequeue, |
unsigned int | visibility | ||
) |
Set whether the new message is dequeued as part of the current transaction.
dequeue | - Dequeue handle |
visibility | - dequeueing mode |
OCI_EXPORT unsigned int OCI_API OCI_DequeueGetVisibility | ( | OCI_Dequeue * | dequeue | ) |
Get the dequeueing/locking behavior.
dequeue | - Dequeue handle |
OCI_EXPORT boolean OCI_API OCI_DequeueSetMode | ( | OCI_Dequeue * | dequeue, |
unsigned int | mode | ||
) |
Set the dequeueing/locking behavior.
dequeue | - Dequeue handle |
mode | - dequeueing mode |
OCI_EXPORT unsigned int OCI_API OCI_DequeueGetMode | ( | OCI_Dequeue * | dequeue | ) |
Get the dequeueing/locking behavior.
dequeue | - Dequeue handle |
OCI_EXPORT boolean OCI_API OCI_DequeueSetNavigation | ( | OCI_Dequeue * | dequeue, |
unsigned int | position | ||
) |
Set the position of messages to be retrieved.
dequeue | - Dequeue handle |
position | - navigation position |
OCI_EXPORT unsigned int OCI_API OCI_DequeueGetNavigation | ( | OCI_Dequeue * | dequeue | ) |
Return the navigation position of messages to retrieve from the queue.
dequeue | - Dequeue handle |
OCI_EXPORT boolean OCI_API OCI_DequeueSetWaitTime | ( | OCI_Dequeue * | dequeue, |
int | timeout | ||
) |
set the time that OCIDequeueGet() waits for messages if no messages are currently available
dequeue | - Dequeue handle |
timeout | - timeout in seconds |
OCI_EXPORT int OCI_API OCI_DequeueGetWaitTime | ( | OCI_Dequeue * | dequeue | ) |
Return the time that OCIDequeueGet() waits for messages if no messages are currently available.
dequeue | - Dequeue handle |
OCI_EXPORT boolean OCI_API OCI_DequeueSetAgentList | ( | OCI_Dequeue * | dequeue, |
OCI_Agent ** | consumers, | ||
unsigned int | count | ||
) |
OCI_EXPORT OCI_Agent* OCI_API OCI_DequeueListen | ( | OCI_Dequeue * | dequeue, |
int | timeout | ||
) |
Listen for messages that match any recipient of the associated Agent list.
dequeue | - Dequeue handle |
timeout | - Timeout in second |
OCI_EXPORT OCI_Agent* OCI_API OCI_AgentCreate | ( | OCI_Connection * | con, |
const mtext * | name, | ||
const mtext * | address | ||
) |
Create an AQ agent object.
con | - Connection handle |
name | - Agent name |
address | - Agent address |
OCI_EXPORT boolean OCI_API OCI_AgentFree | ( | OCI_Agent * | agent | ) |
Free an AQ agent object.
agent | - AQ agent handle |
Definition at line 155 of file agent.c.
Referenced by OCI_DequeueFree(), and OCI_MsgFree().
OCI_EXPORT boolean OCI_API OCI_AgentSetName | ( | OCI_Agent * | agent, |
const mtext * | name | ||
) |
Set the given AQ agent name.
agent | - AQ agent handle |
name | - AQ agent name |
OCI_EXPORT const mtext* OCI_API OCI_AgentGetName | ( | OCI_Agent * | agent | ) |
OCI_EXPORT boolean OCI_API OCI_AgentSetAddress | ( | OCI_Agent * | agent, |
const mtext * | address | ||
) |
Set the given AQ agent address.
agent | - AQ agent handle |
address | - AQ agent address |
OCI_EXPORT const mtext* OCI_API OCI_AgentGetAddress | ( | OCI_Agent * | agent | ) |
Get the given AQ agent address.
agent | - AQ agent handle |
OCI_EXPORT boolean OCI_API OCI_QueueCreate | ( | OCI_Connection * | con, |
const mtext * | queue_name, | ||
const mtext * | queue_table, | ||
unsigned int | queue_type, | ||
unsigned int | max_retries, | ||
unsigned int | retry_delay, | ||
unsigned int | retention_time, | ||
boolean | dependency_tracking, | ||
const mtext * | comment | ||
) |
Create a queue.
con | - Connection handle |
queue_name | - Queue name |
queue_table | - Queue table name |
queue_type | - Queue type |
max_retries | - Maximum number of attempts to dequeue a message |
retry_delay | - Number of seconds between attempts to dequeue a message |
retention_time | - number of seconds a message is retained in the queue table after being dequeued from the queue |
dependency_tracking | - Parameter reserved for future use by Oracle (MUST be set to FALSE) |
comment | - Description of the queue |
To set default values, pass :
Definition at line 46 of file queue.c.
References OCI_BindInt(), OCI_BindString(), OCI_BindUnsignedInt(), OCI_Execute(), OCI_Prepare(), OCI_StatementCreate(), and OCI_StatementFree().
OCI_EXPORT boolean OCI_API OCI_QueueAlter | ( | OCI_Connection * | con, |
const mtext * | queue_name, | ||
unsigned int | max_retries, | ||
unsigned int | retry_delay, | ||
unsigned int | retention_time, | ||
const mtext * | comment | ||
) |
Alter the given queue.
con | - Connection handle |
queue_name | - Queue name |
max_retries | - Maximum number of attempts to dequeue a message |
retry_delay | - Number of seconds between attempts to dequeue a message |
retention_time | - number of seconds a message is retained in the queue table after being dequeued from the queue |
comment | - Description of the queue |
Definition at line 140 of file queue.c.
References OCI_BindString(), OCI_BindUnsignedInt(), OCI_Execute(), OCI_Prepare(), OCI_StatementCreate(), and OCI_StatementFree().
OCI_EXPORT boolean OCI_API OCI_QueueDrop | ( | OCI_Connection * | con, |
const mtext * | queue_name | ||
) |
Drop the given queue.
con | - Connection handle |
queue_name | - Queue name |
Definition at line 215 of file queue.c.
References OCI_BindString(), OCI_Execute(), OCI_Prepare(), OCI_StatementCreate(), and OCI_StatementFree().
OCI_EXPORT boolean OCI_API OCI_QueueStart | ( | OCI_Connection * | con, |
const mtext * | queue_name, | ||
boolean | enqueue, | ||
boolean | dequeue | ||
) |
Start the given queue.
con | - Connection handle |
queue_name | - Queue name |
enqueue | - Enable enqueue |
dequeue | - Enable dequeue |
Definition at line 264 of file queue.c.
References OCI_BindInt(), OCI_BindString(), OCI_Execute(), OCI_Prepare(), OCI_StatementCreate(), and OCI_StatementFree().
OCI_EXPORT boolean OCI_API OCI_QueueStop | ( | OCI_Connection * | con, |
const mtext * | queue_name, | ||
boolean | enqueue, | ||
boolean | dequeue, | ||
boolean | wait | ||
) |
Stop enqueuing or dequeuing or both on the given queue.
con | - Connection handle |
queue_name | - Queue name |
enqueue | - Disable enqueue |
dequeue | - Disable dequeue |
wait | - Wait for current pending enqueuues/dequeues |
Definition at line 328 of file queue.c.
References OCI_BindInt(), OCI_BindString(), OCI_Execute(), OCI_Prepare(), OCI_StatementCreate(), and OCI_StatementFree().
OCI_EXPORT boolean OCI_API OCI_QueueTableCreate | ( | OCI_Connection * | con, |
const mtext * | queue_table, | ||
const mtext * | queue_payload_type, | ||
const mtext * | storage_clause, | ||
const mtext * | sort_list, | ||
boolean | multiple_consumers, | ||
unsigned int | message_grouping, | ||
const mtext * | comment, | ||
unsigned int | primary_instance, | ||
unsigned int | secondary_instance, | ||
const mtext * | compatible | ||
) |
Create a queue table for messages of the given type.
con | - Connection handle |
queue_table | - Queue table name |
queue_payload_type | - Message type name |
storage_clause | - Additionnal clauses for the table storage |
sort_list | - Additional columns name to use for sorting |
multiple_consumers | - Enable multiple consumers for each messages |
message_grouping | - Specifies if messages are grouped within a transaction |
comment | - Description of the queue table |
primary_instance | - primary owner (instance) of the queue table |
secondary_instance | - Owner of the queue table if the primary instance is not available |
compatible | - lowest database version with which the queue table is compatible |
To set default values, pass :
Definition at line 399 of file queue.c.
References OCI_BindInt(), OCI_BindString(), OCI_BindUnsignedInt(), OCI_Execute(), OCI_Prepare(), OCI_StatementCreate(), and OCI_StatementFree().
OCI_EXPORT boolean OCI_API OCI_QueueTableAlter | ( | OCI_Connection * | con, |
const mtext * | queue_table, | ||
const mtext * | comment, | ||
unsigned int | primary_instance, | ||
unsigned int | secondary_instance | ||
) |
Alter the given queue table.
con | - Connection handle |
queue_table | - Queue table name |
comment | - Description of the queue table |
primary_instance | - primary owner (instance) of the queue table |
secondary_instance | - Owner of the queue table if the primary instance is not available |
Definition at line 538 of file queue.c.
References OCI_BindString(), OCI_BindUnsignedInt(), OCI_Execute(), OCI_Prepare(), OCI_StatementCreate(), and OCI_StatementFree().
OCI_EXPORT boolean OCI_API OCI_QueueTableDrop | ( | OCI_Connection * | con, |
const mtext * | queue_table, | ||
boolean | force | ||
) |
Drop the given queue table.
con | - Connection handle |
queue_table | - Queue table name |
force | - Force the deletion of objects related to the queue table |
Definition at line 610 of file queue.c.
References OCI_BindInt(), OCI_BindString(), OCI_Execute(), OCI_Prepare(), OCI_StatementCreate(), and OCI_StatementFree().
OCI_EXPORT boolean OCI_API OCI_QueueTablePurge | ( | OCI_Connection * | con, |
const mtext * | queue_table, | ||
const mtext * | purge_condition, | ||
boolean | block, | ||
unsigned int | delivery_mode | ||
) |
Purge messages from the given queue table.
con | - Connection handle |
queue_table | - Queue table name |
purge_condition | - Optionnal SQL based conditions (see notes) |
block | - Lock all queues using the queue table while doing the purge |
delivery_mode | - Type of message to purge |
Definition at line 667 of file queue.c.
References OCI_BindInt(), OCI_BindString(), OCI_BindUnsignedInt(), OCI_Execute(), OCI_Prepare(), OCI_StatementCreate(), and OCI_StatementFree().
OCI_EXPORT boolean OCI_API OCI_QueueTableMigrate | ( | OCI_Connection * | con, |
const mtext * | queue_table, | ||
const mtext * | compatible | ||
) |
Migrate a queue table from one version to another.
con | - Connection handle |
queue_table | - Queue table name |
compatible | - Database version with witch the queue table has to migrate |
Definition at line 754 of file queue.c.
References OCI_BindString(), OCI_Execute(), OCI_Prepare(), OCI_StatementCreate(), and OCI_StatementFree().