Oracle9i Application Developer's Guide - Advanced Queuing Release 1 (9.0.1) Part Number A88890-02 |
|
JMS Operational Interface: Basic Operations (Publish-Subscribe), 37 of 37
Browse messages using a topic browser.
Use methods in java.util.Enumeration
to go through the list of messages. Use the method purgeSeen
in TopicBrowser to purge messages that have been seen during the current browse.
/* Create a browser for topics with a specified selector */ public void browse_rush_orders(TopicSession jms_session) { TopicBrowser browser; Topic topic; ObjectMessage obj_message BolOrder new_order; Enumeration messages; /* get a handle to the new_orders topic */ topic = ((AQjmsSession) jms_session).getTopic("OE", "OE_bookedorders_ topic"); /* create a Browser to look at RUSH orders */ browser = ((AQjmsSession) jms_session).createBrowser(topic, "SUBS1", "JMSCorrelationID = 'RUSH'"); /* Browse through the messages */ for (messages = browser.elements() ; message.hasMoreElements() ;) { obj_message = (ObjectMessage)message.nextElement(); } /* Purge messages seen during this browse */ browser.purgeSeen(); }
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|