AQ: Automatic dequeuing

Hallo,
AQ is new to me. Therefor i have a question.
I set up a queue table, a queue and everything works fine.
Handmade queing and dequeing works too.
But how can i automatic dequeue messages, arriving in the queue. Is the a mechanism, perhaps aqdms.listen or the queue monitor process, a trigger or a kombination of all?
i have not found an oracle doc concerning this.
thanks for your answers in advance.

<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Kushal:
Would you clarify what automatic dequeueing is in your app design?<HR></BLOCKQUOTE>
I have a queue for user-search-requests.
the processing of user-requests needs a lot of time and more than 3 request at the same time its impossible on our machine.
therefor i have a queue wich contains a job-number for each user request(the job/search-desciptions are stored seperatly in an table).
these jobs shold be processed while idle-time.
the user queueing now job-numbers in the queue and i have to dequeue/process these jobs. but i have no idea how i can automaticly read out the job-numbers from the queue.
at the moment i have an admin-application to dequeue by hand :( or i do it with the svrmgr. but that no solution for me.
hope that helps. sorry for my bad english.
greeting thomas

Similar Messages

  • Why are my JMS messages automatically dequeued without consumer?

    I created a simple in-memory JMS queue.
    Now I wrote a BPEL process which writes (successfully ?) JMS message to this JMS queue.
    Another consuming BPEL process is deployed but not started.
    However I cannot see them in MBean JMSDestinationResource on the OC4J Enterprise Manager Web page.
    When I tell the AppServer to browse all currently existing (and waiting) JMS message then there are none.
    However the statistics for this queue show 17 messagesEnqueued and 17 messagesDequeued Messages.
    It seems to me that my JMS messages are automatically dequeued. But why?
    Are in-memory JMS messages not persistent (as long as the AppServer is up and running) ?
    Do I have to set a certain preference to let JMS live in the Queue as long as they are not retrieved by another BPEL process?
    Furthermore I tried the following:
    I started a consuming BPEL process. Yes, he is waiting at the JMS adapter until a new JMS message arrive.
    Then I send from the first BPEL process a JMS message. But even when consumption is possible the JMS message is dequeued and not forwarded to the consumer.
    Why?
    Peter

    It seems to me that my JMS messages are automatically dequeued. But why?
    This is how BPEL PM is designed; The activation-agent is running that belongs to the BPEL process. When a message arrives in a Queue or Table or File it is read into the dehydration store. Then an instance of the appropriate BPEL process is started. This functionality makes the system more stabel and reliable when something is goingin wrong in quees/files/db or any adapter that is used for polling.Are in-memory JMS messages not persistent (as long as the AppServer is up and running) ?
    As you desribed: in-memory messages are only persistent in memory, if you restart the server, the messages are gone.Do I have to set a certain preference to let JMS live in the Queue as long as they are not retrieved by another BPEL process?
    No you can not.Marc
    http://orasoa.blogspot.com

  • Message from the IP_IN_QUEUE is automatically dequed

    Hi all,
    There are 2 messages in the IP_IN_QUEUE. I tried to dequeue it from BPEL using the AQ Adapter, but it is not dequeing. One of the reason could be the Payload structure of the existing messages in the IP_IN_QUEUE is different from the Payload structure of the schema imported in the BPEL Designer.
    So I thought of Enqueue a new message into the IP_IN_QUEUE and then thought of dequeue with the same message structure from BPEL thru AQ Adapter.
    I am able to enqueue a new message. I can able to see a new record inserted into the table IP_QTAB for the queue IP_IN_QUEUE, corresponding to this new enqueue message. But after some times, this message is automatically dequeued from IP_IN_QUEUE(i.e the corresponding row is automatically removed IP_QTAB)
    Can any one tell me how the message can be automatically dequeued from IP_IN_QUEUE. Also suggest if there are any way to find what are all the messages dequeued from IP_IN_QUEUE and what process dequeues them.
    Any help is highly appreciated.

    Hi,
    There are no automatic processes that dequeue messages from the IP_IN_QUEUE. When you dequeue a message from the IP_IN_QUEUE, you must make sure that the consumer name matches. The default consumer name is b2buser when B2B Server enqueues to the IP_IN_QUEUE. However, the default can be overrided by the Document Routing ID in the Document Definition Parameters page. If you are enqueuing from BPEL, you may have selected something totally different. I do not know of ways to track how the message is dequeued. You may want to post that question to the Oracle AQ forum.
    One suggestion is setup the tutorial so that you have the end to end scenario working. You can use the deq.bat or deq.sh in the $ORACLE_HOME/ip/tutorial/X12/runtime directory (for example, if you use the X12 tutorial) to dequeue messages from IP_IN_QUEUE. The default consumer name b2buser is assumed. After you are able to do that, then you want to try dequeueing using BPEL.
    Eng

  • PL/SQL Callback to Dequeue

    I have a procedure that automatically dequeues from a PL/SQL callback (9iR2) in a single consumer queue within the same instance. The same procedure functions when manually called agaist a propogated queue in a separate instance, but it will not work via PL/SQL callback.
    Callback code:
    DECLARE
    reginfo1 SYS.aq$_reg_info;
    reginfolist SYS.aq$_reg_info_list;
    BEGIN
    -- register for the pl/sql procedure notifyCB to be called on notification
    -- AQNMDLINK: schema owner
    -- CFR_QUEUE_DEST: prop queue
    -- NMD: consumer
    reginfo1 :=
    SYS.aq$_reg_info ('AQNMDLINK.CFR_QUEUE_DEST:NMD',
    1,
    'plsql://AQNMDLINK.p_dequeue_cfr_submit',
    HEXTORAW ('FF')
    -- Create the registration info list
    reginfolist := SYS.aq$_reg_info_list (reginfo1);
    --SYS.DBMS_AQ.unREGISTER (reginfolist, 1);
    SYS.DBMS_AQ.REGISTER (reginfolist, 1);
    COMMIT;
    END;

    Perhaps this guide can help you:
    Application Developer's Guide - Advanced Queuing Contents / Search / Index / PDF
    http://download-east.oracle.com/docs/cd/B10501_01/appdev.920/a96587.pdf
    Joel P�rez

  • MDB listening on AQ.

    I have written a message driven bean that listens on an Oracle AQ. In v9.0.2 of OC4J I had a number of problems (e.g. the MDB would wait 240 seconds before accepting a second message, and the queue working in a LIFO way instead of a FIFO way). However, the developers preview (v9.0.3) of OC4J has fixed these 2 problems but introduced another. Now my messages never get dequeued from my AQ (they did in v9.0.2). Has anyone else encountered a similar problem using a MDB on Oracle AQs and v9.0.3 of OC4J?
    Thanks,
    Stephen Weatherly

    Thanks for the reply, my MDB is transacted. In OC4J v9.0.3 my messages simply do not get dequeued when my MDB finishes it's processing. My MDB code runs and does what is expected, however, any messages delivered to it from the queue are not being automatically dequeued. In OC4J v9.0.2 after my MDB's code had finished successfully then the message would be dequeued by whatever process manages the delivering the message to the MDB, however in OC4J v9.0.3 this does not seem to happen. After my MDB has run the message remains on the queue. If I then restart the OC4J server then I receive the message again even though my MDB sucessfully processed the message the first time.
    My MDB code is as follows:
    package mdb;
    import javax.ejb.*;
    import javax.jms.*;
    import javax.naming.*;
    import java.util.*;
    public class MessageLogger implements MessageDrivenBean
    private final static int sleepTotal = 10 ;
    private MessageDrivenContext messageContext;
    public void ejbCreate()
    System.out.println("MessageLogger.ejbCreate()");
    public void onMessage(Message message)
    System.out.println("Received message: " + message + " at " + new java.util.Date());
    try
         oracle.jms.AQjmsTextMessage oracleMessage = (oracle.jms.AQjmsTextMessage) message;     
         System.out.println("MessageLogger.onMessage() : " + oracleMessage.getText() );
    //System.out.println("MessageLogger.onMessage() : " + message.getStringProperty("subject") + " " + message.getStringProperty("message"));
    System.out.println("Sleeping...");
    int sleepCount =0;
    while (sleepCount < sleepTotal)
    System.out.println("Sleeping: " + (1+(sleepCount++)) + " / " + sleepTotal );
    try
    Thread.sleep(1000);
    catch (Exception e)
    catch(Exception e)
    throw new EJBException(e);
    public void ejbRemove()
    System.out.println("MessageLogger.ejbRemove()");
    public void setMessageDrivenContext(MessageDrivenContext context)
    this.messageContext = context;
    My ejb-jar.xml looks like:
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">
    <ejb-jar>
         <description>A How-To demonstrating Message-Driven Beans</description>
         <enterprise-beans>
              <message-driven>
                   <description></description>
                   <ejb-name>MessageLogger</ejb-name>
                   <ejb-class>mdb.MessageLogger</ejb-class>
                   <message-driven-destination>
                        <destination-type>javax.jms.Queue</destination-type>
                   </message-driven-destination>
              </message-driven>
         </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>MessageLogger</ejb-name>
    <method-name>onMessage</method-name>
    <method-params>
    <method-param>javax.jms.Message</method-param>
    </method-params>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    My orion-ejb-jar.xml looks as follows:
    <?xml version="1.0"?>
    <!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd">
    <orion-ejb-jar>
         <enterprise-beans>
              <message-driven-deployment name="MessageLogger"
    destination-location="java:comp/resource/RUB4/Queues/AQ.JMS_queue_1"
    connection-factory-location="java:comp/resource/RUB4/QueueConnectionFactories/JMS_Queue_CF"
    max-instances="1">
              </message-driven-deployment>
         </enterprise-beans>
         <assembly-descriptor>
         </assembly-descriptor>
    </orion-ejb-jar>
    And I have the following resource provider set up in my OC4J applications.xml file:
    <resource-provider class="oracle.jms.OjmsContext" name="RUB4">
    <description>Access to RUB4 database rubick</description>
    <property name="url" value="jdbc:oracle:thin:aq/aq@rubick:1521:RUB4" />
    <property name="username" value="aq" />
    <property name="password" value="aq" />
    </resource-provider>
    Thanks for any assistence,
    Steve

  • Is possible to propagate message from AQ to another Application by Internet

    Hi,
    Is possible to propagate mesage from AQ to another Application by internet protocol such as HTTP, SMTP?
    I need to automatic dequeue from AQ and send message from queue to Email or HTTP , is it possible? if yes, how to do it?
    Thanks

    chry,
    You can use a java stored procedure to dequeue the message and then use JavaMail to send the message by eMail, or the java.net package to use HTTP to send the message.
    I believe Web Services is also supported. The new book by Kuassi Mensah explains how to do this (I believe). The following post has more details:
    Programming the Oracle Database with Java and Web Services: sample chapter
    (Posted: Nov 1, 2005 2:22 PM)
    Good Luck,
    Avi.

  • How to stop listening on advanced queue

    hi,
    i created a java application that listens to an oracle advanced queue then automatically dequeues a messsage after listening. I've set my listen time-out to be the maximum integer value because i don't know when exactly when other applications will enqueue messages.
    the problem is when i attempt to shutdown the server, my application is still listening to the advanced queue.
    i want to find a way to for the LISTEN to stop whenever i perform a certain event, for example, i want shutdown my server. does oracle advance queue have that kind of functionality? stopping the LISTEN?
    Thanks very much
    Chesca

    Hi Chesca,
    we recently experienced the same problem.
    Instead of "resolve" it, we tried to "avoid" it.
    Our solution is based on 2 legs:
    1) a "not-infinite" wait time, let's say 300 secs (5 mins)
    2) an (outer) "infinite-loop" that relaunch the (inner) LISTEN method, catching the appropriate exceptions, and testing for the "state" of the queue
    Hope this could help you.
    Bye
    Paolo

  • Dequeing happens only every 5 Seconds

    I'm trying to use Oracle Advanced Queuing on Oracle 9.2.0.6.0 for doing some real time publication. Unfortunately my testing has proved that the automatic Dequeuing of the Enqueued mesages happens only every 5 seconds. I'm guessing this is dependent on the Oracle's internal parameter jobqueue_interval (Similar to DBMS_JOB). Am I right? Oracle recommends not to change this parameter value. What other ways do we have to do some real time stuff. Are there anyother parameter value that can be set so that the Dequeuing happens immediately. Thanks in advance.
    Find below my Dequeue proceudure.
    CREATE OR REPLACE PROCEDURE p_dequeue ( context RAW,
    reginfo SYS.AQ$_REG_INFO,
    descr SYS.AQ$_DESCRIPTOR,
    payload RAW,
    payloadl NUMBER)
    AS
    dequeue_options dbms_aq.dequeue_options_t;
    message_properties dbms_aq.message_properties_t;
    message_handle RAW(16);
    message message_type;
    BEGIN
    dequeue_options.msgid := descr.msg_id;
    dequeue_options.consumer_name := descr.consumer_name;
    dbms_aq.dequeue(queue_name => descr.queue_name,
    dequeue_options => dequeue_options,
    message_properties => message_properties,
    payload => message,
    msgid => message_handle);
    INSERT INTO KTEST VALUES(message.message_body||to_char(sysdate, 'dd/mm/yyyy hh24:mi:ss'));
    COMMIT;
    END;
    /

    I had a similiar problem. You need to take a look at your mgw.ora file. The default for dequeueing is 5 seconds. You can override the default by coding the following in mgw.ora:
    setJavaProp oracle.mgw.polling_interval=xxx
    Where xxx is the time you want in milliseconds (I have mine set to 500).
    You can see what the polling interval is currently set to by viewing you mgw startup log. My log is under path /opt/app/oracle/product/9.2.0/mgw/log. Since I have put in the override, it says in my log:
    The default polling interval is set to 500ms.
    I hope this solves your problem.

  • Dequeing question

    Let me present a scenario. A company receives 200k events/hour. Every event is connected to a person and a case (for instance an order). The business constraint here is that all events for a specific case need to be processed in sequential order. No parallel processing for the same case is allowed.
    So what we would like to do is automatic dequeuing of incoming events to the queue, but limited to one per case (oh, a case is identified by its CaseID). There will be an update to the queue telling to remove the processed events from the queue when processing has ended.
    Is there standard functionality available for this, or do we need to build a specialized dequeueing agent?

    Yes, that's what I was thinking. However, I also need to make sure that only 1 event is processed at the same time for every single case/person. So I can have 2 or more entries in the queue, both regarding the same case, but different events. In that case only one is allowed to be processed. Is it possible to use a case-ID to prevent this?

  • How to dequeue a message automatically by getting a notification

    If there is some data falls in the queue table.How to dequeue a message automatically by getting a notification in my application side .
    Below is the link i am following for enqueuing the message into a queue table, its happening successfully.
    http://www.oratechinfo.co.uk/aq.html
    I can see the message i enqueued in the queue table with the following query at the scheduled time. select user_data from queue_table;
    And below is the link to C++ code to dequeue the message.With the below c++ code i am able to dequeue the data manually in my application side.But i want a method to dequeue automatically by getting a notification and start to dequeue automatically.Please give me a hand and make it clear.
    http://docs.oracle.com/cd/A83908_02/NT816EE/DOC/nt.816/a99999/o4c00069.htm

    If its possible from PL/SQL side please share the code.

  • Automatic item addition in a PM notification

    Hello there!
    I'm trying develop an automatically item addition in a PM notification... But I have to do it during a dialog process (via IW21/22 transaction)!
    I mean, when user adds a new item in a notification, some other items must be automatically added, via INTRO push button or, maybe, via some other user action. I've tryed with the following (disappointed) ways:
    1.- QQMA0021 Enhacement (QM/PM/SM: Function "User data" in "Goto" menu): It doesn't work because user exit interface is not a table (it's actually a working area): I can only modify the selected item, and I want to add a different one...
    2.- QQMA0014 Enhacement (QM/PM/SM: Checks before saving a notification): It works fine when I use IQS0_ADD_ITEM Function Module, but I can't be satisfyed with this solution because, after SAVE process, the system closes the notification visualisation/modification (and it takes the user to IW21/22 initial screen): My client wants to 'remain inside' the transaction, in order to check the added items...
    3.- Action Box push button: This is my favourite one (although it doesn't work, either!) because it's the most 'elegant'... I've placed an Action Box Activity in my Notification Screen and I've assigned a Function Module to it (which dequeues the current notification number, calls IQS0_ADD_ITEM Function Module and, finally, enqueues the document again, it makes no sense to directly modify the values of the tables interfaces, because they are set as 'Table Will Not Be Exported').
    Anyway, system triggers a short dump (ABAP program SAPLDMEE2):
    Quote:
    Runtime Error OBJECTS_OBJREF_NOT_ASSIGNED_NO
    Exception CX_SY_REF_IS_INITIAL
    It's not an interface problem (I've copyed this interface from the dinamic call to the Action Box Activity assigned Function Module). Furthermore, if I asterisk my Function Module code, system doesn't dump at all (but it obviously doesn't work as it's supossed to!): That's why I think I won't reach a customizing solution (I mean, this dump is not raised because of the customizing, I guess: It seems to be a because of the Function Module inserted code)...
    I've set the Documentation fiield of my Action Box Activity customizing as 'N None'.
    Can anyone suggest me any new idea? I'll welcome each and every suggestion!
    Thanks in advance, greetings from Locarno (Switzerland)!

    Hi Mutale,
    I see some confusion in concept about Catalog Code Tabs.
    What you referred in the initial post are the Sub-Tabs inside a Catalogs & codes Main tab of a Notification.
    What you have referred to in the later post are the Main Tabs of Catalogs. like this
    The Difference
    The Sub-Tabs of Catalogs will display information corresponding to the line item of the first tab (Object part & Damage Tab). Here you are not free to enter a Cause, Task or Activity without filling an Item line (Object part or Damage)
    The Main Tabs are independent Catalog Tabs. You can maintain the line items here independently  without any conditions as above.
    Lastly:
    I hope your initial query has been cleared by looking into the picture, that you can have a separate Causes Tab.
    In configuration, you need to have tab 10/Tab16 for this.
    Best of Luck
    Jogeswara Rao K

  • Messages don't dequeue

    I manually queued row LCR's using the procedure described in chapter 16 in streams documentation pages 16-3 to 16-7. My messages are effectively queued but they are in WAITING state and i don't know why they are not dequeued automatically by the apply process.
    Any ideas ?
    Claudine

    Even I seem to have a similar problem.
    I am trying a sample OTN sample for OJMS/AQ.
    My MDB (which is a SIMPLE CMT MDB, with AUTO_ACKNOWLEDGE) is receving notifications. No issues here.
    But, All messages are REDELIVERED to my MDB instance (until the RETRY COUNT expires) .
    And the DATABASE TABLE, AQ$RPTESTQTAB, shows the MSG_STATE as 'READY', even fter the onMessage() returns.
    Why are MESSAGES not getting DEQUEUED from the QUEUE?
    This is the SIMPLEST of all EXAMPLES, with CMT MDB, and the CODE FOR CREATION , STARTING the QUEUE was from OTN.
    Please help urgently , as I need to justify my company's investment in JMS.

  • Query on sap locks(ENQUEUE/DEQUEUE)

    Hi All,
    should the sap locks ENQUEUE/DEQUEUE need to be used  for all the updation/insertion  of records ino the table?
    Please confirm.Should this locking technique be used even for insertion of records into the table?
    Regards,
    Pra.

    Hi,
    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
    SAP Provide three type of Lock objects. 
    - Read Lock(Shared Locked)
       protects read access to an object. The read lock allows other  transactions read access but not write access to 
       the locked area of  the table
    - Write Lock(exclusive lock)
       protects write access to an object. The write lock allows other  transactions neither read nor write access to 
        the locked area of the  table.
    - Enhanced write lock (exclusive lock without cumulating)
      works like a write lock except that the enhanced write lock also  protects from further accesses from the 
      same transaction.
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technicaly:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    You have to use these function module in your program.
    Hope this will give a basic idea.

  • Finding which recipients did not dequeue a message

    Hello
    Is there a way with a multiconsumer queue to fid out which recipients in the list have not dequeued the message?
    The scenario is this. We have a number of daemon type processes that sit on queues, processing whatever messages they need to. We need a way of finding out if each daemon is alive and kicking.
    The way I thought of doing this was to set up a multiconsumer queue and enqueue a message with the list of recipients being each daemon process, and set an expiration time of say 10 seconds. The daemons listen to their normal work queue and the "are you alive" queue, and just dequeue any messages on the latter. If the message is not dequeued by all recipients within the time limit, the message will be moved to the exception queue. The process that sent out the request can then just listen on the exception queue for a mesage comming back, but it needs to know which recipient did not dequeue it's message.
    So is it possible to find out which recipients did not dequeue the message just from the exceptions queue and supporting meta data tables? Does this sound like a reasonable approach?
    David

    Yes, you can, use the queue table view. It has the consumer name column. View is automatically created [by default] when the table is created.
    All the queue table view name start with AQ$<Queue table name>.
    For example :- if a queue table name is customer_qt then the view name would be aq$customer_qt.
    Regards,
    Sanjeev

  • Dequeue a text message

    Hello everyone,
    DB version : 11.2.0.1.0
    I'm able to add a text message on an AQ queue, but I'm not able to dequeue it from java.
    When I run the dequeue method, it waits ... it doesn't get any message in, even if new messages are being put on the queue.
    What am I missing ?
    Creation of the AQ queue:
    EXEC DBMS_AQADM.STOP_QUEUE('textmessage_queue');
    EXEC DBMS_AQADM.DROP_QUEUE('textmessage_queue');
    EXEC DBMS_AQADM.DROP_QUEUE_TABLE('queue_textmessage_table');
    EXEC DBMS_AQADM.CREATE_QUEUE_TABLE (queue_table => 'queue_textmessage_table', queue_payload_type => 'SYS.AQ$_JMS_TEXT_MESSAGE', multiple_consumers => false);
    EXEC DBMS_AQADM.CREATE_QUEUE (queue_name => 'textmessage_queue', queue_table => 'queue_textmessage_table');
    EXEC DBMS_AQADM.START_QUEUE (queue_name => 'textmessage_queue');The createJMSClient(); used by the enqueue and dequeue methods
        private JMSTopic createJMSClient() {
            JMSTopic aq = new JMSTopic();
            try {
                TopicConnectionFactory topicConnectionFactory = null;
                // Get topic connection factory
                Properties info = new Properties();
                info.put(userName, userPassword);
                topicConnectionFactory = AQjmsFactory.getTopicConnectionFactory(connectString, info);
                // Creates an AQ topic connection and session
                aq.connection = topicConnectionFactory.createTopicConnection(userName, userPassword);
                // If a session is transacted, message acknowledgment is handled automatically
                //   by commit and recovery is handled automatically by rollback
                aq.session = aq.connection.createTopicSession(true, // Session is transacted
                            Session.CLIENT_ACKNOWLEDGE); // Acknowledges by commit and rollback
                System.out.println("Successfully created AQ session");
            } catch (Exception ex) {
                System.err.println("AQApplication.createJMS(): " + ex.getMessage());
                System.err.println("user = " + userName + ", password = " + userPassword + ", destination = " +
                                   connectString);
                ex.printStackTrace();
            return aq;
        }Java code to enqueue a text message
            JMSTopic client = myMessage.createJMSClient();
            AQjmsSession aqjmssession = (AQjmsSession) client.session;
            AQjmsDestination destination = (AQjmsDestination)aqjmssession.getQueue(myMessage.DB_AQ_ADMIN_NAME, "textmessage_queue");
            TextMessage createTextMessage = aqjmssession.createTextMessage("This is my first text message");
            MessageProducer producer = aqjmssession.createProducer(destination);
            producer.send(createTextMessage);
            aqjmssession.commit();Java code to dequeue a text message
            JMSTopic client = myMessage.createJMSClient();
            AQjmsSession aqjmssession = (AQjmsSession)client.session;
            AQjmsDestination destination =
                (AQjmsDestination)aqjmssession.getQueue(myMessage.DB_AQ_ADMIN_NAME, "textmessage_queue");
            MessageConsumer consumer = client.session.createConsumer(destination);
            System.out.println("Waiting for a message ...");
            Message message = consumer.receive();
            System.out.println("Message received !!");

    You have to start the connection (aq.connection) to receive the message. This is not required for enqueue, but required for dequeue.

Maybe you are looking for