I would like to dequeue a non persistent (=buffered) JMS Message from an Oracle AQ queue.
In PL/SQL everything is fine and works, if I set
L_DequeueOptions.VISIBILITY := DBMS_AQ.IMMEDIATE;
L_DequeueOptions.DELIVERY_MODE := DBMS_AQ.BUFFERED;
on the dequeuer.
The enqueuer options are set accordingly to IMMEDIATE and BUFFERED.
Nevertheless in Java Code I try to receive the message using JMS with a javax.jms.QueueReceiver using
QueueReceiver receiver = session.createReceiver(queue, "JMSDeliveryMode = 'PERSISTENT' or JMSDeliveryMode = 'NON_PERSISTENT'");
// and later on:
Message m = receiver.receive(conf.dequeueTimeout);
I'm not running in a transaction on the dequeuer/receiver side. How can I set the "visibility" in JMS? Any ideas why I do not receive the messages?
What am I missing?
Payload is sys.AQ$_JMS_TEXT_MESSAGE, non compressed or the like.
btw: the dequeuing application is working using persistent messages...
Update: the code does not work for persistent messages also, if I use the MessageSelector. Without message selector and persistent messages it works!