Oracle8i Application Developer's Guide - Advanced Queuing Release 2 (8.1.6) Part Number A76938-01 |
|
AQ Programmatic Environments, 10 of 10
Table 3-3 lists equivalent AQ operational functions for the programmatic environments, PL/SQL, Java (native AQ), OCI, Visual Basic (OO4O), and Java (JMS):
Use Cases | PL/SQL | Java (native AQ) | OCI | Visual Basic | JMS |
Create Connection, Session, Message |
|
|
|||
Create a Connection |
N/A |
Create JDBC connection |
OCIServerAttach |
OpenDatabase |
AQjmsQueueConnectionFactory.createQueueConnection AQjmsTopicConnectionFactory.createTopicConnecion |
Create a Session |
N/A |
AQDriverManager.createAQSession |
OCISessionBegin |
|
QueueConnection.createQueueSession TopicConnecion.createTopicSession |
Create a RAW Message |
Use SQL RAW type for message |
Set AQRawPayload in message |
Use OCIRaw for Message |
ORATYPE_RAW |
Not supported |
Create a Message with Structured Data |
Use SQL ADT type for message |
Set AQObjectPayload in message |
Use SQL ADT type for message |
ORATYPE_OBJECT and typename as SQL ADT type of the payload
|
AQjmsSession.createAdtMessage |
Create a Message Producer |
N/A |
N/A |
N/A |
N/A |
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 |
OraAP.Enqueue |
QueueSender.send |
Enqueue a Message to a queue - specify visibility options |
Specify visibility in ENQUEUE_OPTIONS |
Specify visibility in AQEnqueueOption |
Specify OCI_ATTR_VISIBILITY in OCIAQEnqOptions |
Specify visibility property in OraAQ |
Not supported |
Enqueue a Message to a single-consumer queue - specify message properties - priority, expiration |
Specify priority, expiration in MESSAGE_PROPERTIES |
Specify priority, expiration in AQMessageProperty |
OCI_ATTR_PRIORITY, OCI_ATTR_EXPIRATION in OCIAQMsgProperties |
Specify Priority and Expiration properties in OraAQMsg |
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 |
Specify correlation, delay, exception_queue in MESSAGE_PROPERTIES |
Specify correlation, delay, exception queue in AQMessageProperty |
Specify OCI_ATTR_CORRELATION, OCI_ATTR_DELAY, OCI_ATTR_EXCEPTION_QUEUE in OCIAQMsgProperties |
Specify Correlation, Delay, ExceptionQueue properties in OraAQMsg |
Delay and exception queue specified as provider specific message properties followed by QueueSender.send |
Enqueue a Message to a single-consumer Queue - specify Message Properties (user-defined) |
Properties should be part of payload |
Properties should be part of payload |
Properties should be part of payload |
Properties should be part of payload |
Message.setBooleanProperty etc. 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) |
Set recipient_list to NULL in MESSAGE_PROPERTIES |
Set recipient_list to NULL in AQMessageProperty |
Set OCI_ATTR_RECIPIENT_LIST to NULL in OCIAQMsgProperties |
OraAQ.Enqueue |
TopicPublisher.publish |
Publish a Message to a Multi-consumer queue/Topic (using specific recipient list) See footnote-1 |
Specify recipient list in MESSAGE_PROPERTIES |
Specify recipient_list in AQMessageProperty |
Specify OCI_ATTR_RECIPIENT_LIST in OCIAQMsgProperties |
OraAQ.Enqueue |
Specify recipients as an array of AQjmsAgent |
Publish a Message to a multi-consumer Queue/Topic - specify message properties - priority, expiration |
Specify priority, expiration in MESSAGE_PROPERTIES |
Specify priority, expiration in AQMessageProperty |
Specify OCI_ATTR_PRIORITY, OCI_ATTR_EXPIRATION in OCIAQMsgProperties |
Specify Priority and Expiration properties in OraAQMsg |
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 |
Specify correlation, delay, exception_queue in MESSAGE_PROPERTIES |
Specify correlation, delay, exception queue in AQMessageProperty
|
Specify OCI_ATTR_CORRELATION, OCI_ATTR_DELAY, OCI_ATTR_EXCEPTION_QUEUE in OCIAQMsgProperties |
Specify Correlation, Delay, ExceptionQueue properties in OraAQMsg |
Delay and exception queue specified as provider specific message properties followed by TopicPublisher.publish |
Publish a Message to a topic- specify Message Properties (user-defined) |
Properties should be part of payload |
Properties should be part of payload |
Properties should be part of payload |
Properties should be part of payload |
Message.setBooleanProperty etc. 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 |
|
Browse Messages In a Queue |
|
|
|
||
Browse messages in a Queue/Topic |
Set dequeue_mode to BROWSE in DEQUEUE_OPTIONS |
Set dequeue_mode to BROWSE in AQDequeueOption |
Set OCI_ATTR_DEQ_MODE to BROWSE in OCIAQDeqOptions |
Set Dequeue Mode to ORAAQ_DQ_BROWSE in OraAQ |
Not supported on Topics |
Browse messages in a Queue/Topic - locking messages while browsing |
Set dequeue_mode to LOCKED in DEQUEUE_OPTIONS |
Set dequeue_mode to LOCKED in AQDequeueOption |
Set OCI_ATTR_DEQ_MODE to LOCKED in OCIAQDeqOptions |
Specify DequeueMode as ORAAQ_DQ_LOCKED in OraAQ |
AQjmsSession.createBrowser - set locked to TRUE.
|
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 |
Specify visibility in DEQUEUE_OPTIONS |
Specify visibility in AQDequeueOption |
Specify OCI_ATTR_VISIBILITY in OCIAQDeqOptions |
Specify Visible property in OraAQ |
Not supported |
Dequeue a message from a queue/topic - specify navigation mode |
Specify navigation in DEQUEUE_OPTIONS |
Specify navigation in AQDequeueOption |
Specify OCI_ATTR_NAVIGATION in OCIAQDeqOptions |
Specify Navigation in OraAQ |
AQjmsQueueReceiver.setNavigationMode AQjmsTopicSubscriber.setNavigationMode AQjmsTopicReceiver.setNavigationMode |
Dequeue a message from a single consumer queue |
Set dequeue_mode to REMOVE in DEQUEUE_OPTIONS |
Set dequeue_mode to REMOVE in AQDequeueOption |
Set OCI_ATTR_DEQ_MODE to REMOVE in OCIAQDeqOptions |
Specify DequeueMode as ORAAQ_DQ_REMOVE in OraAQ |
QueueReceiver.receiveNoWait or AQjmsQueueReceiver.receiveNoData |
Dequeue a message from a multi-consumer Queue/Topic (using subscription name)1 |
Set dequeue_mode to REMOVE and Set consumer_name to subscription name in DEQUEUE_OPTIONS |
Set dequeue_mode to REMOVE and Set consumer_name to subscription name in AQDequeueOption |
Set OCI_ATTR_DEQ_MODE to REMOVE and Set OCI_ATTR_CONSUMER_NAME to subscription name in OCIAQDeqOptions |
Specify DequeueMode as ORAAQ_DQ_REMOVE in OraAQ Set Consumer as subscription name in OraAQ |
Create a durable TopicSubscriber on the Topic using the subscription name, then TopicSubscriber.receiveNoWait or AQjmsTopicSubscriber.receiveNoData |
Dequeue a message from a multi-consumer Queue/Topic (using recipient name)2 |
Set dequeue_mode to REMOVE and Set consumer_name to recipient name in DEQUEUE_OPTIONS |
Set dequeue_mode to REMOVE and Set consumer_name to recipient name inAQDequeueOption |
Set OCI_ATTR_DEQ_MODE to REMOVE and Set OCI_ATTR_CONSUMER_NAME to recipient name in OCIAQDeqOptions |
Specify DequeueMode as ORAAQ_DQ_REMOVE in OraAQ Set Consumer as subscription name in OraAQ |
Create a TopicReceiver on the Topic using the recipient name, then AQjmsSession.createTopicReceiver AQjmsTopicReceiver.receiveNoWait or AQjmsTopicReceiver.receiveNoData
|
Register to Receive Messages Asynchronously From a Queue/Topic |
|||||
Receive messages Asynchronously from a single-consumer queue |
Not supported |
Not supported |
Specify queue_name as subscription name OCISubscriptionEnable |
OraAQ.MonitorStart |
Create a QueueReceiver on the queue, then QueueReceiver.setMessageListener |
Receive messages Asynchronously from a multi-consumer queue/Topic |
Not supported |
Not supported |
Specify queue:OCI_ATTR_CONSUMER_NAME as subscription name OCISubscriptionEnable |
Consumer as subscription name in OraAQ |
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 |
Use agent_name as NULL for all agents in agent_list |
Not supported |
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 |
Specify agent_name for all agents in agent_list |
Not supported |
Specify agent_name for all agents in agent_list |
Not supported |
Create multiple TopicSubscribers or TopicReceivers on a TopicSession, then TopicSession.setMessageListener |
1
Refer to Chapter 1, "What is Oracle Advanced Queuing?" for differences between subscriber and recipient. 2 Refer to Chapter 1, "What is Oracle Advanced Queuing?" for differences between subscriber and recipient. |
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|