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

Similar Messages

  • Message Driven bean: message always removed from queue

    We use MDB to dequeue messages from database queue (AQ) and want to handle errors: if the transaction rolls back, message should have retry_count updated and after defined retries should move to exception queue.
    The problem is, that with all combinations of transactions settings, the message is removed from queue before onMessage is called. If I use Container managed transactions with Mandatory transaction attribute, call to setRollbackOnly fails with message "java.lang.IllegalStateException: Cannot call setRollbackOnly() current thread is NOT associated with a transaction."
    How can I write a MDB, which can commit or rollback message depending on whether exception is or is not thrown? I use JDev 10.1.3.
    Thanks,
    Viliam
    Here are my files:
    ejb-jar.xml:
    <?xml version = '1.0' encoding = 'windows-1250'?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
      <enterprise-beans>
        <message-driven>
          <description>Message Driven Bean</description>
          <display-name>SendSMSBean</display-name>
          <ejb-name>SendSMSBean</ejb-name>
          <ejb-class>sk.transacty.cc.ejb.SendSMSBeanBean</ejb-class>
          <transaction-type>Container</transaction-type>
          <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
          <message-driven-destination>
            <destination-type>javax.jms.Queue</destination-type>
          </message-driven-destination>
          <resource-ref>
            <res-ref-name>jdbc/CCDataSource</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
          </resource-ref>
        </message-driven>
      </enterprise-beans>
      <assembly-descriptor>
        <container-transaction>
          <method>
            <ejb-name>SendSMSBean</ejb-name>
            <method-name>*</method-name>
          </method>
          <trans-attribute>Mandatory</trans-attribute>
        </container-transaction>
      </assembly-descriptor>
    </ejb-jar>orion-ejb-jar.xml:
    <?xml version = '1.0' encoding = 'windows-1250'?>
    <!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 max-instances="1" name="SendSMSBean" connection-factory-location="java:comp/resource/jmsAQ/QueueConnectionFactories/aqQue" destination-location="java:comp/resource/jmsAQ/Queues/msg_queue" listener-threads="1" min-instances="0"/>
      </enterprise-beans>
      <assembly-descriptor>
        <default-method-access>
          <security-role-mapping impliesAll="true" name="<default-ejb-caller-role>"/>
        </default-method-access>
      </assembly-descriptor>
    </orion-ejb-jar>

    As far as I know XMLType JMS messages are not supported when using OJMS. They might be for OC4J 10.1.3, but I thought it's an AQ limitation rather than an OC4J one.. To be sure you might just log a TAR on Metalink.
    hth,
    Bastiaan

  • 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 ;)

  • 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 ;)

  • 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

  • Removing Exception Handling Causes Compiler Error

    I am very new to Java. I have a background in other programming languages including Ruby. I am in need of a convenient means to parse XML code. I picked up the code shown at the end of this message on the Internet. In its original form, it works perfectly. I experimented by trying to comment out the try block as you can see. I was surprised to find that in that form it wouldn't compile. In essence, I thought what I was doing was simply removing exception handling. I figured that since the code worked and there were no exceptions being thrown, it would work just fine for experimentation purposes. (I understand that I would not want to do this in production mode.) Can someone please explain to me why removing the exception handling causes the program to fail to compile?
    Thanks for any input.
    ... doug
    /* Experimental Code */
    /* http://www.mkyong.com/java/how-to-read-xml-file-in-java-dom-parser/ */
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    import org.w3c.dom.Document;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Node;
    import org.w3c.dom.Element;
    import java.io.File;
    public class ReadXMLFile {
    public static void main(String argv[]) {
    try {
    File fXmlFile = new File("ReadXMLFile.xml");
    DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
    Document doc = dBuilder.parse(fXmlFile);
    doc.getDocumentElement().normalize();
    System.out.println("Root element :" + doc.getDocumentElement().getNodeName());
    NodeList nList = doc.getElementsByTagName("staff");
    System.out.println("-----------------------");
    for (int temp = 0; temp < nList.getLength(); temp++) {
    Node nNode = nList.item(temp);     
    if (nNode.getNodeType() == Node.ELEMENT_NODE) {
    Element eElement = (Element) nNode;
    System.out.println("First Name : " + getTagValue("firstname",eElement));
    System.out.println("Last Name : " + getTagValue("lastname",eElement));
    System.out.println("Nick Name : " + getTagValue("nickname",eElement));
    System.out.println("Salary : " + getTagValue("salary",eElement));
    } catch (Exception e) {
    e.printStackTrace();
    private static String getTagValue(String sTag, Element eElement){
    NodeList nlList= eElement.getElementsByTagName(sTag).item(0).getChildNodes();
    Node nValue = (Node) nlList.item(0);
    return nValue.getNodeValue();
    }

    877757 wrote:
    I figured that since the code worked and there were no exceptions being thrown, it would work just fine for experimentation purposes. The compiler doesn't know that your code works. It only knows that some method you call can throw some checked exception, and it requires you to catch it or declare that you don't.

  • 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.

  • 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.

  • 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....

  • Exception queue

    How can i tell what caused a message to go to the exception queue.
    For instance say i have a message that has reached its expiration period and goes to the exception queue how would i be able to find out that the reason it went to the exception queue is because it had expired?
    version 10g
    select * from AQ$<queue_table> will show the reason why the message went to the exception queue.
    Edited by: user457357 on May 6, 2009 5:37 PM

    When you define a queue table and queue, there will be an exception queue there automatically - you can't avoid it being created.

  • Browsing Exception Queue

    Hi there,
    I have a JMS messaging arquitecture using the OJMS provider. I created one queue and as I've read, automatically an exception queue was created. I'm trying to browse that exception queue and list the messages in, but despite there are messages, the method getEnumeration() does not retrieve me anything. Anyone knows why?
    I'm using Oracle 10.1.0.1.
    Thanks in advance.
    Carolina Antón
    carolina.anton_at_gmail.com

    Hi Henry,
    Unless your concern is about Microsoft scheduling solution "PROJECT", you should post your thread in the appropriate forum in order to have an helpful hand.
    Regards.
    Guillaume Rouyre - MBA, MCP, MCTS

  • How to automatically empty the exception queue?

    Hi.
    I have an exception queue that contains over 140000 messages. Is there some way of making Oracle empty this queue on a regular basis? I have set "dequeue" to "disabled" because I am not interested in this queue's messages, but the queue just continues to grow larger and larger...
    Any help would be very appreciated!
    Regards,
    -Christer

    Is this really not possible? Do I have to make a trigger on the table or manually delete it to stop growing?

  • 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 ;)

  • How to purge exception queue

    I would like to write a store procedure to purge exception queue according to queue and corr_id, but the problem is corr_id needs to be passed as a variable.
    declare
              po_t dbms_aqadm.aq$_purge_options_t;
              begin
              po_t.block := FALSE;
              dbms_aqadm.purge_queue_table(queue_table => 'hari_bpfqueuetable',
              purge_condition => 'queue = ''AQ$_HARI_BPFQUEUETABLE_E''',
              purge_options => po_t);
              end;
    The above script works fine, but once I add corr_id to purge condition as blow, it gives error.Can anybody help on that? Thanks in advance
    declare
              po_t dbms_aqadm.aq$_purge_options_t;
              begin
              po_t.block := FALSE;
              dbms_aqadm.purge_queue_table(queue_table => 'hari_bpfqueuetable',
              purge_condition => 'queue = ''AQ$_HARI_BPFQUEUETABLE_E'' and corr_id = ''???''',
              purge_options => po_t);
              end;

    user477534,
    Just a suggestion.
    What about concatenation?
    dbms_aqadm.purge_queue_table(queue_table => 'hari_bpfqueuetable',
    purge_condition => 'queue = ''AQ$_HARI_BPFQUEUETABLE_E'' and corr_id = ''' || YOUR_VAR || '''',
    purge_options => po_t);Good Luck,
    Avi.

  • Getting EJBLocal.remove Exception

    Hi All,
    I am trying to remove using local object.remove method in my session bean. But getting the following Exception.
    TransactionRolledBackException : java.ejb.EJBLocal.remove Exception caused by ......................
    Illegal Argument Exception...........
    I am using Entity Bean and i have an entity Goal containing composite key. And I have set the setters for all fields in this entity except the two primary keys.
    While the getters for these to primary keys are set as local.
    What is the reason behind this error...........
    Appreciate any help......

    Can you post the actual stack trace? Thanks.
    --ken
    Kenneth Saks
    J2EE SDK Team
    SUN Microsytems

Maybe you are looking for