How to query your JMS over AQ Queues by Martien van den Akker
Blog: PaaS Community
At my current customer we use queues a lot. They’re JMS queues, but in stead of Weblogic JMS, they’re served by the Oracle database.
This is not new, in fact the Oracle database supports this since 8i through Advanced Queueing. Advanced Queueing is Oracle’s Queueing implementation based on tables and views. That means you can query the queue table to get to the content of the queue. But you might know this already.
What I find few people know is that you shouldn’t query the queue table directly but the accompanying AQ$ view instead. So, if your queue table is called MY_QUEUE_TAB, then you should query AQ$MY_QUEUE_TAB. So simply prefix the table name with AQ$. Why? The AQ$ view is created automatically for you and joins the queue table with accompanying IOT tables to give you a proper and convenient representation of the state, subscriptions and other info of the messages. It is actually the supported wat of query the queue tables.
A JMS queue in AQ is implemented by creating them in queue tables based on the Oracle type
That is in fact a quite complex type definition that implements common JMS Text Message based queues. There are a few other types to support other JMS message types. But let’s leave that.
Although the payload of the queue table is a complex type, you can get to its attributes in the query using the dot notation. But for that it is mandatory to have a table shortname and prefix the view columns with the table shortname. Read the complete article here.
For regular information on Oracle PaaS become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.