Oracle® Streams Advanced Queuing User's Guide and Reference Release 10.1 Part Number B10785-01 |
|
|
View PDF |
This chapter describes the different language options and elements you must work with and issues to consider in preparing your Oracle Streams Advanced Queuing (AQ) application environment.
Note: Java packageoracle.AQ has been deprecated in release 10.1. Oracle recommends that you migrate existing Java AQ applications to Oracle JMS (or other Java APIs) and use Oracle JMS (or other Java APIs) to design your future Java AQ applications. |
This chapter contains these topics:
Using Oracle Java Message Service (OJMS) to Access Oracle Streams AQ
Using Oracle Streams AQ XML Servlet to Access Oracle Streams AQ
Table 4-1 lists Oracle Streams AQ programmatic environments, functions supported in each environment, and syntax references.
Table 4-1 Oracle Streams AQ Programmatic Environments
Language | Precompiler or Interface Program | Functions Supported | Syntax References |
---|---|---|---|
PL/SQL | DBMS_AQADM and DBMS_AQ Packages |
Administrative and operational | PL/SQL Packages and Types Reference |
C | Oracle Call Interface (OCI) | Operational only | Oracle Call Interface Programmer's Guide |
Visual Basic | Oracle Objects for OLE (OO4O) | Operational only | Online help available from Application Development submenu of Oracle installation. |
Java (JMS) | oracle.JMS package using JDBC API |
Administrative and operational | Oracle Streams Advanced Queuing Java API Reference |
AQ XML servlet | oracle.AQ.xml.AQxmlServlet using HTTP |
Operational only | Oracle XML API Reference |
The PL/SQL packages DBMS_AQADM
and DBMS_AQ
support access to Oracle Streams AQ administrative and operational functions using the native Oracle Streams AQ interface. These functions include:
Create queue, queue table, nonpersistent queue, multiconsumer queue/topic, RAW message, or message with structured data
Get queue table, queue, or multiconsumer queue/topic
Alter queue table or queue/topic
Drop queue/topic
Start or stop queue/topic
Grant and revoke privileges
Add, remove, or alter subscriber
Add, remove, or alter an Oracle Streams AQ Internet agent
Grant or revoke privileges of database users to Oracle Streams AQ Internet agents
Enable, disable, or alter propagation schedule
Enqueue messages to single consumer queue (point-to-point model)
Publish messages to multiconsumer queue/topic (publish/subscribe model)
Subscribe for messages in multiconsumer queue
Browse messages in a queue
Receive messages from queue/topic
Register to receive messages asynchronously
Listen for messages on multiple queues/topics
Post messages to anonymous subscriptions
Bind or unbind agents in a Lightweight Directory Access Protocol (LDAP) server
Add or remove aliases to Oracle Streams AQ objects in a LDAP server
See Also: PL/SQL Packages and Types Reference for detailed documentation ofDBMS_AQADM and DBMS_AQ , including syntax, parameters, parameter types, return values, and examples |
Available PL/SQL DBMS_AQADM
and DBMS_AQ
functions are listed in detail in Table 4-2 through Table 4-9.
OCI provides an interface to Oracle Streams AQ functions using the native Oracle Streams AQ interface.
An OCI client can perform the following actions:
Enqueue messages
Dequeue messages
Listen for messages on sets of queues
Register to receive message notifications
In addition, OCI clients can receive asynchronous notifications for new messages in a queue using OCISubscriptionRegister
.
See Also: "OCI and Advanced Queuing" and "Publish-Subscribe Notification" in Oracle Call Interface Programmer's Guide for syntax details |
For queues with user-defined payload types, the Oracle type translator must be used to generate the OCI/OCCI mapping for the Oracle type. The OCI client is responsible for freeing the memory of the Oracle Streams AQ descriptors and the message payload.
See Also:
|
C++ applications can use OCCI, which has a set of Oracle Streams AQ interfaces that enable messaging clients to access Oracle Streams AQ. OCCI AQ supports all the operational functions required to send/receive and publish/subscribe messages in a message-enabled database. Synchronous and asynchronous message consumption is available, based on a message selection rule.
Visual Basic (OO4O) supports access to Oracle Streams AQ operational functions using the native Oracle Streams AQ interface.
These functions include the following:
Create a connection, RAW message, or message with structured data
Enqueue messages to a single consumer queue (point-to-point model)
Publish messages to a multiconsumer queue/topic (publish/subscribe model)
Browse messages in a queue
Receive messages from a queue/topic
Register to receive messages asynchronously
Java Message Service (JMS) is a messaging standard defined by Sun Microsystems, Oracle, IBM, and other vendors. JMS is a set of interfaces and associated semantics that define how a JMS client accesses the facilities of an enterprise messaging product.
Oracle Java Message Service (OJMS) provides a Java API for Oracle Streams AQ based on the JMS standard. OJMS supports the standard JMS interfaces and has extensions to support administrative operations and other features that are not a part of the standard.
Standard JMS features include:
Point-to-point model of communication using queues
Publish/subscribe model of communication using topics
ObjectMessage, StreamMessage, TextMessage, BytesMessage, and MapMessage message types
Asynchronous and synchronous delivery of messages
Message selection based on message header fields or properties
Oracle JMS extensions include:
Administrative API to create queue tables, queues and topics
Point-to-multipoint communication using recipient lists for topics
Message propagation between destinations, which allows the application to define remote subscribers
Support for transactional sessions, enabling JMS and SQL operations in one transaction
Message retention after messages have been dequeued
Message delay, allowing messages to be made visible after a certain delay
Exception handling, allowing messages to be moved to exception queues if they cannot be processed successfully
Support for AdtMessages
These are stored in the database as Oracle objects, so the payload of the message can be queried after it is enqueued. Subscriptions can be defined on the contents of these messages as opposed to just the message properties.
Topic browsing
This allows durable subscribers to browse through the messages in a publish/subscribe (topic) destination. It optionally allows these subscribers to purge the browsed messages, so they are no longer retained by Oracle Streams AQ for that subscriber.
See Also:
|
Standard JMS interfaces are in the javax.jms
package. Oracle JMS interfaces are in the oracle.jms
package. You must have EXECUTE
privilege on the DBMS_AQIN
and DBMS_AQJMS
packages to use the Oracle JMS interfaces. You can also acquire these rights through the AQ_USER_ROLE
or the AQ_ADMINSTRATOR_ROLE
. You also need the appropriate system and queue or topic privileges to send or receive messages.
Because Oracle JMS uses Java Database Connectivity (JDBC) to connect to the database, its applications can run outside the database using the JDBC OCI driver or JDBC thin driver.
To use JMS with clients running outside the database, you must include the appropriate JDBC driver, Java Naming and Directory Interface (JNDI) jar files, and Oracle Streams AQ jar files in your CLASSPATH.
For JDK 1.3.x and higher, include the following in the CLASSPATH:
$ORACLE_HOME/jdbc/lib/classes12.jar $ORACLE_HOME/jdbc/lib/orail8n.jar $ORACLE_HOME/jdk/jre/lib/ext/jta.jar $ORACLE_HOME/jdk/jre/lib/ext/jta.jar $ORACLE_HOME/jlib/jndi.jar $ORACLE_HOME/lib/xmlparserv2.jar $ORACLE_HOME/rdbms/jlib/xdb.jar $ORACLE_HOME/rdbms/jlib/aqapi13.jar $ORACLE_HOME/rdbms/jlib/jmscommon.jar
For JDK 1.2 include the following in the CLASSPATH
:
$ORACLE_HOME/jdbc/lib/classes12.jar $ORACLE_HOME/jdbc/lib/orail8n.jar $ORACLE_HOME/jdk/jre/lib/ext/jta.jar $ORACLE_HOME/jlib/jndi.jar $ORACLE_HOME/lib/xmlparserv2.jar $ORACLE_HOME/rdbms/jlib/xdb.jar $ORACLE_HOME/rdbms/jlib/aqapi12.jar $ORACLE_HOME/rdbms/jlib/jmscommon.jar
If your application is running inside the JServer, then you should be able to access the Oracle JMS classes that have been automatically loaded when the JServer was installed. If these classes are not available, then you must load jmscommon.jar
followed by aqapi.jar
using the $ORACLE_HOME/rdbms/admin/initjms
SQL script.
You can use Oracle Streams AQ XML servlet to access Oracle Streams AQ over HTTP using Simple Object Access Protocol (SOAP) and an Oracle Streams AQ XML message format called Internet Data Access Presentation (IDAP).
Using the Oracle Streams AQ servlet, a client can perform the following actions:
Send messages to single-consumer queues
Publish messages to multiconsumer queues/topics
Receive messages from queues
Register to receive message notifications
The servlet can be created by defining a Java class that extends the oracle.AQ.xml.AQxmlServlet
or oracle.AQ.xml.AQxmlServlet20
class. These classes in turn extend the javax.servlet.http.HttpServlet
class.
The servlet can be deployed on any Web server or ServletRunner that implements the Javasoft Servlet 2.0 or Servlet 2.2 interfaces. With Javasoft Servlet 2.0, you must define a class that extends oracle.AQ.xml.AQxmlServlet20
. With Javasoft Servlet 2.2, you must define a class that extends oracle.AQ.xml.AQxmlServlet
.
The servlet can be compiled using JDK 1.2.x, JDK 1.3.x, or JDK 1.4.x libraries.
For JDK 1.4.x the CLASSPATH
must contain:
$ORACLE_HOME/jdbc/lib/classes12.jar $ORACLE_HOME/jdbc/lib/ojdbc14.jar $ORACLE_HOME/jdbc/lib/orai18n.jar $ORACLE_HOME/jlib/jndi.jar $ORACLE_HOME/jlib/jta.jar $ORACLE_HOME/lib/servlet.jar $ORACLE_HOME/lib/xmlparserv2.jar $ORACLE_HOME/lib/xschema.jar $ORACLE_HOME/lib/xsu12.jar $ORACLE_HOME/rdbms/jlib/aqapi.jar $ORACLE_HOME/rdbms/jlib/aqxml.jar $ORACLE_HOME/rdbms/jlib/jmscommon.jar
For JDK 1.3.x the CLASSPATH
must contain:
$ORACLE_HOME/jdbc/lib/classes12.jar $ORACLE_HOME/jdbc/lib/orai18n.jar $ORACLE_HOME/jlib/jndi.jar $ORACLE_HOME/jlib/jta.jar $ORACLE_HOME/lib/servlet.jar $ORACLE_HOME/lib/xmlparserv2.jar $ORACLE_HOME/lib/xschema.jar $ORACLE_HOME/lib/xsu12.jar $ORACLE_HOME/rdbms/jlib/aqapi.jar $ORACLE_HOME/rdbms/jlib/aqxml.jar $ORACLE_HOME/rdbms/jlib/jmscommon.jar
For JDK 1.2.x the CLASSPATH
must contain:
$ORACLE_HOME/jdbc/lib/classes12.jar $ORACLE_HOME/jdbc/lib/orai18n.jar $ORACLE_HOME/jlib/jndi.jar $ORACLE_HOME/jlib/jta.jar $ORACLE_HOME/lib/servlet.jar $ORACLE_HOME/lib/xmlparserv2.jar $ORACLE_HOME/lib/xschema.jar $ORACLE_HOME/lib/xsu12.jar $ORACLE_HOME/rdbms/jlib/aqapi.jar $ORACLE_HOME/rdbms/jlib/aqxml.jar $ORACLE_HOME/rdbms/jlib/jmscommon.jar
Because the servlet uses JDBC OCI drivers to connect to the Oracle Database server, the Oracle Database client libraries must be installed on the computer that hosts the servlet. The LD_LIBRARY_PATH
must contain $ORACLE_HOME/lib
.
See Also: Chapter 17, " Internet Access to Oracle Streams AQ" for more information on Internet access to Oracle Streams AQ |
Available functions for the Oracle Streams AQ programmatic environments are listed by use case in Table 4-2 through Table 4-9. Use cases are described in Chapter 8 through Chapter 10 and Chapter 12 through Chapter 15.
Table 4-2 lists the equivalent Oracle Streams AQ administrative functions for the PL/SQL and Java (JMS) programmatic environments.
Table 4-2 Comparison of Oracle Streams AQ Programmatic Environments: Administrative Interface
Use Case | PL/SQL | Java (JMS) |
---|---|---|
Create a connection factory | N/A | AQjmsFactory.getQueueConnectionFactory
|
Register a connection factory in an LDAP server | N/A | AQjmsFactory.registerConnectionFactory |
Create a queue table | DBMS_AQADM.CREATE_QUEUE_TABLE |
AQjmsSession.createQueueTable |
Get a queue table | Use schema .queue_table_name |
AQjmsSession.getQueueTable |
Alter a queue table | DBMS_AQADM.ALTER_QUEUE_TABLE |
AQQueueTable.alter |
Drop a queue table | DBMS_AQADM.DROP_QUEUE_TABLE |
AQQueueTable.drop |
Create a queue | DBMS_AQADM.CREATE_QUEUE |
AQjmsSession.createQueue |
Get a queue | Use schema.queue_name |
AQjmsSession.getQueue |
Create a nonpersistent queue | DBMS_AQADM.CREATE_NP_QUEUE |
Not supported |
Create a multiconsumer queue/topic in a queue table with multiple consumers enabled | DBMS_AQADM.CREATE_QUEUE |
AQjmsSession.createTopic |
Get a multiconsumer queue/topic | Use schema.queue_name |
AQjmsSession.getTopic |
Alter a queue/topic | DBMS_AQADM.ALTER_QUEUE |
AQjmsDestination.alter |
Start a queue/topic | DBMS_AQADM.START_QUEUE |
AQjmsDestination.start |
Stop a queue/topic | DBMS_AQADM.STOP_QUEUE |
AQjmsDestination.stop |
Drop a queue/topic | DBMS_AQADM.DROP_QUEUE |
AQjmsDestination.drop |
Grant system privileges | DBMS_AQADM.GRANT_SYSTEM_PRIVILEGE |
AQjmsSession.grantSystemPrivilege |
Revoke system privileges | DBMS_AQADM.REVOKE_SYSTEM_PRIVILEGE |
AQjmsSession.revokeSystemPrivilege |
Grant a queue/topic privilege | DBMS_AQADM.GRANT_QUEUE_PRIVILEGE |
AQjmsDestination.grantQueuePrivilege
|
Revoke a queue/topic privilege | DBMS_AQADM.REVOKE_QUEUE_PRIVILEGE |
AQjmsDestination.revokeQueuePrivilege
|
Verify a queue type | DBMS_AQADM.VERIFY_QUEUE_TYPES |
Not supported |
Add a subscriber | DBMS_AQADM.ADD_SUBSCRIBER |
See Table 4-6 |
Alter a subscriber | DBMS_AQADM.ALTER_SUBSCRIBER |
See Table 4-6 |
Remove a subscriber | DBMS_AQADM.REMOVE_SUBSCRIBER |
See Table 4-6 |
Schedule propagation | DBMS_AQADM.SCHEDULE_PROPAGATION |
AQjmsDestination.schedulePropagation |
Enable a propagation schedule | DBMS_AQADM.ENABLE_PROPAGATION_SCHEDULE |
AQjmsDestination.enablePropagationSchedule |
Alter a propagation schedule | DBMS_AQADM.ALTER_PROPAGATION_SCHEDULE |
AQjmsDestination.alterPropagationSchedule |
Disable a propagation schedule | DBMS_AQADM.DISABLE_PROPAGATION_SCHEDULE |
AQjmsDestination.disablePropagationSchedule |
Unschedule a propagation | DBMS_AQADM.UNSCHEDULE_PROPAGATION |
AQjmsDestination.unschedulePropagation |
Create an Oracle Streams AQ Internet Agent | DBMS_AQADM.CREATE_AQ_AGENT |
Not supported |
Alter an Oracle Streams AQ Internet Agent | DBMS_AQADM.ALTER_AQ_AGENT |
Not supported |
Drop an Oracle Streams AQ Internet Agent | DBMS_AQADM.DROP_AQ_AGENT |
Not supported |
Grant database user privileges to an Oracle Streams AQ Internet Agent | DBMS_AQADM.ENABLE_AQ_AGENT |
Not supported |
Revoke database user privileges from an Oracle Streams AQ Internet Agent | DBMS_AQADM.DISABLE_AQ_AGENT |
Not supported |
Add alias for queue, agent, ConnectionFactory in a LDAP server | DBMS_AQADM.ADD_ALIAS_TO_LDAP |
Not supported |
Delete alias for queue, agent, ConnectionFactory in a LDAP server | DBMS_AQADM.DEL_ALIAS_FROM_LDAP |
Not supported |
Table 4-3 through Table 4-9 list equivalent Oracle Streams AQ operational functions for the programmatic environments PL/SQL, OCI, Oracle Streams AQ XML Servlet, and JMS, for various use cases.
Table 4-3 Comparison of Oracle Streams AQ Programmatic Environments: Operational Interface—Create Connection, Session, Message Use Cases
Use Case | PL/SQL | OCI | AQ XML Servlet | JMS |
---|---|---|---|---|
Create a connection | N/A | OCIServerAttach |
Open an HTTP connection after authenticating with the Web server | AQjmsQueueConnectionFactory.createQueueConnection
|
Create a session | N/A | OCISessionBegin |
An HTTP servlet session is automatically started with the first SOAP request | QueueConnection.createQueueSession
|
Create a RAW message | Use SQL RAW type for message | Use OCIRaw for Message | Supply the hex representation of the message payload in the XML message. For example, <raw>023f4523</raw> |
Not supported |
Create a message with structured data | Use SQL Oracle object type for message | Use SQL Oracle object type for message | For Oracle object type queues that are not JMS queues (that is, they are not type AQ$_JMS_* ), the XML specified in <message payload> must map to the SQL type of the payload for the queue table.
For JMS queues, the XML specified in the |
Session.createTextMessage
|
Create a message producer | N/A | N/A | N/A | QueueSession.createSender
|
Table 4-4 Comparison of Oracle Streams AQ Programmatic Environments: Operational Interface—Enqueue Messages to a Single-Consumer Queue, Point-to-Point Model Use Cases
Use Case | PL/SQL | OCI | AQ XML Servlet | JMS |
---|---|---|---|---|
Enqueue a message to a single-consumer queue | DBMS_AQ.enqueue |
OCIAQEnq |
<AQXmlSend> |
QueueSender.send |
Enqueue a message to a queue and specify visibility options | DBMS_AQ.enqueue
Specify visibility in |
OCIAQEnq
Specify |
<AQXmlSend> Specify <visibility> in <producer_options> |
Not supported |
Enqueue a message to a single-consumer queue and specify message properties priority and expiration | DBMS_AQ.enqueue
Specify priority, expiration in |
OCIAQEnq
Specify
|
<AQXmlSend> Specify <priority> , <expiration> in <message_header> |
Specify priority and TimeToLive during QueueSender.send or .setTimeToLive and MessageProducer.setPriority followed by
|
Enqueue a message to a single-consumer queue and specify message properties correlationID, delay, and exception queue | DBMS_AQ.enqueue
Specify correlation, delay, exception_queue in |
OCIAQEnq
Specify |
<AQXmlSend> Specify <correlation_id> , <delay> , <exception_queue> in <message_header> |
Message.setJMSCorrelationID
Delay and exception queue specified as provider specific message properties
followed by
|
Enqueue a message to a single-consumer queue and specify user-defined message properties | Not supported
Properties should be part of payload |
Not supported
Properties should be part of payload |
<AQXmlSend> Specify <name> and <int_value> , <string_value> , <long_value>, and so on in <user_properties> |
Message.setIntProperty
and so forth, followed by
|
Enqueue a message to a single-consumer queue and specify message transformation | DBMS_AQ.enqueue
Specify transformation in |
OCIAQEnq
Specify |
<AQXmlSend> Specify <transformation> in <producer_options> |
AQjmsQueueSender.setTransformation
followed by
|
Table 4-5 Comparison of Oracle Streams AQ Programmatic Environments: Operational Interface—Publish Messages to a Multiconsumer Queue/Topic, Publish/Subscribe Model Use Cases
Use Case | PL/SQL | OCI | AQ XML Servlet | JMS |
---|---|---|---|---|
Publish a message to a multiconsumer queue/topic using default subscription list | DBMS_AQ.enqueue
Set |
OCIAQEnq
Set |
<AQXmlPublish> |
TopicPublisher.publish |
Publish a message to a multiconsumer queue/topic using specific recipient list
See footnote-1 |
DBMS_AQ.enqueue
Specify recipient list in |
OCIAQEnq
Specify |
<AQXmlPublish> Specify <recipient_list> in <message_header> |
AQjmsTopicPublisher.publish
Specify recipients as an array of |
Publish a message to a multiconsumer queue/topic and specify message properties priority and expiration | DBMS_AQ.enqueue
Specify priority, expiration in |
OCIAQEnq
Specify |
<AQXmlPublish> Specify <priority> , <expiration> in the <message_header> |
Specify priority and TimeToLive during TopicPublisher.publish or MessageProducer.setTimeToLive and MessageProducer.setPriority followed by TopicPublisher.publish |
Publish a message to a multiconsumer queue/topic and specify send options correlationID, delay, and exception queue | DBMS_AQ.enqueue
Specify correlation, delay, |
OCIAQEnq
Specify |
<AQXmlPublish> Specify <correlation_id> , <delay> , <exception_queue> in <message_header> |
Message.setJMSCorrelationID
Delay and exception queue specified as provider-specific message properties
followed by
|
Publish a message to a topic and specify user-defined message properties | Not supported
Properties should be part of payload |
Not supported
Properties should be part of payload |
<AQXmlPublish> Specify <name> and <int_value> , <string_value> , <long_value>, and so on in <user_properties> |
Message.setIntProperty
and so forth, followed by
|
Publish a message to a topic and specify message transformation | DBMS_AQ.enqueue
Specify transformation in |
OCIAQEnq
Specify |
<AQXmlPublish> Specify <transformation> in <producer_options> |
AQjmsTopicPublisher.setTransformation
followed by
|
Table 4-6 Comparison of Oracle Streams AQ Programmatic Environments: Operational Interface—Subscribing for Messages in a Multiconsumer Queue/Topic, Publish/Subscribe Model Use Cases
Use Case | PL/SQL | OCI | AQ XML Servlet | JMS |
---|---|---|---|---|
Add a subscriber | See administrative interfaces | Not supported | Not supported | TopicSession.createDurableSubscriber
|
Alter a subscriber | See administrative interfaces | Not supported | Not supported | TopicSession.createDurableSubscriber
|
Remove a subscriber | See administrative interfaces | Not supported | Not supported | AQjmsSession.unsubscribe |
Table 4-7 Comparison of Oracle Streams AQ Programmatic Environments: Operational Interface—Browse Messages in a Queue Use Cases
Use Case | PL/SQL | OCI | AQ XML Servlet | JMS |
---|---|---|---|---|
Browse messages in a queue/topic | DBMS_AQ.dequeue
Set |
OCIAQDeq
Set |
<AQXmlReceive> Specify <dequeue_mode> BROWSE in <consumer_options> |
QueueSession.createBrowser
Not supported on topics
|
Browse messages in a queue/topic and lock messages while browsing | DBMS_AQ.dequeue
Set |
OCIAQDeq
Set |
<AQXmlReceive> Specify <dequeue_mode> LOCKED in <consumer_options> |
AQjmsSession.createBrowser set locked to TRUE .
Not supported on topics
|
Table 4-8 Comparison of Oracle Streams AQ Programmatic Environments: Operational Interface—Receive Messages from a Queue/Topic Use Cases
Use Case | PL/SQL | OCI | AQ XML Servlet | JMS |
---|---|---|---|---|
Start a connection for receiving messages | N/A | N/A | N/A | Connection.start |
Create a message consumer |
N/A | N/A | N/A | QueueSession.createQueueReceiver
|
Dequeue a message from a queue/topic and specify visibility | DBMS_AQ.dequeue
Specify visibility in |
OCIAQDeq
Specify |
<AQXmlReceive> Specify <visibility> in <consumer_options> |
Not supported |
Dequeue a message from a queue/topic and specify transformation | DBMS_AQ.dequeue
Specify transformation in |
OCIAQDeq
Specify |
<AQXmlReceive> Specify <transformation> in <consumer_options> |
AQjmsQueueReceiver.setTransformation
|
Dequeue a message from a queue/topic and specify navigation mode | DBMS_AQ.dequeue
Specify navigation in |
OCIAQDeq
Specify |
<AQXmlReceive> Specify <navigation> in <consumer_options> |
AQjmsQueueReceiver.setNavigationMode
|
Dequeue a message from a single consumer queue | DBMS_AQ.dequeue
Set |
OCIAQDeq
Set |
<AQXmlReceive> |
QueueReceiver.receive or
|
Dequeue a message from a multiconsumer queue/topic using subscription name | DBMS_AQ.dequeue
Set |
OCIAQDeq
Set |
<AQXmlReceive> Specify <consumer_name> in <consumer_options> |
Create a durable TopicSubscriber on the topic using the subscription name, then
|
Dequeue a message from a multiconsumer queue/topic using recipient name | DBMS_AQ.dequeue
Set |
OCIAQDeq
Set |
<AQXmlReceive> Specify <consumer_name> in <consumer_options> |
Create a TopicReceiver on the topic using the recipient name, then
|
Table 4-9 Comparison of Oracle Streams AQ Programmatic Environments: Operational Interface—Register to Receive Messages Asynchronously from a Queue/Topic Use Cases
Use Case | PL/SQL | OCI | AQ XML Servlet | JMS |
---|---|---|---|---|
Receive messages asynchronously from a single-consumer queue | Define a PL/SQL callback procedure
Register it using |
OCISubscriptionRegister
Specify
|
<AQXmlRegister> Specify queue name in <destination> and notification mechanism in <notify_url> |
Create a QueueReceiver on the queue, then
|
Receive messages asynchronously from a multiconsumer queue/topic | Define a PL/SQL callback procedure
Register it using |
OCISubscriptionRegister
Specify
|
<AQXmlRegister> Specify queue name in <destination> , consumer in <consumer_name> and notification mechanism in <notify_url> |
Create a TopicSubscriber or TopicReceiver on the topic, then
|
Listen for messages on multiple queues/topics | - | - | - | - |
Listen for messages on one (many) single-consumer queues | DBMS_AQ.LISTEN
Use |
OCIAQListen
Use |
Not supported | Create multiple QueueReceivers on a QueueSession , then
|
Listen for messages on one (many) multiconsumer queues/Topics | DBMS_AQ.LISTEN
Specify |
OCIAQListen
Specify |
Not supported | Create multiple TopicSubscribers or TopicReceivers on a TopicSession , then
|