09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Enqueuing and Dequeuing Of Messages<br />

EXEC SQL EXECUTE<br />

DECLARE<br />

message_properties dbms_aq.message_properties_t;<br />

dequeue_options dbms_aq.dequeue_options_t;<br />

msgid RAW(16);<br />

BEGIN<br />

/* Dequeue by msgid in host variable ’msgid’: */<br />

dequeue_options.msgid := :msgid;<br />

/* Return the payload into host variable ’message’: */<br />

dbms_aq.dequeue(queue_name => ’msg_queue’,<br />

message_properties => message_properties,<br />

dequeue_options => dequeue_options,<br />

payload => :message,<br />

msgid => msgid);<br />

END;<br />

END-EXEC;<br />

/* Commit work: */<br />

EXEC SQL COMMIT;<br />

}<br />

Enqueuing and Dequeuing of Messages by Correlation and Message ID Using OCI<br />

#include <br />

#include <br />

#include <br />

#include <br />

struct message<br />

{<br />

OCIString *subject;<br />

OCIString *data;<br />

};<br />

typedef struct message message;<br />

struct null_message<br />

{<br />

OCIInd null_adt;<br />

OCIInd null_subject;<br />

OCIInd null_data;<br />

};<br />

typedef struct null_message null_message;<br />

A-42 <strong>Oracle</strong>9i Application Developer’s Guide - <strong>Advanced</strong> <strong>Queuing</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!