Available functions for the AQ programmatic environments are listed by use case in the following tables:
Each use case is described in detail, including examples, in Chapters 9 through 16.
Use Case |
PL/SQL |
Java (native AQ) |
Java (JMS) |
Create a Connection Factory |
N/A |
N/A |
AQjmsFactory.getQueueConnectionFactory
AQjmsFactory.getTopicConnectionFactory |
Register a Connection Factory in a LDAP server |
N/A |
N/A |
AQjmsFactory.registerConnectionFactory |
Create a Queue Table |
DBMS_AQADM.create_queue_table |
Create AQQueueTableProperty, then
AQSession.createQueueTable |
AQjmsSession.createQueueTable |
Get a Queue Table |
Use <schema>.<queue_table_name> |
AQSession.getQueueTable |
AQjmsSession.getQueueTable |
Alter a Queue Table |
DBMS_AQADM.alter_queue_table |
AQQueueTable.alter |
AQQueueTable.alter |
Drop a Queue Table |
DBMS_AQADM.drop_queue_table |
AQQueueTable.drop |
AQQueueTable.drop |
Create a Queue |
DBMS_AQADM.create_queue |
AQSession.createQueue |
AQjmsSession.createQueue |
Get a Queue |
Use <schema>.<queue_name> |
AQSession.getQueue |
AQjmsSession.getQueue |
Create a Nonpersistent Queue |
DBMS_AQADM.create_np_queue |
Not supported |
Not supported |
Create a Multiconsumer Queue/Topic |
DBMS_AQADM.create_queue
in a queue table with multiple consumers enabled |
AQSession.createQueue
in a queue table with multiple consumers enabled |
AQjmsSession.createTopic
in a queue table with multiple consumers enabled |
Get a Multiconsumer Queue/Topic |
Use <schema>.<queue_name> |
AQSession.getQueue |
AQjmsSession.getTopic |
Alter a Queue/Topic |
DBMS_AQADM.alter_queue |
AQQueue.alterQueue |
AQjmsDestination.alter |
Start a Queue/Topic |
DBMS_AQADM.start_queue |
AQQueue.start
AQQueue.startEnqueue
AQQueue.startDequeue |
AQjmsDestination.start |
Stop a Queue/Topic |
DBMS_AQADM.stop_queue |
AQQueue.stop
AQQueue.stopEnqueue
AQQueue.stopDequeue |
AQjmsDestination.stop |
Drop a Queue/Topic |
DBMS_AQADM.drop_queue |
AQQueue.drop
AQQueueTable.dropQueue |
AQjmsDestination.drop |
Grant System Privileges |
DBMS_AQADM.grant_system_privilege |
Not supported |
AQjmsSession.grantSystemPrivilege |
Revoke System Privileges |
DBMS_AQADM.revoke_system_privilege |
Not supported |
AQjmsSession.revokeSystemPrivilege |
Grant a Queue/Topic Privilege |
DBMS_AQADM.grant_queue_privilege |
AQQueue.grantQueuePrivilege |
AQjmsDestination.grantQueuePrivilege
AQjmsDestination.grantTopicPrivilege |
Revoke a Queue/Topic Privilege |
DBMS_AQADM.revoke_queue_privilege |
AQQueue.revokeQueuePrivilege |
AQjmsDestination.revokeQueuePrivilege
AQjmsDestination.revokeTopicPrivilege |
Verify a Queue Type |
DBMS_AQADM.verify_queue_types |
Not supported |
Not supported |
Add a Subscriber |
DBMS_AQADM.add_subscriber |
AQQueue.addSubscriber |
See Table 3-3, "Comparing AQ Programmatic Environments: Operational Interfaces" |
Alter a Subscriber |
DBMS_AQADM.alter_subscriber |
AQQueue.alterSubscriber |
See Table 3-3, "Comparing AQ Programmatic Environments: Operational Interfaces" |
Remove a Subscriber |
DBMS_AQADM.remove_subscriber |
AQQueue.removeSubscriber |
See Table 3-3, "Comparing AQ Programmatic Environments: Operational Interfaces" |
Schedule Propagation |
DBMS_AQADM.schedule_propagation |
AQQueue.schedulePropagation |
AQjmsDestination.schedulePropagation |
Enable a Propagation Schedule |
DBMS_AQADM.enable_propagation_schedule |
AQQueue.enablePropagationSchedule |
AQjmsDestination.enablePropagationSchedule |
Alter a Propagation Schedule |
DBMS_AQADM.alter_propagation_schedule |
AQQueue.alterPropagationSchedule |
AQjmsDestination.alterPropagationSchedule |
Disable a Propagation Schedule |
DBMS_AQADM.disable_propagation_schedule |
AQQueue.disablePropagationSchedule |
AQjmsDestination.disablePropagationSchedule |
Unschedule a Propagation |
DBMS_AQADM.unschedule_propagation |
AQQueue.unschedulePropagation |
AQjmsDestination.unschedulePropagation |
Create an AQ Internet Agent |
DBMS_AQADM.create_aq_agent |
not supported |
not supported |
Alter an AQ Internet Agent |
DBMS_AQADM.alter_aq_agent |
not supported |
not supported |
Drop an AQ Internet Agent |
DBMS_AQADM.drop_aq_agent |
not supported |
not supported |
Grant Database User privileges to an AQ Internet Agent |
DBMS_AQADM.enable_db_agent |
not supported |
not supported |
Revoke Database User privileges from an AQ Internet Agent |
DBMS_AQADM.disable_db_agent |
not supported |
not supported |
Add alias for queue, agent, ConnectionFactory in a LDAP server |
DBMS_AQADM.add_alias_to_ldap |
not supported |
not supported |
Delete alias for queue, agent, ConnectionFactory in a LDAP server |
DBMS_AQADM.del_alias_from_ldap |
not supported |
not supported |
Use Cases |
PL/SQL |
Java (native AQ) |
OCI |
AQ XML Servlet |
JMS |
Create Connection, Session, Message |
|
|
Create a Connection |
N/A |
Create JDBC connection |
OCIServerAttach |
Open an HTTP connection after authenticating with the Web server |
AQjmsQueueConnectionFactory.createQueueConnection
AQjmsTopicConnectionFactory.createTopicConnecion |
Create a Session |
N/A |
AQDriverManager.createAQSession |
OCISessionBegin |
An HTTP servlet session is automatically started with the first IDAP request |
QueueConnection.createQueueSession
TopicConnecion.createTopicSession |
Create a RAW Message |
Use SQL RAW type for message |
AQQueue.createMessage
Set AQRawPayload in message |
Use OCIRaw for Message |
Supply the hex representation of the message payload in the XML message. E.g.: <raw>023f4523</raw> |
Not supported |
Create a Message with Structured Data |
Use SQL ADT type for message |
AQQueue.createMessage
Set AQObjectPayload in message |
Use SQL ADT type for message |
For ADT 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 <message_payload> must be one of the following: <jms_text_message> , <jms_map_message> , <jms_bytes_message> , <jms_object_message> |
Session.createTextMessage
Session.createObjectMessage
Session.createMapMessage
Session.createBytesMessage
Session.createStreamMessage
AQjmsSession.createAdtMessage |
Create a Message Producer |
N/A |
N/A |
N/A |
N/A |
QueueSession.createSender
TopicSession.createPublisher |
Enqueue Messages to a Single Consumer Queue: Point-to-Point Model |
Enqueue a Message to a single-consumer queue |
DBMS_AQ.enqueue |
AQQueue.enqueue |
OCIAQEnq |
<AQXmlSend> |
QueueSender.send |
Enqueue a Message to a queue - specify visibility options |
DBMS_AQ.enqueue
Specify visibility in ENQUEUE_OPTIONS |
AQQueue.enqueue
Specify visibility in AQEnqueueOption |
OCIAQEnq
Specify OCI_ATTR_VISIBILITY in OCIAQEnqOptions |
<AQXmlSend> Specify <visibility> in <producer_options> |
Not supported |
Enqueue a Message to a single-consumer queue - specify message properties - priority, expiration |
DBMS_AQ.enqueue
Specify priority, expiration in MESSAGE_PROPERTIES |
AQQueue.enqueue
Specify priority, expiration in AQMessageProperty |
OCIAQEnq
Specify
OCI_ATTR_PRIORITY, OCI_ATTR_EXPIRATION in OCIAQMsgProperties |
<AQXmlSend> Specify <priority> , <expiration> in <message_header> |
Specify priority and TimeToLive during QueueSender.send OR MessageProducer.setTimeToLive & MessageProducer.setPriority
followed by QueueSender.send |
Enqueue a Message to a single-consumer Queue - specify message properties - correlationID, delay, exception queue |
DBMS_AQ.enqueue
Specify correlation, delay, exception_queue in MESSAGE_PROPERTIES |
AQQueue.enqueue
Specify correlation, delay, exception queue in AQMessageProperty |
OCIAQEnq
Specify OCI_ATTR_CORRELATION, OCI_ATTR_DELAY, OCI_ATTR_EXCEPTION_QUEUE in OCIAQMsgProperties |
<AQXmlSend> Specify <correlation_id> , <delay> , <exception_queue> in <message_header> |
Message.setJMSCorrelationID
Delay and exception queue specified as provider specific message properties
JMS_OracleDelay
JMS_OracleExcpQ
followed by QueueSender.send |
Enqueue a Message to a single-consumer Queue - specify Message Properties (user-defined) |
Not supported
Properties should be part of payload |
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>, etc. in <user_properties> |
Message.setIntProperty
Message.setStringProperty
Message.setBooleanProperty etc. followed by
QueueSender.send |
Enqueue a Message to a single-consumer Queue - specify Message Transformation |
DBMS_AQ.enqueue
Specify transformation in ENQUEUE_OPTIONS |
AQQueue.enqueue
Specify transformation in AQDequeueOption |
OCIAQEnq
Specify OCI_ATTR_TRANSFORMATION in OCIAQEnqOptions |
<AQXmlSend> Specify <transformation> in <producer_options> |
AQjmsQueueSender.setTransformation followed by
QueueSender.send |
Publish Messages to a Multi-Consumer Queue/Topic - Publish-Subscriber Model |
Publish a Message to a Multi-consumer queue/Topic (using default subscription list) |
DBMS_AQ.enqueue
Set recipient_list to NULL in MESSAGE_PROPERTIES |
AQQueue.enqueue
Set recipient_list to NULL in AQMessageProperty |
OCIAQEnq
Set OCI_ATTR_RECIPIENT_LIST to NULL in OCIAQMsgProperties |
<AQXmlPublish> |
TopicPublisher.publish |
Publish a Message to a Multi-consumer queue/Topic (using specific recipient list)
See footnote-1 |
DBMS_AQ.enqueue
Specify recipient list in MESSAGE_PROPERTIES |
AQQueue.enqueue
Specify recipient_list in AQMessageProperty |
OCIAQEnq
Specify OCI_ATTR_RECIPIENT_LIST in OCIAQMsgProperties |
<AQXmlPublish> Specify <recipient_list> in <message_header> |
AQjmsTopicPublisher.pubish
Specify recipients as an array of AQjmsAgent |
Publish a Message to a multi-consumer Queue/Topic - specify message properties - priority, expiration |
DBMS_AQ.enqueue
Specify priority, expiration in MESSAGE_PROPERTIES |
AQQueue.enqueue
Specify priority, expiration in AQMessageProperty |
OCIAQEnq
Specify OCI_ATTR_PRIORITY, OCI_ATTR_EXPIRATION in OCIAQMsgProperties |
<AQXmlPublish> Specify <priority> , <expiration> in the <message_header> |
Specify priority and TimeToLive during TopicPublisher.publish OR MessageProducer.setTimeToLive & MessageProducer.setPriority followed by
TopicPublisher.publish |
Publish a Message to a multi-consumer queue/topic - specify send options - correlationID, delay, exception queue |
DBMS_AQ.enqueue
Specify correlation, delay, exception_queue in MESSAGE_PROPERTIES |
AQQueue.enqueue
Specify correlation, delay, exception queue in AQMessageProperty
|
OCIAQEnq
Specify OCI_ATTR_CORRELATION, OCI_ATTR_DELAY, OCI_ATTR_EXCEPTION_QUEUE in OCIAQMsgProperties |
<AQXmlPublish> Specify <correlation_id> , <delay> , <exception_queue> in <message_header> |
Message.setJMSCorrelationID
Delay and exception queue specified as provider specific message properties
JMS_OracleDelay
JMS_OracleExcpQ
followed by TopicPublisher.publish |
Publish a Message to a topic- specify Message Properties (user-defined) |
Not supported
Properties should be part of payload |
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>, etc. in <user_properties> |
Message.setIntProperty
Message.setStringProperty
Message.setBooleanProperty etc. followed by
TopicPublisher.publish |
Publish a Message to a topic- specify Message Transformation |
DBMS_AQ.enqueue
Specify transformation in ENQUEUE_OPTIONS |
AQQueue.enqueue
Specify transformation in AQDequeueOption |
OCIAQEnq
Specify OCI_ATTR_TRANSFORMATION in OCIAQEnqOptions |
<AQXmlPublish> Specify <transformation> in <producer_options> |
AQjmsTopicPublisher.setTransformation
followed by
TopicPublisher.publish |
Subscribing for Messages in a Multi Consumer Queue/Topic - Publish Subscribe Model |
Add a Subscriber |
See administrative interfaces |
See administrative interfaces |
Not supported |
Not supported |
TopicSession.createDurableSubscriber
AQjmsSession.createDurableSubscriber |
Alter a Subscriber |
See administrative interfaces |
See administrative interfaces |
Not supported |
Not supported |
TopicSession.createDurableSubscriber
AQjmsSession.createDurableSubscriber
using the new selector |
Remove a Subscriber |
See administrative interfaces |
See administrative interfaces |
Not supported |
Not supported |
AQjmsSession.unsubscriber |
Browse Messages In a Queue |
|
|
|
Browse messages in a Queue/Topic |
DBMS_AQ.dequeue
Set dequeue_mode to BROWSE in DEQUEUE_OPTIONS |
AQQueue.dequeue
Set dequeue_mode to BROWSE in AQDequeueOption |
OCIAQDeq
Set OCI_ATTR_DEQ_MODE to BROWSE in OCIAQDeqOptions |
<AQXmlReceive> Specify <dequeue_mode> BROWSE in <consumer_options> |
QueueSession.createBrowser
QueueBrowser.getEnumeration
Not supported on Topics
oracle.jms.AQjmsSession.createBrowser
oracle.jms.TopicBrowser.getEnumeration |
Browse messages in a Queue/Topic - locking messages while browsing |
DBMS_AQ.dequeue
Set dequeue_mode to LOCKED in DEQUEUE_OPTIONS |
AQQueue.dequeue
Set dequeue_mode to LOCKED in AQDequeueOption |
OCIAQDeq
Set OCI_ATTR_DEQ_MODE to LOCKED in OCIAQDeqOptions |
<AQXmlReceive> Specify <dequeue_mode> LOCKED in <consumer_options> |
AQjmsSession.createBrowser - set locked to TRUE.
QueueBrowser.getEnumeration
Not supported on Topics
oracle.jms.AQjmsSession.createBrowser
oracle.jms.TopicBrowser.getEnumeration |
Receive Messages From a Queue/Topic |
|
|
|
Start a connection for receiving messages |
N/A |
N/A |
N/A |
N/A
|
Connection.start |
Create a Message Consumer |
N/A |
N/A |
N/A |
N/A |
QueueSession.createQueueReceiver
TopicSession.createDurableSubscriber
AQjmsSession.createTopicReceiver |
Dequeue a message from a queue/topic - specify visibility |
DBMS_AQ.dequeue
Specify visibility in DEQUEUE_OPTIONS |
AQQueue.dequeue
Specify visibility in AQDequeueOption |
OCIAQDeq
Specify OCI_ATTR_VISIBILITY in OCIAQDeqOptions |
<AQXmlReceive> Specify <visibility> in <consumer_options> |
Not supported |
Dequeue a message from a queue/topic - specify transformation |
DBMS_AQ.dequeue
Specify transformation in DEQUEUE_OPTIONS |
DBMS_AQ.dequeue
Specify transformation in AQDequeueOption |
OCIAQDeq
Specify OCI_ATTR_TRANSFORMATION in OCIAQDeqOptions |
<AQXmlReceive> Specify <transformation> in <consumer_options> |
AQjmsQueueReceiver.setTransformation
AQjmsTopicSubscriber.setTransformation
AQjmsTopicReceiver.setTransformation |
Dequeue a message from a queue/topic - specify navigation mode |
DBMS_AQ.dequeue
Specify navigation in DEQUEUE_OPTIONS |
DBMS_AQ.dequeue
Specify navigation in AQDequeueOption |
OCIAQDeq
Specify OCI_ATTR_NAVIGATION in OCIAQDeqOptions |
<AQXmlReceive> Specify <navigation> in <consumer_options> |
AQjmsQueueReceiver.setNavigationMode
AQjmsTopicSubscriber.setNavigationMode
AQjmsTopicReceiver.setNavigationMode |
Dequeue a message from a single consumer queue |
DBMS_AQ.dequeue
Set dequeue_mode to REMOVE in DEQUEUE_OPTIONS |
AQQueue.dequeue
Set dequeue_mode to REMOVE in AQDequeueOption |
OCIAQDeq
Set OCI_ATTR_DEQ_MODE to REMOVE in OCIAQDeqOptions |
<AQXmlReceive> |
QueueReceiver.receive or
QueueReceiver.receiveNoWait or
AQjmsQueueReceiver.receiveNoData |
Dequeue a message from a multi-consumer Queue/Topic (using subscription name) |
DBMS_AQ.dequeue
Set dequeue_mode to REMOVE and Set consumer_name to subscription name in DEQUEUE_OPTIONS |
AQQueue.dequeue
Set dequeue_mode to REMOVE and Set consumer_name to subscription name in AQDequeueOption |
OCIAQDeq
Set OCI_ATTR_DEQ_MODE to REMOVE and Set OCI_ATTR_CONSUMER_NAME to subscription name in OCIAQDeqOptions |
<AQXmlReceive> Specify <consumer_name> in <consumer_options> |
Create a durable TopicSubscriber on the Topic using the subscription name, then
TopicSubscriber.receive or
TopicSubscriber.receiveNoWait or
AQjmsTopicSubscriber.receiveNoData |
Dequeue a message from a multi-consumer Queue/Topic (using recipient name) |
DBMS_AQ.dequeue
Set dequeue_mode to REMOVE and Set consumer_name to recipient name in DEQUEUE_OPTIONS |
AQQueue.dequeue
Set dequeue_mode to REMOVE and Set consumer_name to recipient name inAQDequeueOption |
OCIAQDeq
Set OCI_ATTR_DEQ_MODE to REMOVE and Set OCI_ATTR_CONSUMER_NAME to recipient name in OCIAQDeqOptions |
<AQXmlReceive> Specify <consumer_name> in <consumer_options> |
Create a TopicReceiver on the Topic using the recipient name, then
AQjmsSession.createTopicReceiver
AQjmsTopicReceiver.receive or
AQjmsTopicReceiver.receiveNoWait or
AQjmsTopicReceiver.receiveNoData
|
Register to Receive Messages Asynchronously from a Queue/Topic |
Receive messages Asynchronously from a single-consumer queue |
Define a PL/SQL callback procedure
Register it using DBMS_AQ.register |
Not supported |
OCISubscriptionRegister
Specify queue_name as subscription name
OCISubscriptionEnable |
<AQXmlRegister> Specify queue name in <destination> and notification mechanism in <notify_url> |
Create a QueueReceiver on the queue, then
QueueReceiver.setMessageListener |
Receive messages Asynchronously from a multi-consumer queue/Topic |
Define a PL/SQL callback procedure
Register it using DBMS_AQ.register
|
Not supported |
OCISubscriptionRegister
Specify queue:OCI_ATTR_CONSUMER_NAME as subscription name
OCISubscriptionEnable |
<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
TopicSubscriber.setMessageListener
TopicReceiver.setMessageListener |
Listen for messages on multiple Queues/Topics |
|
|
|
|
|
Listen for messages on one (many) single-consumer queues |
DBMS_AQ.listen
Use agent_name as NULL for all agents in agent_list |
Not supported |
OCIAQListen
Use agent_name as NULL for all agents in agent_list |
Not supported |
Create multiple QueueReceivers on a QueueSession, then
QueueSession.setMessageListener |
Listen for messages on one(many) multi-consumer queues/Topics |
DBMS_AQ.listen
Specify agent_name for all agents in agent_list |
Not supported |
OCIAQListen
Specify agent_name for all agents in agent_list |
Not supported |
Create multiple TopicSubscribers or TopicReceivers on a TopicSession, then
TopicSession.setMessageListener |