PL/SQL Callback registered on multi consumer queue takes 6 seconds to call

Registered a PL/SQL callback procedure on multi consumer Queue. if I enqueue message into queue, it takes 6 seconds to call PL/SQL callback procedure.
Why does it takes 6 seconds ?
I believe Queue submits DBMS Job to execute the Callback. I am not sure why it is taking 6 seconds to execute the callback.
are there any configarable parameters to set which allows callbacks to be executed more frequently?

You can try to change jobqueue_interval=1      
This is a scan rate interval (seconds) of job queue parameter.
it is 5 sec by default.
Regards,
Sergey

Similar Messages

  • How to send message to a multi-consumer queue using pl/sql

    How to send message to a multi-consumer queue using pl/sql ? Thanks.
    I tried following, but got an message: no receipient specified.
    DBMS_AQ.ENQUEUE(
    queue_name => 'aqadm.multi_queue',
    enqueue_options => queue_options,
    message_properties => message_properties,
    payload => my_message,
    msgid => message_id);
    COMMIT;
    END;
    /

    Here's two way to enqueue/publish new message into multi-consumer queue.
    (1) Use explicitly declared recipient list
    - Specify "Recipients" by setting recipient_list to messge_properties, before ENQUEUE().
    DECLARE
    recipients DBMS_AQ.aq$_recipient_list_t;
    BEGIN
    recipients(1) := sys.aq$_agent('RECIPIENTNAME',NULL,NULL);
    message_properties.recipient_list := recipients ;
    (2)Or, declare subscriber list permanently. Then you need not to specify recipient list each time you call ENQUEUE().
    begin
    dbms_aqadm.add_subscriber(
    queue_name=>'YOURQUEUE',
    subscriber=> sys.aq$_agent('RECIPIENTNAME', null, null)
    end;
    You can add 1024 local subscriber include maximum 32 remote-queue-consumer to one queue.

  • Notify when message arrives in multi-consumer queue in Oracle 8i

    Hi,
    Is there any way by which we can get notified whenever a new message arrives in the multi-consumer queue ?
    Thanks,
    Shailesh

    Probably a better shot of an answer in the AQ forum.
    Advanced Queueing

  • Retry counts on multi consumer queues in Java

    Is there a way to get the retry count of a message that has been dequeued from a multiconsumer queue? I believe we were able to access the retry count of a message on a single consumer queue, but when dequeuing from a multiconsumer queue, the retry count field is not filled with a value.
    Can this be done?

    Is there a way to get the retry count of a message that has been dequeued from a multiconsumer queue? I believe we were able to access the retry count of a message on a single consumer queue, but when dequeuing from a multiconsumer queue, the retry count field is not filled with a value.
    Can this be done?

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

  • Multi-consumer queue table does not empty

    Hello,
    I must be missing something pretty trivial here but I have setup queue with a queue table where multiple_consumers = true. When I dequeue a message from the queue it is received, but the message is still left in the queue table. When I do a second dequeue I get a end-of-fetch error.
    Currently, there is only one subscriber and the subscriber is specified as the recipient of the message.
    How do I get the messages removed from the queue table?
    DECLARE
        queue_options       DBMS_AQ.ENQUEUE_OPTIONS_T;
        message_properties  DBMS_AQ.MESSAGE_PROPERTIES_T;
        recipients          DBMS_AQ.AQ$_RECIPIENT_LIST_T;
        message_id          RAW(16);
        my_message          MYRESP_T;
    BEGIN
        recipients(1) := sys.aq$_agent('MY_SUBSCRIBER',null,null);
        message_properties.recipient_list := recipients;
        my_message := MYRESP_T('99293','ORCL','TEST');
        DBMS_AQ.ENQUEUE(
            queue_name => 'RESP_Q',
            enqueue_options => queue_options,
            message_properties => message_properties,
            payload => my_message,
            msgid => message_id);
        COMMIT;
    END;
    DECLARE
            r_dequeue_options    DBMS_AQ.DEQUEUE_OPTIONS_T;
            r_message_properties DBMS_AQ.MESSAGE_PROPERTIES_T;
            v_message_handle     RAW(16);
            o_payload                 MYRESP_T;
            v_dynamic_sql           VARCHAR2(4000);
            BEGIN
                r_dequeue_options.wait := DBMS_AQ.NO_WAIT;
                r_dequeue_options.dequeue_mode := DBMS_AQ.REMOVE;
                r_dequeue_options.navigation := DBMS_AQ.FIRST_MESSAGE;
                r_dequeue_options.consumer_name := 'MY_SUBSCRIBER';
                DBMS_AQ.DEQUEUE(
                    queue_name         => 'RESP_Q',
                    dequeue_options    => r_dequeue_options,
                    message_properties => r_message_properties,
                    payload            => o_payload,
                    msgid              => v_message_handle
              commit;
            END;Thanks in advance

    Presumably the message gets left on the Q with a state of PROCESSED? If so then that suggests you have aq_tm_processes explicitly set to 0 (zero) in your spfile/pfile - these background processes clear messages which have been PROCESSED.
    If this is not the case can you post the state of the messages and some more information like version and AQ related parameters?
    Thanks
    Paul

  • Muti Consumer Queue creation

    Hi everyone,
    While creating multi consumer queue, I have encountered with below error:
    SQL> Begin
    2 DBMS_AQADM.Create_Queue_Table(Queue_Table => 'qtbl_NearTime',
    3 Queue_Payload_Type => 'NearTime',
    4 Sort_List => Null,
    5 Multiple_Consumers => True,
    6 Storage_Clause => 'TABLESPACE USERS');
    7 end;
    8 /
    Begin
    DBMS_AQADM.Create_Queue_Table(Queue_Table => 'qtbl_NearTime',
    Queue_Payload_Type => 'NearTime',
    Sort_List => Null,
    Multiple_Consumers => True,
    Storage_Clause => 'TABLESPACE USERS');
    end;
    ORA-08103: object no longer exists
    ORA-06512: at "SYS.DBMS_AQADM_SYS", line 2224
    ORA-06512: at "SYS.DBMS_AQADM", line 58
    ORA-06512: at line 2
    I am working with Oracle 9i. Please advice.
    Many thanks in advance.
    Prabha

    You'll have better-er luck in the AQ forum.
    Advanced Queueing

  • PLSQL Notification on a multi-subscriber queue with sys.aq$_jms_text_messag

    Hi all,
    I am trying to get PLSQL notification working on a multi subscriber queue with sys.aq$jms_text_message as the payload type. The commands to create my queue are as follows:
    dbms_aqadm.create_queue_table(
    queue_table => 'SOA_JMS.RJMTESTxx_QTAB',
    multiple_consumers => true,
    queue_payload_type => 'sys.aq$_jms_text_message'
    dbms_aqadm.create_queue(
    queue_name=>'RJMTESTQ',
    queue_table => 'SOA_JMS.RJMTESTxx_QTAB',
    retention_time => 86400, --Keep processed messages for 24 hours
    max_retries => 3,
    retry_delay => 1
    dbms_aqadm.start_queue('RJMTESTQ');
    dbms_aqadm.add_subscriber(
    queue_name => 'SOA_JMS.RJMTESTQ',
    subscriber => sys.aq$_agent('SUBSCRIP1',null,0),
    rule => NULL,
    transformation => NULL,
    queue_to_queue => FALSE,
    delivery_mode => dbms_aqadm.persistent
    I then create a procedure with the following signature:
    create or replace procedure SOA_JMS.EXCEPTION_QUEUE_NOFIFYCB_1(
    p_context in raw,
    p_reginfo in sys.aq$_reg_info,
    p_descr in sys.aq$_descriptor,
    p_payload in raw,
    p_payloadl in number
    And register it as follows:
    reginfo := sys.aq$_reg_info(
    'SOA_JMS.RJMTESTQ:SUBSCRIP1',
    DBMS_AQ.NAMESPACE_AQ,
    'plsql://SOA_JMS.EXCEPTION_QUEUE_NOFIFYCB_1?PR=0',
    --utl_raw.cast_to_raw('STANDARDJMS')
    HEXTORAW('FF')
    reg_list := sys.aq$_reg_info_list(reginfo);
    dbms_aq.register(reg_list,1);
    The problem is the notifications are not firing as they should be.
    I have done some tracing and found an error:
    Error in PLSQL notification of msgid:BA964334E5A057A4E040C69BAF397075
    Queue :"SOA_JMS"."RJMTESTQ"
    Consumer Name :SUBSCRIP1
    PLSQL function :SOA_JMS.EXCEPTION_QUEUE_NOFIFYCB_1
    : Exception Occured, Error msg:
    ORA-00604: error occurred at recursive SQL level 2
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'EXCEPTION_QUEUE_NOFIFYCB_1'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    This says that the parameters I have for my procedure is wrong. Looking through the documents I think it is something to do with the ?PR=0 used in the register call, but I can’t find any documentation telling me what the required parameters are.
    Does anyone here know?
    Thanks
    Robert

    Hi,
    I have found the solution and I am posting here in case it helps anyone else.
    The paramater names must match the callback not just the types and in/out.
    So the following works:
    create or replace procedure SOA_JMS.EXCEPTION_QUEUE_NOFIFYCB_2(
    context in raw,
    reginfo in sys.aq$_reg_info,
    descr in sys.aq$_descriptor,
    payload in raw,
    payloadl in number
    Robert

  • 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

  • PL/SQL Callback notification with aq$_jms_text_message

    Hi,
    i want to set up a notfication for a pl/sql callback procedure. The message in my queue is enqueued via propagation from another instance. This is my setup (using oracle 10.2.0.3):
    -------- the queue (multiconsumer): --------------
    begin
    dbms_aqadm.create_queue_table(queue_table => 'zmon_evt_in_qtable',queue_payload_type => 'sys.aq$_jms_text_message', multiple_consumers => true);
    dbms_aqadm.create_queue(queue_name => 'zmon_evt_in_queue',queue_table => 'zmon_evt_in_qtable' );
    dbms_aqadm.start_queue( queue_name =>'zmon_evt_in_queue' );
    end;
    -------- the callback-procedure (simply inserting an entry in a table called 'test'): --------------
    create or replace procedure evt_in_callback(
    context IN RAW,
    reginfo IN SYS.AQ$_REG_INFO,
    descr IN SYS.AQ$_DESCRIPTOR,
    payload IN VARCHAR2,
    payloadl IN NUMBER) is
    begin
    insert into test(textfeld) values ('RECEIVED!');
    commit;
    end evt_in_callback;
    -------- the subscriber: --------------
    begin
    dbms_aqadm.add_subscriber(queue_name => 'zmon.zmon_evt_in_queue',
    subscriber => sys.aq$_agent('zmon_evt_in_subscriber',null,null));
    end;
    -------- the notification: --------------
    declare
    reginfo sys.aq$_reg_info;
    reg_list sys.aq$_reg_info_list;
    begin
    reginfo := sys.aq$_reg_info(name => 'zmon.zmon_evt_in_queue:zmon_evt_in_subscriber',
    namespace => DBMS_AQ.NAMESPACE_AQ,
    callback => 'plsql://zmon.evt_in_callback',
    context => HEXTORAW('FF')
    reg_list := sys.aq$_reg_info_list(reginfo);
    DBMS_AQ.REGISTER(reg_list => reg_list,
    reg_count => 1);
    end;
    The callback-procedure is not fired on arrival of a message in the queue. But i can see the the appropriate notfication-entry in sys.reg$.
    Any suggestions why this doesn't work ?
    BTW: can anybody tell me the meaning of the context-Parameter in the aq$_reg_info-Type ? Everybody uses HEXTORAW('FF'), but I don't understand what that means...
    Jens
    Edited by: dschenzl on Jun 4, 2009 11:13 AM

    Finally, it's done.
    The subscriber used in the propagation has to be the notification-subscriber (zmon_evt_in_subscriber). I used another subscriber, which was not registered for notification.
    I found the solution in this thread: Callback trouble from mesage via propagated message.
    Two days filled up with frustrating work - man, how i hate that...
    Greetings to the community,
    Jens

  • Creating job to listen to single consumer queue

    i have code that will allow a job to listen on a queue for a mulitple consumer queue but was wondering how to change it for a single consumer queue. The code i currently have for the multiple conusmer looks like this
         DBMS_SCHEDULER.DEFINE_METADATA_ARGUMENT(
              program_name => 'P_ToDBlocking_Implement'
              ,argument_position => 1
              ,metadata_attribute => 'EVENT_MESSAGE'
         dbms_scheduler.enable('P_ToDBlocking_Implement');
         DBMS_SCHEDULER.CREATE_EVENT_SCHEDULE (
              schedule_name =>      'S_ToDBlocking_Implement'
              ,start_date =>      systimestamp
              ,event_condition => 'corrid=''NOTIFY'''
              ,queue_spec => 'event_msg_q');
    Maybe i am thinking about this wrong how could i get a consumer in a single consumer queue to listen to the queue and process all queue that come in?
    Edited by: user457357 on Sep 12, 2008 12:19 AM

    Why don't you step back, post your full version number, and explain what the business process is. In other words what it is you are trying to achieve.
    When discussing business processes you don't write code. You don't name methodologies. You say things like.
    An end user adds a new row into a table and when that happens I want a job to run .... or something like that.
    Without a context any answer is pure guesswork.

  • AQ (PL/SQL) and JMS access to same queue?

    Hello,
    I have a queue of type JMS-MapMessage for which I want to enqueue messages with the
    AQ PL/SQL API. How would I define it's
    payload since apparently the message content
    cannot be displayed by sqlplus? Alternatively, how can I set my own properties for a JMS-type queue in PL/SQL?
    I'd be glad if I could get to see an example
    of a PL/SQL-ENQUEUE to a JMS-type queue!
    Thanks,
    Karin

    I am using PL/SQL directly to send JMS text messages. Works fine. Here is example:
    DECLARE
    Enqueue_options DBMS_AQ.enqueue_options_t;
    Message_properties DBMS_AQ.message_properties_t;
    Message_handle RAW(16);
    User_prop_array SYS.AQ$_JMS_USERPROPARRAY;
    Agent SYS.AQ$_AGENT;
    Header SYS.AQ$_JMS_HEADER;
    Message SYS.AQ$_JMS_TEXT_MESSAGE;
    Message_text VARCHAR2(100);
    BEGIN
    Agent := SYS.AQ$_AGENT('',NULL,0);
    User_prop_array := SYS.AQ$_JMS_USERPROPARRAY();
    Header := SYS.AQ$_JMS_HEADER( Agent, '', 'aq1', '', '', '', User_prop_array);
    Message_text := 'Message 1 from PL/SQL';
    Message := SYS.AQ$_JMS_TEXT_MESSAGE(Header, LENGTH(Message_text), Message_text, NULL);
    DBMS_AQ.ENQUEUE(queue_name => 'aq1.webapp_queue',
    Enqueue_options => enqueue_options,
    Message_properties => message_properties,
    Payload => message,
    Msgid => message_handle);
    COMMIT;
    END;
    /

  • Internal Error ORA-0600 when creating multiple consumer queue table

    Hi,
    I tried to create a multiple consumer queue table with the following statements:
    exec DBMS_AQADM.GRANT_TYPE_ACCESS ('system');
    create type Change_History_Trigger_Data as object(Col1 VARCHAR2(255), Col2 VARCHAR2(128), Col3 VARCHAR2(255), Col4 TIMESTAMP, Col5 VARCHAR2(64), Col6 VARCHAR2(64), Col7 NUMBER(8));
    Works fine till this stage. But the following statement produces an ORA-0600 internal error message.
    EXEC DBMS_AQADM.CREATE_QUEUE_TABLE ('change_history_queue_tbl','Change_History_Trigger_Data', 'tablespace my_tblspace','ENQ_TIME',TRUE,DBMS_AQADM.TRANSACTIONAL);
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [kcbgtcr_4], [14392], [0], [1], [], [], [], []
    ORA-06512: at "SYS.DBMS_AQADM_SYS", line 2224
    ORA-06512: at "SYS.DBMS_AQADM", line 58
    ORA-06512: at line 1
    I tried creating the same queue table with Multiple consumer = FALSE, and it works fine. But not with multiple consumer = TRUE
    I'm running on Oracle9i Enterprise Edition Release 9.2.0.6.0
    Any possible solutions?

    Problem solved.
    The queue name was too long. Found a post with the same problem.
    Re: Create Queue Table ORA-00600 while dbms_aqadm.create_queue_table
    thanks anyway

  • My app seems to consume an enormous amount of API calls every day? Please help!

    I am tired and sad and frustrated here, and feel like a total moron. I am very sorry if my post is too long and not very well put together, but im beggin anyone with some experience here to please give me some advice.
    I am currently testing out a app I have created to let people add events, search for events, comment on and get notified about changes in events they have signed up for. I have used Azure Mobile Service for this, and it all seems to have worked well. This is
    mostly a learning app for me, since I am very much a noob.
    Now we are nearing launch of the app, and I have started to look at the numbers in Azure. I am on the free version right now, where 16k api calls a day are free (will move to priced tier on launch) - but the numbers look completely off the hook here!
    Every day 2-3 devices seem to run up 600-700 API calls. I do run the testing app hard, of course, but I guess some user might do that to.
    So - 4% of the daily free calls are consumed by 3 devices. That means 33 users could fill the quota, and the first paid tier only gives room for 300 users.
    Am I reading something wrong here? Is my app then not viable? I think it, even with my noobness, has a potentil to get a few thousand users. Does that mean Im gonna have to go to the top tier? Because I can not afford that.
    Over to the stack part of the question:
    I log the user in, I create the tables, and then when they hit search I do something like this:
    eventenItemList = await eventenTable.Take (200).Where (item => item.Dateandtimeend >= DateAndTimeIn).
    Where (item => item.Dateandtime <= DateAndTimeInEnd).
    Where (item => item.Fylke == fylke).
    Where (item => item.Pris <= MaksPris).ToListAsync ();
    I would expect that to be a single API-call, but it seems to run up tens of calls - just there? How is that possible?
    When the user is not in the app, I run a background service in Android that goes through a local db of events the user has created and then checks against the db for any changes to them. I do that like this:
    var table = db.Table<MyEvents> ();
    foreach (var e in table) {
    eventenItemList = await eventenTable.Where (item => item.Id == e.EventId).ToListAsync ();
    if (eventenItemList.Count == 0) {
    } else {
    //I here notify the user that something new is up - and what it is. Time changed, comments or whatever.
    Im guessing this is stupid of me, since it probably makes one API call for each loop here? But in the numbers it just seems to do 2 calls - like I expect it to.
    I am horribly lost here, people. I ran around a hundred random clicks around the app this evening - and racked up over 1500 api calls. I have been cold sweating since that. Any advice or info about how this api call-system works would be very much appreciated.

    Replying here in case someone else stumbles upon this post. This question was handled on SO:http://stackoverflow.com/questions/28685710/app-consumes-an-extreme-amount-of-api-calls-in-azure

Maybe you are looking for