Dequeue from an exception queue

Hi,
I am very new to oracle AQ and trying dequeuing of message from an exception queue. I have created a procedure for dequeuing a message from exception queue and is working fine. I have to execute this procedure manually each time a message is moved to the exception queue. Is there any mechanism to call this procedure automatically each time the message is moved to exception queue? Please help.
Thanks in Advance
Lokesh

Hello,
as you wrote you already have a code snippet with DBMS_AQ.DEQUEUE of an exception queue.
Wrap this DEQUEUE in an infinite loop (LOOP ... END LOOP). In order to have this procedure as an autonomous session
you can start it as a database job:
DECLARE
   v_jobno NUMBER(6);
BEGIN
    DBMS_JOB.SUBMIT( v_jobno,
                    'BEGIN <your module>; END;',
                    SYSDATE, NULL );
    COMMIT;
END;
/Kind regards,
WoG

Similar Messages

  • Dequeue from multi consumer queue table

    Hi,
    Even after all consumers I created have dequeued the messages (in REMOVE mode), they just didn't go from the queue table. Although my application works fine (the messages could no longer be dequeued again), I am afraid this will affect performance when messages piled up in Q table.
    I tried maunally delete the records in Q table. But the question is "is there an automatic way to handle this?"
    Thx for any feedback!

    Make sure that the init.ora parameter AQ_TM_PROCESSES is set to 1 or more. This is the parameter that controls the number of processes available to clean up the queue after the messages have been dequeued or the message has expired.

  • Dequeue from multi consumer queue without consumer_name

    Are there any way to efficient emptying a multiconsumer queue where mesages by sender are taged with consumer_name, and there are multiple consumers?

    Christian,
    I have the same question. Have you got any answer or found out any good solution?
    Thx!

  • Dequeue   elements from an  apply - queue table

    hi Everyone?
    I'm tried dequeue elements from a queue table. This one, is associated to an apply streams process. I'd wrote this procedure to test a manual dequeue, but this error message appears :
    ORA-25228: timeout or end-of-fetch during message dequeue from STADMIN.Q_APP_SELECTS_FROM_CRM
    The queue is not empty
    Help me please... thank you
    The Procedure code is:
    create or replace procedure str_clean_queue (cola in varchar2, tabla in varchar2, comando in varchar2) is
    next_trans EXCEPTION;
    pragma exception_init (next_trans, -25235);
    no_messages EXCEPTION;
    pragma exception_init (no_messages, -25228);
    dequeueOpt dbms_aq.dequeue_options_t;
    message_properties dbms_aq.message_properties_t;
    message SYS.ANYDATA;
    msgid raw(16);
    newMess boolean;
    lcr SYS.LCR$_ROW_RECORD;
    a number :=0;
    begin
    dequeueOpt.CONSUMER_NAME := 'APP_SELECTS_FROM_CRM';
    dequeueOpt.DEQUEUE_MODE := DBMS_AQ.LOCKED;
    dequeueOpt.NAVIGATION := DBMS_AQ.FIRST_MESSAGE;
    dequeueOpt.VISIBILITY := DBMS_AQ.IMMEDIATE;
    dequeueOpt.WAIT :=10;
    dequeueOpt.MSGID := null;
    newMess:=True;
    while (newMess) loop
    begin
    DBMS_AQ.DEQUEUE (
    queue_name => 'STADMIN.'|| cola,
    dequeue_options => dequeueOpt,
    message_properties => message_properties,
    payload => message,
    msgid => msgid);
    -- analizamos lo que llego en el payload
    lcr := DBMS_STREAMS.CONVERT_ANYDATA_TO_LCR_ROW(message);
    if (lcr.get_command_type = comando AND
    lcr.get_object_name = tabla AND
    lcr.get_object_owner = 'DBADMIN') then
    -- hacer desaparecer el lcr de la cola
    dequeueOpt.DEQUEUE_MODE := DBMS_AQ.REMOVE;
    dequeueOpt.MSGID := msgid;
    DBMS_AQ.DEQUEUE (
    queue_name => 'STADMIN.'|| cola,
    dequeue_options => dequeueOpt,
    message_properties => message_properties,
    payload => message,
    msgid => msgid);
    a:=a+1;
    end if;
    dbms_output.put_line(a);
    exception
    WHEN next_trans THEN
    dequeueOpt.navigation := DBMS_AQ.NEXT_TRANSACTION;
    WHEN no_messages THEN
    dbms_output.put_line(sqlerrm);
    newMess := FALSE;
    end;
    end loop;
    end str_clean_queue;

    Hello,
    as you wrote you already have a code snippet with DBMS_AQ.DEQUEUE of an exception queue.
    Wrap this DEQUEUE in an infinite loop (LOOP ... END LOOP). In order to have this procedure as an autonomous session
    you can start it as a database job:
    DECLARE
       v_jobno NUMBER(6);
    BEGIN
        DBMS_JOB.SUBMIT( v_jobno,
                        'BEGIN <your module>; END;',
                        SYSDATE, NULL );
        COMMIT;
    END;
    /Kind regards,
    WoG

  • BPEL Process for AQ Exception Queue

    Is there a way to configure AQ adapter to dequeue message from default exception queue. I have tried doing so but it fails to find the exception queue. If not then what are the better ways of handling exception messages for a multiconsumer queue.
    I need to enqueue the messages from exception queue once the issue is resolved.
    -AA

    Any one who can help me on this ?
    -AA

  • Exception Queue cleanup.

    hi all,
    i am using oracle 9i.
    is there a way to automatically remove messages from the exception queue?
    if so, what determines when this removal occurs?
    Thanks ahead,
    Lior.

    i ll answer my question
    first set exception queue dequeue enable
    BEGIN
    dbms_aqadm.start_queue(queue_name => 'aq$_request_qt_e',dequeue => TRUE,enqueue => FALSE);
    END;
    then dequeue messages with null consumer name ;)

  • Consume exception queue messages (Topic)

    Hi,
    Context : 1 topic - 2 consumers (BPEL consumers) A and B.
    If A fails to consume a message, this message is sent to the exception queue even if B managed to consume it.
    It's normal.
    If I move this message from the exception queue to the original queue, it will be consumed by A and again by B.
    Is it normal ?
    I expected that the message would be only consumed by A ...
    Is it possible ?
    Thanks,
    romain.

    i ll answer my question
    first set exception queue dequeue enable
    BEGIN
    dbms_aqadm.start_queue(queue_name => 'aq$_request_qt_e',dequeue => TRUE,enqueue => FALSE);
    END;
    then dequeue messages with null consumer name ;)

  • Dequeue from exception queue failing

    i'm having trouble dequeueing a message that has been moved to the exception queue. i can 'see' the message by looking at the queue table using Toad, but any attempt to dequeue it using DBMS_AQ.DEQUEUE results in the procedure timing out without dequeuing the message. when i try to dequeue it explicitly, using the ID, the process hangs. either way, there are no error messages.
    i'm using the default exception queue, which i have started and enabled for dequeue.
    thanks in advance for any help, simon

    after banging my head on the wall for three days, a shutdown and restart of the database solved this problem....

  • Dequeue from Advanced Queue

    Hi All,
    I have used the DBMS_AQ package provided dequeue functionality for dequeuing msgs from my advanced queue. Now there is a job which dequeue the items from this queue and sends out email. Now what is happening is the job picks up an item from the advanced queue for dequeuing and sends out email, but the item which is picked up still remains in the queue and is not dequeued. As the job runs every minute and polls the queue, it again picks up the same queue item and sends the email. This process repeats for 5-6 times and then the queue message expires. My requirement is that, the job should dequeue the item from the queue and just send email once. Please can anyone suggest what could be the solution to this problem?

    10g is not a version number it is a marketing label that applies equally to 10.1.0.2 and 10.2.0.4 and a lot of versions in between.
    That said I know this demo I wrote works in all versions of 10.2:
    http://www.psoug.org/reference/aq_demo1.html
    Compare it to what you are doing.

  • Message not moving to default exception queue when max retries reached

    Hi
    I've set up an advanced queue with max retrie of 5 but when the dequing fails the retry count increments but it never goes to the exception queue. The retry count stays at 6, msg_state = READY, deq_txn_id = RETRY_EXCEEDED. Any ideas?
    -- drop queue if it exists
    exec dbms_aqadm.stop_queue (queue_name => 'AQ$_JY_METER_ENABLE_QTAB_E');
    exec dbms_aqadm.stop_queue (queue_name => 'JY_METER_ENABLE_QUE');
    exec dbms_aqadm.drop_queue (queue_name  => 'JY_METER_ENABLE_QUE') ;
    exec dbms_aqadm.drop_queue_table( queue_table => 'JY_METER_ENABLE_QTAB');
    -- create the payload for the messages
    CREATE TYPE jy_meter_enablement_typ AS OBJECT
    request_id                VARCHAR2(30) ,
    request_system_code       VARCHAR2(20) ,
    business_process_ref      VARCHAR2(20) ,
    request_type_ref          VARCHAR2(20) ,
    meter_serial_number       VARCHAR2(10) ,
    message_request_content   CLOB
    -- Create queue table.
    -- This one has a sort list so items will be enqueued first based on priority and then based on enq_time
    BEGIN
       dbms_aqadm.create_queue_table (queue_table        => 'JY_METER_ENABLE_QTAB',
                                      queue_payload_type => 'JY_METER_ENABLEMENT_TYP',
                                      multiple_consumers => TRUE ,
                                      sort_list          => 'priority,enq_time' ,
                                      comment            => 'Queue table to handle JY Meter Enablement messages');
    END;
    -- Create Queue based on table
    BEGIN
      -- retention time set 3600 seconds (ie 1 hour) so the message is kept on the queue for 1 hour after it has been dequeued.
       dbms_aqadm.create_queue (queue_name     => 'JY_METER_ENABLE_QUE',
                                queue_table    => 'JY_METER_ENABLE_QTAB' ,
                                max_retries    => 5 ,
                                retry_delay    => 2 ,
                                retention_time => 3600 ,
                                comment     => 'Queue to handle JY Meter Enablement messages in priority/enq_time order');
    END;
    -- start the queue
    BEGIN
    dbms_aqadm.start_queue (queue_name => 'JY_METER_ENABLE_QUE');
    END ;
    -- Add and register a subscriber to the queue to run the Dequeue procedure
    BEGIN
       dbms_aqadm.add_subscriber (queue_name => 'EMO_METER_MGMT.JY_METER_ENABLE_QUE',
                                  subscriber => SYS.AQ$_AGENT('JY_METER_ENABLE_QUE_SUBSCRIBER',
                                                              NULL,
                                                              NULL )
        dbms_aq.register (SYS.AQ$_REG_INFO_LIST(SYS.AQ$_REG_INFO('JY_METER_ENABLE_QUE:JY_METER_ENABLE_QUE_SUBSCRIBER',
                                                                 DBMS_AQ.NAMESPACE_AQ,
                                                                 'plsql://EMO_METER_MGMT.DEQUEUE.dequeue_jy_request',
                                                                 HEXTORAW('FF'))),1);
    END;
    -- start the default exception queue
    BEGIN
    dbms_aqadm.start_queue(queue_name => 'EMO_METER_MGMT.AQ$_JY_METER_ENABLE_QTAB_E',
                            enqueue => FALSE,
                            dequeue => TRUE);
    END ;
    /Thanks

    Sorry, forgot to add db version
    select banner from v$version/
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    5 rows selected.

  • Remove exception queue

    I am new to AQ. We are using Oracle 11.2.0.3. We will be implementing Normal single subscriber queue. We will be using exisiting error logging table to hadle exception . So exception queue would be redundant for our workflow.
    1) Is is possible to create Queue without exception queue?
    2) Can we use queue by disabling its exception queue?
    3) How can we remove/expire message from exception queue as soon as it enqueued?
    Appreciate your input. Thanks.

    Hello,
    1) Is is possible to create Queue without exception queue?
    When you create a queue table you always get a default exception queue and there should always be at least one exception queue in a queue table. When you create normal queue an exception queue is not created just the normal queue
    2) Can we use queue by disabling its exception queue?
    I am not clear on what you are asking with regard to this question. If you enqueue a message into a normal queue and it needs to be moved to the exception queue a queue monitor slave process will move the message from the normal queue to the exception queue. You can only enable an exception queue for dequeue. You cannot prevent a message from being placed on the exception queue if it is appropriate for the system to do this.
    3) How can we remove/expire message from exception queue as soon as it enqueued?
    You can setup AQ PL/SQL Notification to process any messages which are placed in the default exception queue or use DBMS_AQ.Listener to listen for enqueued messages into the exception queue.
    Thanks
    Peter

  • Exception queue messages

    is there anyway to dequeue exception queue messages
    my main queue is multiconsumer
    Message was edited by:
    JAA

    i ll answer my question
    first set exception queue dequeue enable
    BEGIN
    dbms_aqadm.start_queue(queue_name => 'aq$_request_qt_e',dequeue => TRUE,enqueue => FALSE);
    END;
    then dequeue messages with null consumer name ;)

  • Message Driven Bean reading multiple times from a jms queue

    Hi,
    I am facing a strange problem with my message driven bean. Its configured to read message from a jms queue. But sometimes it read the same message multiple times from the jms queue.
    We are using weblogic server 8.1 sp5.
    Please find below our descriptor files
    ejb-jar.xml  
    <ejb-jar>  
      <display-name>ClarifyCRM_Process_Manager_13.1</display-name>  
      <enterprise-beans>  
        <session>  
          <display-name>ProcessManager</display-name>  
          <ejb-name>ProcessManager</ejb-name>  
          <home>com.clarify.procmgr.ejb.ProcessManagerHome</home>  
          <remote>com.clarify.procmgr.ejb.ProcessManagerRemote</remote>  
          <ejb-class>com.clarify.procmgr.ejb.ProcessManagerEJB</ejb-class>  
          <session-type>Stateless</session-type>  
          <transaction-type>Container</transaction-type>  
        </session>  
        <message-driven>  
          <display-name>ProcessManagerListener</display-name>  
          <ejb-name>ProcessManagerListener</ejb-name>  
          <ejb-class>com.clarify.procmgr.ejb.ProcessManagerMDB</ejb-class>  
          <transaction-type>Bean</transaction-type>  
          <acknowledge-mode>Auto-acknowledge</acknowledge-mode>  
          <message-driven-destination>  
            <destination-type>javax.jms.Queue</destination-type>  
          </message-driven-destination>  
        </message-driven>  
      </enterprise-beans>  
      <assembly-descriptor>  
        <container-transaction>  
          <method>  
            <ejb-name>ProcessManager</ejb-name>  
            <method-name>*</method-name>  
          </method>  
          <trans-attribute>Required</trans-attribute>  
        </container-transaction>  
      </assembly-descriptor>  
    </ejb-jar>  
    weblogic-ejb-jar.xml  
    <weblogic-ejb-jar>  
      <weblogic-enterprise-bean>  
        <ejb-name>ProcessManager</ejb-name>  
        <stateless-session-descriptor>  
          <pool>  
            <max-beans-in-free-pool>100</max-beans-in-free-pool>  
            <initial-beans-in-free-pool>10</initial-beans-in-free-pool>  
          </pool>  
        </stateless-session-descriptor>  
        <enable-call-by-reference>False</enable-call-by-reference>  
        <jndi-name>ProcessManagerHome</jndi-name>  
        <dispatch-policy>PMExecuteQueue</dispatch-policy>  
        <remote-client-timeout>0</remote-client-timeout>  
      </weblogic-enterprise-bean>  
      <weblogic-enterprise-bean>  
        <ejb-name>ProcessManagerListener</ejb-name>  
        <message-driven-descriptor>  
          <pool>  
            <max-beans-in-free-pool>100</max-beans-in-free-pool>  
            <initial-beans-in-free-pool>10</initial-beans-in-free-pool>  
          </pool>  
          <destination-jndi-name>clarify.procmgr.jms.queue.Execution</destination-jndi-name>  
          <connection-factory-jndi-name>clarify.procmgr.jms.factories.ExecConnection</connection-factory-jndi-name>  
        </message-driven-descriptor>  
        <enable-call-by-reference>True</enable-call-by-reference>  
        <dispatch-policy>PMListenerExecuteQueue</dispatch-policy>  
        <remote-client-timeout>0</remote-client-timeout>  
      </weblogic-enterprise-bean>  
    </weblogic-ejb-jar>   The MDB is sometimes reading multiple times from clarify.procmgr.jms.queue.Execution
    Also i would like to add here that the connection factory we are using clarify.procmgr.jms.factories.ExecConnection is having the following properties
    ServerAffinity Enabled=true
    XA connection factory enabled=false.
    Please help me out here!!

    Maybe, your MDB "sometimes" throws an Exception in onMessage.
    Check if this happens when you set <max-beans-in-free-pool>1</max-beans-in-free-pool>.

  • Problem parsing TextMessage from a JMS queue

    I'm attempting to read and parse a TextMessage from a JMS queue. The message is in an XML format and I'm trying to parse it using "oraext:parseXML". If I hardcode a value such as:
    <copy>
    <from expression="'&lt;ns:person xmlns:ns=&quot;urn:mynamespace&quot;>&lt;ns:personname>&lt;ns:first>bob&lt;/ns:first>&lt;/ns:personname>&lt;/ns:person>'"/>
    <to variable="tempString"/>
    </copy>
    I can then parse "tempString" just fine. If I read the TextMessage in as a string and attempt the same thing, I constantly get
    "XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is oraext:parseXML(bpws:getVariableData('tempString')). The XPath expression failed to execute; the reason was: internal xpath error. Check the detailed root cause described in the exception message text and verify that the XPath query is correct. "
    If I look at "tempString" in both scenarios (hardcoding the value and reading it in) the contents are basically the same, when reading it in via the JMS queue it does seem to put in line breaks after the elements to format it more like an XML document. For example, coming in from JMS the string looks like:
    <ns:person>
    <ns:personname>
    <ns:first>bob</ns:first>
    </ns:personname>
    </ns:person>
    But hardcoding the value it looks like:
    <ns:person><ns:personname><ns:first>bob</ns:first></ns:personname></ns:person>
    Should this affect anything?
    Thanks.

    Thanks for the reply. I'm not sure I understand the difference between XML and an XML string. XML is just a well-formed text string, right?
    Anyway, your suggestion didn't work for me. The "ora:getContentAsString" call you suggested apparently strips away the XML and gives just the contents. For example, given the XML:
    <ns:person>
    <ns:personname>
    <ns:first>bob</ns:first>
    <ns:last>smith</ns:last>
    </ns:personname>
    </ns:person>
    "ora:getContentAsString" yields: "bobsmith", not the data structure.
    Again, thanks for the reply.

  • Business messages are not pushed back to the aq exception queue in case of errors

    Hi,
    I have the scenario, where I have configured the business events in ebs and implemented the soa interface which consumes the event message from wf_bpel_q.
    SOA interface is able to pickup the messages succesfully and same message will be pushed back to the same queue with the status=READY in case of exceptions as well. Ideally as per default functionality of AQ, in case of errors, messages will be pushed to exception queue.
    Please suggest why mesages are not pushed back to exception queue in case of errror scenarios with the status='Errored'.  Please let me know what i have been missing here in the setup.
    Regards,
    Anjana

    Hi Anjana,
    I am not familiar with the SOA interface, so I can't help you in detail, but take a closer look to the following documents.
    Doc ID 1374461.1 ,  Doc ID 1075611.1 , Doc ID 1356146.1
    Maybe you hit a known bug ....
    Hope that helps.

Maybe you are looking for

  • Authentication Error while Sending Email from SMTP server.

    Authentication Error while Sending Email from SMTP server.  Can receive emails but cannot send emails from this account. 

  • Very annoying issue: Hyper draw doesn't work in Score

    The concerning display remains grey and no data appears on it.... Very very annoying.......

  • Me21n =   subtotal 3

    hi expert , i am abaper  , there is problem in P.O in me23n " From which tcode or screen the below value come KZWI3 = Subtotal 3 from pricing procedure for condition " this is EKPO-KZWI3 which is Subtotal 3  come in ekpo table if this value is there

  • How is cluster of 5 elements converted to spreadsheet?

    I have a bundle output as a Cluster of 5 elements.  The cluster is displayed on the front panel.  I desire to convert that to write that information to a spreadsheet that can be opened with Excel. Please email me at:  [email protected]

  • Problem = Disks arent available in Storage Pools

    Hello, I have two windows server 2012 with 3 disks on each (1 basic and 2 dynamic). One of them (dynamic) is unallocated. When I want to create storage pool I dont see the disks in PHYSICAL DISKS section is Storage Pools. All of disks has more than 4