09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Registering for Notification [Specifying Subscription Name—Multiconsumer Queue]<br />

Syntax<br />

See Chapter 3, "AQ Programmatic Environments" for a list of available functions in<br />

each programmatic environment. Use the following syntax references for each<br />

programmatic environment:<br />

PL/SQL (DBMS_AQ Package): Not available.<br />

C (OCI): <strong>Oracle</strong> Call Interface Programmer’s Guide LNOCI Programming<br />

<br />

<strong>Advanced</strong> Topics, Publish-Subscribe Notification<br />

Visual Basic (OO4O) (<strong>Oracle</strong> Objects for OLE (OO4O) Online Help): From Help<br />

<br />

Topics, Contents tab, select OO4O Automation Server > OBJECTS > OraAQ<br />

Object > Monitoring Messages<br />

Java (JDBC): Not available.<br />

Examples<br />

See Chapter 3, "AQ Programmatic Environments" for a list of available functions in<br />

each programmatic environment.<br />

C (OCI): Register for Notifications For Single-Consumer and Multiconsumer<br />

Queries<br />

/* OCIRegister can be used by the client to register to receive notifications<br />

when messages are enqueued into non-persistent and normal queues. */<br />

#include <br />

#include <br />

#include <br />

#include <br />

static OCIEnv *envhp;<br />

static OCIServer *srvhp;<br />

static OCIError *errhp;<br />

static OCISvcCtx *svchp;<br />

/* The callback that gets invoked on notification */<br />

ub4 notifyCB(ctx, subscrhp, pay, payl, desc, mode)<br />

dvoid *ctx;<br />

LNOCISubscription *subscrhp; /* subscription handle */<br />

dvoid *pay; /* payload */<br />

ub4 payl; /* payload length */<br />

dvoid *desc; /* the AQ notification descriptor */<br />

ub4 mode;<br />

11-60 <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!