Plsql callback (dbms_aq.register) stops working

we had, for quite a while, a working situation where a incoming message notifies a plsql procedure, which dequeues and handles the message, resulting in a response message in a different queue
the queue has one subscriber and through dbms_aq.register I registered a plsql callback and all worked fine for about a year
suddenly this stopped working - messages aren't dequeued anymore - for no apparent reason (nothing changed in this part of the database)
I already dropped and recreated the queue table, queues, subscriptions and registered the plsql callback again, but no results
does anyone have a clue where to look (specific sys tables/views, database parameters etc) because I am running out of ideas...
we are running the 10.2.0.1.0 database
greatings
Jan

Jan,
The EMNO (Event Monitor) process is responsible to execute the AQ notifications, in this case your pl/sql callback. This may or may not be your problem. I'm not sure how much help this link will be but it covers Event Monitor issues for various versions of Oracle. https://metalink.oracle.com/metalink/plsql/f?p=130:14:2721106654994549115::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,105067.1,1,1,1,helvetica
Jason

Similar Messages

  • Are  DBMS_AQ.REGISTER callbacks functional on Oracle XE?

    I'm trying to get callbacks for oracle streams to work on ORACLE XE. I'd like to be able to perform a
    demo of using JMS to fire a pl/sql procedure. There are a million other ways of doing this, I'm sure.
    The idea is to enqueue a message and have the callback fire off. The call back is created using DBMS_AQ.REGISTER
    All I seem to get is the messages in thetopic/queue, and they don't go anywhere, my procedure is not called.
    I fixed up my XE instance to support JMS data types.
    Below is the code that I've used so far. The aq_tm_processes value is 1 and the
    job_queue_processes is 10. I've called START_TIME_MANAGER for what that's worth.
    I'm missing something or XE can't do this, any help appreciated.
    =================================
    grant connect, resource, aq_administrator_role to jmsuser identified by jmsuser;
    grant execute on sys.dbms_aqadm to jmsuser;
    grant execute on sys.dbms_aq to jmsuser;
    grant execute on sys.dbms_aqin to jmsuser;
    grant execute on sys.dbms_aqjms to jmsuser;
    exec dbms_aqadm.grant_system_privilege('ENQUEUE_ANY','jmsuser');
    exec dbms_aqadm.grant_system_privilege('DEQUEUE_ANY','jmsuser');
    CREATE ROLE my_aq_adm_role;
    grant connect, resource, aq_administrator_role to my_aq_adm_role;
    CREATE ROLE my_aq_user_role;
    GRANT aq_user_role to my_aq_user_role ;
    GRANT my_aq_user_role to jmsuser;
    dbms_aqadm.create_queue_table(
    queue_table => 'test_topic_table',
    comment => 'test topic_table',
    multiple_consumers => TRUE,
              compatible => '9.0.0',
    Queue_payload_type => 'SYS.AQ$_JMS_TEXT_MESSAGE',
    message_grouping => DBMS_AQADM.TRANSACTIONAL );
    DBMS_AQADM.CREATE_QUEUE (Queue_name => 'jmsuser.test_topic',
    queue_type => DBMS_AQADM.NORMAL_QUEUE,
    max_retries => 3,
    retry_delay => 3,
    retention_time => 0,
    comment=>'test queue',
    auto_commit =>TRUE,
    Queue_table => 'jmsuser.test_topic_table');
    DBMS_AQADM.START_QUEUE (Queue_name => 'jmsuser.test_topic');
    DBMS_AQADM.ADD_SUBSCRIBER (
    queue_name => 'test_topic',
    subscriber => SYS.AQ$_AGENT(
    'test_topic_subscriber',
    'jmsuser.test_topic',
    NULL )
    DBMS_AQ.REGISTER (
    SYS.AQ$_REG_INFO_LIST(
    SYS.AQ$_REG_INFO(
    'test_topic:test_topic_subscriber',
    DBMS_AQ.NAMESPACE_AQ,
    'plsql://JMSUSER.TOPIC_CALLBACK',
    HEXTORAW('FF')
    1
    create or replace PROCEDURE TOPIC_CALLBACK
    context RAW,
    regInfo SYS.AQ$_REG_INFO,
    descr SYS.AQ$_DESCRIPTOR,
    payload SYS.AQ$_JMS_TEXT_MESSAGE,
    -- payload raw,
    payload1 number )
    AS
    r_dequeue_options DBMS_AQ.DEQUEUE_OPTIONS_T;
    r_message_properties DBMS_AQ.MESSAGE_PROPERTIES_T;
    v_message_handle RAW(16);
    my_info VARCHAR2(4000);
    o_payload SYS.AQ$_JMS_TEXT_MESSAGE;
    BEGIN
    r_dequeue_options.msgid := descr.msg_id;
    r_dequeue_options.consumer_name := descr.consumer_name;
    DBMS_AQ.DEQUEUE( queue_name => descr.queue_name,
    dequeue_options => r_dequeue_options,
    message_properties => r_message_properties,
    payload => o_payload,
    msgid => v_message_handle );
    o_payload.get_text(my_info) ;
    INSERT
    INTO jmsuser.aq_info_table
    MESSAGE
    VALUES
    'Message ['
    || trim(my_info)
    || '] '
    || 'dequeued at ['
    || TO_CHAR( SYSTIMESTAMP, 'DD-MON-YYYY HH24:MI:SS.FF3' )
    || ']'
    COMMIT;
    END TOPIC_CALLBACK;

    I'm trying to get callbacks for oracle streams to work on ORACLE XE. I'd like to be able to perform a
    demo of using JMS to fire a pl/sql procedure. There are a million other ways of doing this, I'm sure.
    The idea is to enqueue a message and have the callback fire off. The call back is created using DBMS_AQ.REGISTER
    All I seem to get is the messages in thetopic/queue, and they don't go anywhere, my procedure is not called.
    I fixed up my XE instance to support JMS data types.
    Below is the code that I've used so far. The aq_tm_processes value is 1 and the
    job_queue_processes is 10. I've called START_TIME_MANAGER for what that's worth.
    I'm missing something or XE can't do this, any help appreciated.
    =================================
    grant connect, resource, aq_administrator_role to jmsuser identified by jmsuser;
    grant execute on sys.dbms_aqadm to jmsuser;
    grant execute on sys.dbms_aq to jmsuser;
    grant execute on sys.dbms_aqin to jmsuser;
    grant execute on sys.dbms_aqjms to jmsuser;
    exec dbms_aqadm.grant_system_privilege('ENQUEUE_ANY','jmsuser');
    exec dbms_aqadm.grant_system_privilege('DEQUEUE_ANY','jmsuser');
    CREATE ROLE my_aq_adm_role;
    grant connect, resource, aq_administrator_role to my_aq_adm_role;
    CREATE ROLE my_aq_user_role;
    GRANT aq_user_role to my_aq_user_role ;
    GRANT my_aq_user_role to jmsuser;
    dbms_aqadm.create_queue_table(
    queue_table => 'test_topic_table',
    comment => 'test topic_table',
    multiple_consumers => TRUE,
              compatible => '9.0.0',
    Queue_payload_type => 'SYS.AQ$_JMS_TEXT_MESSAGE',
    message_grouping => DBMS_AQADM.TRANSACTIONAL );
    DBMS_AQADM.CREATE_QUEUE (Queue_name => 'jmsuser.test_topic',
    queue_type => DBMS_AQADM.NORMAL_QUEUE,
    max_retries => 3,
    retry_delay => 3,
    retention_time => 0,
    comment=>'test queue',
    auto_commit =>TRUE,
    Queue_table => 'jmsuser.test_topic_table');
    DBMS_AQADM.START_QUEUE (Queue_name => 'jmsuser.test_topic');
    DBMS_AQADM.ADD_SUBSCRIBER (
    queue_name => 'test_topic',
    subscriber => SYS.AQ$_AGENT(
    'test_topic_subscriber',
    'jmsuser.test_topic',
    NULL )
    DBMS_AQ.REGISTER (
    SYS.AQ$_REG_INFO_LIST(
    SYS.AQ$_REG_INFO(
    'test_topic:test_topic_subscriber',
    DBMS_AQ.NAMESPACE_AQ,
    'plsql://JMSUSER.TOPIC_CALLBACK',
    HEXTORAW('FF')
    1
    create or replace PROCEDURE TOPIC_CALLBACK
    context RAW,
    regInfo SYS.AQ$_REG_INFO,
    descr SYS.AQ$_DESCRIPTOR,
    payload SYS.AQ$_JMS_TEXT_MESSAGE,
    -- payload raw,
    payload1 number )
    AS
    r_dequeue_options DBMS_AQ.DEQUEUE_OPTIONS_T;
    r_message_properties DBMS_AQ.MESSAGE_PROPERTIES_T;
    v_message_handle RAW(16);
    my_info VARCHAR2(4000);
    o_payload SYS.AQ$_JMS_TEXT_MESSAGE;
    BEGIN
    r_dequeue_options.msgid := descr.msg_id;
    r_dequeue_options.consumer_name := descr.consumer_name;
    DBMS_AQ.DEQUEUE( queue_name => descr.queue_name,
    dequeue_options => r_dequeue_options,
    message_properties => r_message_properties,
    payload => o_payload,
    msgid => v_message_handle );
    o_payload.get_text(my_info) ;
    INSERT
    INTO jmsuser.aq_info_table
    MESSAGE
    VALUES
    'Message ['
    || trim(my_info)
    || '] '
    || 'dequeued at ['
    || TO_CHAR( SYSTIMESTAMP, 'DD-MON-YYYY HH24:MI:SS.FF3' )
    || ']'
    COMMIT;
    END TOPIC_CALLBACK;

  • Help. plsql callback of a jms message. Not working

    had examples of AQ working in my 10g r2 database using simple queues.
    however my problem is I want to use a jms queue. I can enqueue onto it all the time but it never notifies my subscriber and I am drawing a blank. Can anyone help me? Thanks in advance.
    Using the example below the data just sits in the queue for ever.
    Here is the example assuming installing into oracle user : demo.
    begin
    dbms_aqadm.create_queue_table
    (Queue_table => 'jms_message'
    ,Queue_payload_type => 'sys.aq$_jms_message'
    ,multiple_consumers => true
    ,comment => 'demo queue table'
    dbms_aqadm.create_queue
    (queue_name => 'jms_message_request',
    queue_table => 'jms_message');
    dbms_aqadm.start_queue
    (queue_name => 'jms_message_request');
    end;
    drop table demo_data;
    drop sequence s_demo_data_id;
    create table demo_data
    (id number(10)
    ,stuff varchar2(2000)
    create sequence s_demo_data_id;
    create or replace procedure plsql_subscriber
    (context raw,
    reginfo sys.aq$_reg_info,
    descr sys.aq$_descriptor,
    payload sys.aq$_jms_message,
    payloadl number
    ) is
    dequeue_options dbms_aq.dequeue_options_t;
    message_properties dbms_aq.message_properties_t;
    message_handle RAW(16);
    message sys.aq$_jms_message;
    v_stuff demo_data.stuff%type;
    begin
    dequeue_options.msgid := descr.msg_id;
    dequeue_options.consumer_name := descr.consumer_name;
    dbms_aq.dequeue(queue_name => 'JMS_MESSAGE_REQUEST',
    dequeue_options => dequeue_options,
    message_properties => message_properties,
    payload => message,
    msgid => message_handle);
    v_stuff:=
    'Type: ' || message.get_type ||
    ' UserId: ' || message.get_userid ||
    ' AppId: ' || message.get_appid ||
    ' GroupId: ' || message.get_groupid ||
    ' GroupSeq: ' || message.get_groupseq;
    insert into demo_data values ( s_demo_data_id.nextval,v_stuff);
    commit;
    end;
    -- ADD plsql SUBSCRIBERS AND REGISTER THE QUEUES
    prompt -- create subscriber
    declare
    o_agent sys.aq$_agent;
    begin
    o_agent:=new sys.aq$_agent
    (name => 'SUBSCRIBER1'
    ,address => null
    ,protocol=> null
    dbms_aqadm.add_subscriber
    (queue_name => 'jms_message_request'
    ,subscriber => o_agent
    ,rule => null
    end;
    declare
    t_reg_list sys.aq$_reg_info_list;
    o_reg_info sys.aq$_reg_info;
    begin
    -- note as this is a multi consumer q we need the name to be in the format schema.queue:consumer_name
    o_reg_info:=new sys.aq$_reg_info
    (name =>'demo.jms_message_request:subscriber1'
    ,namespace =>dbms_aq.namespace_aq -- ie AQ streams
    ,callback => 'plsql://demo.plsql_subscriber'
    ,context => hextoraw('FF')
    t_reg_list:=new sys.aq$_reg_info_list();
    t_reg_list.extend();
    t_reg_list(1):=o_reg_info;
    /* -- note this suffers from oracle bug : 'count' is a reserved word and use of such a keyword causes this error
    -- when using a procedure call in PL/SQL.
    -- This is resolved by the fix for Bug 3966513 which will be in 10g Release 2.
    -- see below for fix
    dbms_aq.register
    (reg_list => t_reg_list
    ,count => 1);
    dbms_aq.register(t_reg_list,1);
    commit;
    end;
    DECLARE
    id pls_integer;
    agent sys.aq$_agent;
    map_message sys.aq$_jms_map_message;
    message sys.aq$_jms_message;
    enqueue_options sys.dbms_aq.enqueue_options_t;
    message_properties sys.dbms_aq.message_properties_t;
    msgid raw(16);
    BEGIN
    agent:= new sys.aq$_agent
    (name=>'producer' -- name of the producer
    ,address=>null -- return address
    ,protocol=>0 -- 0 default
    -- Consturct a empty map message object
    map_message := sys.aq$_jms_map_message.construct;
    -- Shows how to set the JMS header
    map_message.set_replyto(agent);
    map_message.set_type('myType');
    map_message.set_userid('me');
    map_message.set_appid('plsql_enq');
    map_message.set_groupid('myGroup');
    map_message.set_groupseq(1); -- is this messing it up
    -- Shows how to set JMS user properties
    id := map_message.clear_body(-1);
    map_message.set_string(id, 'STRING', 'Hello World!');
    map_message.flush(id);
    sys.aq$_jms_map_message.clean_all();
    message := sys.aq$_jms_message.construct(map_msg=>map_message);
    dbms_aq.enqueue(
    queue_name => 'jms_message_request',
    enqueue_options => enqueue_options,
    message_properties => message_properties,
    payload => message,
    msgid => msgid);
    commit;
    end;
    /

    Update:
    If I go to network in the dashboard it DOES see the airport but will not let me connect. I keep getting "connection failed." I know I have the right password ect. but no idea why it will not let me join.
    Do I need to get the paperclip out and reset the airport???

  • HT1533 my sound has stopped working i have speakers plugged in but computer doesnt register or recognize them. the volume is on mute and grayed out ...will not let me change,what can i do to fix this problem....i have tried unplugging and plugging back in

    my sound has stopped working i have speakers plugged in but computer doesnt register or recognize them. the volume is on mute and grayed out ...will not let me change,what can i do to fix this problem....i have tried unplugging and plugging back in and reset and headphones...nothing works..how do i get my sound back?

    OS X Mountain Lion: If you can’t hear sound from your speakers
    Read the "If you’re trying to listen through external speakers" section.

  • My wife just bought her first Iphone  a 4s a fwe months ago, its secondhand a few months ago but it came with ios7.  Now the phone has stopped working and is asking to be registered with a Developer Program portal  any ideas how I can fix this for her?

    my wife just boughtnher first apple an iphone4s she got it secondhand about last july , it came with ios7 which had not been released but today its stopped working and asking to be registered with a developers program,  how can I restore her phone and hopefullykeep her current data. Please keep your answer simple we are not it people thanks.

    Well, you have your answer perhaps as to why the phone was being sold in the first place - rather than being a registered developer, the previous owner probably downloaded and installed an illegal copy of iOS 7 beta on the phone and it has now bricked the phone.  Some people did this and of course they could not wait to get their hands on iOS 7, but now it has been released officially, everybody moans.
    The only thing you can do is try resetting the phone again.  Connect it to iTunes and install iOS 7.0.2 and restore it as new and see if that works.  This might help the phone but will not preserve data.
    If it still won't work, then I suggest that you confront the previous owner of the phone and return it for a full refund and start again, but this time buy the phone from a legitimate source.

  • TS1717 I have today purchased an iPod nano. I am using Widows 7. When I try to register the iPod I get the message that " iTunes has stopped working" I have reinstalled iTunes with the same result. Where do I go from here?  Brian.

    I have today purchased an iPod nano (gen 6); I use Windows 7. Am trying to register my iPod but each time I submit required info I get the message "iTunes has stopped working". I have reinstalled iTunes with same result. Where do I go from here?
    Brian

    Hello notime4,
    The article linked below details some useful troubleshooting steps that can help stabilize iTunes on your computer.
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/TS1717
    Cheers,
    Allen

  • TS3376 I had my iphone set up to be tracked as registered with iCloud and it had been using it for a year one day it said no devices registered and stopped working why???

    I had my iphone set up to be tracked as registered with iCloud and it had been using it for a year today it said no devices registered and stopped working even though i tracked the selected iphone 4 device an hour earlier why did it do this???

    So basically the phone I was tracking was working an hour earlier it had no signal at times when it did pick up a signal it located it easily but an hour later the message came up no devices registered when my friend returned home I Checked the device I was tracking to make sure find my iphone was on but it was off and my friend didnt turn it off so my question is why did it turn itself off???
    Confused?

  • Registered plsql callback not notified

    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
    Production system: Two-instance RAC
    Testing system: Single instance
    I have a PL/SQL procedure registered through DBMS_AQ.REGISTER to be notified when messages come in on a particular queue. While it works in test, it is never called in production.
    I have checked that the messages are enqueued correctly. There are no messages in the associated exception queue. There do not seem to be any trace files associated with this failed notification.
    There are messages in the exception queue for AQ_SRVNTFN_TABLE. The USER_DATA for these messages seems to be the procedure which I registered.
    What can I do next?

    Looks like we found it...
    This is TEST:
    create or replace
    TYPE     aq$_descriptor AS OBJECT (
            queue_name       VARCHAR2(65),                -- name of the queue
            consumer_name    VARCHAR2(30),                -- name of the consumer
            msg_id           RAW(16),                     -- message identifier
            msg_prop         msg_prop_t,                  -- message properties
            gen_desc         sys.aq$_ntfn_descriptor)     -- generic descriptorThis is PROD:
    create or replace TYPE     aq$_descriptor AS OBJECT (
            queue_name       VARCHAR2(30),                -- name of the queue
            consumer_name    VARCHAR2(30),                -- name of the consumer
            msg_id           RAW(16),                     -- message identifier
            msg_prop         msg_prop_t)                  -- message properties
    ALTER TYPE     aq$_descriptor
      ADD ATTRIBUTE(gen_desc sys.aq$_ntfn_descriptor)
      CASCADEIn c1001000.sql, aq$_srvntfn_message.queue_name is upped to 65 chars, but aq$_descriptor is left alone.

  • My iPhone 3GS just stopped working this morning. It tells me activation is required and that I need to plug it into itunes. When I try to plug it into itunes it doesn't register that I have anything plugged in.

    My phone stopped working this morning, it tells me that activation is requires and that I need to plug it into ITunes. However when I try to plug it into my computer nothing happens, it will only show the apple symbol when I plug it into an outlet. Does anyone know what I can do to get it to plug into itunes or activate it again?

    Please plug the iPhone with the original doch-connector & USB cable into a USB plug in the computer (directly into the computer) and restart iTunes. It should register. Please do not stop the registration!!! You may need to press power on iPhone.
    Is the iPhone jailbroken?

  • Quicktime player has stopped working in Vista after registering Pro key

    I have installed QT player as part of the itunes QT package today and it appeared to work untill I registered it with my pro key which also enabled the additional function, but when i closed and restarted I get message "Quicktime player has stopped working...etc" and it never opens. I have repaired, reinstalled QT, reinstalled QT and itunes, all to no effect. I then restored to before QT and i tunes installation then reinstalled QT and itunes and it works again !, but only until I enter pro key and exit and restart. There is also an issue with the addin in internet explorer which also does not work, but generates a string of error messages when i try to play movies. Oddly enough, if I run QT as administrator it works, and if it seems the QT browser addin works in Firefox (when run off memory stick)
    I'm completly confused and frustrated; anyone any ideas please, I'm running Vista SP1 on Dell XPS420 Quad core 2.4 Gig 4MB RAM

    Have looked in this a little further and the problem may not be todo with the Pro registration as having restored to a point before QT installation several times I now find that when reinstalled QT works the first time you run it but once closed it will not reopen. However if I run as administrator it runs OK, also if i turn off User Account Control it works OK; this true for the Internet Explorer addin as well as QT player and even the picture viewer. The picture viewer actually reports an error "Quicktime has failed to intialize Error # - 2095". One final observation is that the QT addin works OK without user account control switched off in Firefox 3 b5.
    Something is amiss I suspect with permissions/security and i would rather not operate with User Account Control off.
    Much appreciate anyones advise on this it is driving me mad

  • Re-register notice from Adobe made CS2.3 stop working

    A couple of days ago I received an update notice from Adobe to re-register my Creative Suite CS2.3 serial number or my suite would stop working. I followed the link and re-registered my legal serial number and it said successful. Now none of my Creative Suite will open. I've had my tech guy working on the issue and it appears to be something Adobe has done and not an issue with my computer. Anyone know how to fix this? I hope this isn't an attempt by Adobe to force me to upgrade my Creative Suite.

    For starters CS2 is totally unsupported under Leopard and Snow Leopard. Additionally, it's not Intel native which adds a new level of problems. Finally, CS2 is the earliest version eligible for upgrade pricing so despite your conspiracy theories, you should give strong consideration to doing so. Amazon has a pretty good deal on the CS2 to CS5 upgrade here: http://amzn.to/gyx0tZ
    All that said, if you still want to stick with this combination (which I highly recommend you do not) have a read through this and see if it doesn't help: http://indesignsecrets.com/acrobat-update-causing-problems-for-mac-indesign-and-illustrato r-users.php
    Bob

  • Dequeuing multiples messages in a PLSQL CallBack

    Hi all:
    I would like to dequeue multiples messages in a PLSQL CallBack for performance reason.
    Everything works fine, but I see that Oracle AQ sent the rest of the notifications messages to the callback independent of an empty queue.
    I added a table lock to prevent parallel execution of the Call Back, but when this resource lock is freed, many oracle processes are started in parallel to process the rest of the notification pending.
    Here my Call Back:
      static procedure msgCallBack(context  IN  RAW,
                                   reginfo  IN  SYS.AQ$_REG_INFO,
                                   descr    IN  SYS.AQ$_DESCRIPTOR,
                                   payload  IN  RAW,
                                   payloadl IN  NUMBER) is
        dequeue_options     dbms_aq.dequeue_options_t;
        message_properties  dbms_aq.message_properties_t;
        message_handle      RAW(16);
        message             lucene_msg_typ;
        prefix              VARCHAR2(4000) := utl_raw.cast_to_varchar2(context);
        rcount              NUMBER;
        begin
          EXECUTE IMMEDIATE 'LOCK TABLE '||prefix||'$T IN EXCLUSIVE MODE';
          EXECUTE IMMEDIATE 'select count(*) from '||prefix||'$QT' INTO rcount;
          if (rcount >0) then
            sync(prefix); -- dequeue all messages
          end if;
          commit;
      end msgCallBack;
    sync(prefix) dequeues all messages pending on the queue, if statement is to avoid non-necessary call to sync procedure on an empty queue.
    Is there any way to clean up all pending notification inside a Call Back?
    I'll appreciate any help on this topic.
    Best regards, Marcelo.

    Hi Marcelo,
    If you do a dequeue with dequeue_options.wait=dbms_aq.forever it will wait until the message is enqueued. It is not consuming (much) cpu-time. AQ solves this under water for you by polling the queue-table.
    If you schedule this job with an interval of say 10secs (using dbms_job or dbms_scheduler) the job will come up after database startup. The only other option is to start the process using a sqlplus or similar tool. But since the dequeueu will wait for the next incomming message the sqlplus session will halt. Using the jobscheduler in the database causes the job to be run in a session with in the database (so you get your session freed) and after a database restart, the job will come up.
    You can use this with a normal default queue. You should not use the dequeue_option visibility=dbms_aq.immediate, because then you loose your "transactional grouping".
    I'd advise to either
    . not use wait=dbms_aq.forever, but a reasonable amount of wait time and then let your job run to complete. Then the job scheduler can reschedule the process in an interval of for example 1 - 10 sec.
    . do use wait=dbms_aq.forever but define a kind of "suicide pill". That is a message that you give a special meaning for example a correlation-id with a special text, and the highest possible priority. You have to make sure that it by passes every other message-priority. If the process gets this message it has to stop.
    The reason I advise eiter of them is that you want a means of stopping the process in a neat fashion. For example for maintenance purposes. I personally have a slight prefrence for the first option, because when you remove the job from the jobscheduler you may trust that the job stops. For the second option you have to rely on the process receiving and consuming the suicide pill. But it is manner of taste: the second option is also a good way. The first option introduces a possible latency since the job is regularly not executing for a few seconds. The second gives the best response I think.
    Regards,
    Martien

  • PL/SQL notification / DBMS_AQ.REGISTER

    There have been a number of discussions on this forum about PL/SQL notifications. I'm running
    into the same problem:
    - create the notification procedure
    - register the procedure
    - enqueue a message
    - NOTHING HAPPENS
    It seems that the notification procedure is not executed.
    The discussions on this forum were all inconclusive. Did anybody get this to work? If yes, can
    you post an example (i.e. a script that creates the queue, create the procedure, registers the
    procedure and enqueues a message)?
    Is there a table/view that contains the registrations?
    What system parameters are relevant to this functionality?
    Where are errors in calling the notification procedure logged?

    There are few problems that I can see with your code.
    Your callback procedure header should look like this:
    create or replace procedure QCallBack1(
    context RAW,
    reginfo SYS.AQ$_REG_INFO,
    descr SYS.AQ$_DESCRIPTOR,
    payload VARCHAR2,
    payloadl NUMBER) is
    BEGIN
    END ;
    And your callback notification does not include the name of the QUEUE subscriber. The first parameter
    to the AQ$_REG_INFO should be of this format: <QUEUE ADMIN>.<QUEUE_NAME>:<QUEUE SUBSCRIBER>
    When you say this:
    sys.aq$_reg_info('myprofile.Que1',dbms_aq.namespace_aq, 'plsql://myprofile.QCallBack1', hextoraw('FF'));
    You are not putting the name of the queue subscriber into the first parameter.
    Also, Your callback notification URL must be like this:
    'plsql://<user containing the callback proc>.<name of the callback proc>?PR=1'
    Note that if the callback procedure is in another schema, you must grant EXECUTE priv. to the user
    where the QUEUE has been setup.
    Hallo,
    I have got the same problem as Erwin Groenendal. I wrote single user que and procedures to enque and deque as simple as I can do.
    pseudocode:
    1. create and start que - no error
    2. create proc for callback in pl/sql - no error
    3. register callback - no error
    4. enque message - noerror (no callback called)
    5. deque message - noerror
    in callback procedure I am writing into my own table with one varchar2 column to determine if the callback was processed.
    My register procedure looks like: (pseudocode point 3)
    procedure Register
    is
    XRegProc sys.aq$_reg_info;
    XRegList sys.aq$_reg_info_list;
    begin
    XRegProc := sys.aq$_reg_info('myprofile.Que1', dbms_aq.namespace_aq, 'plsql://myprofile.QCallBack1', hextoraw('FF'));
    XRegList := sys.aq$_reg_info_list(XRegProc);
    dbms_aq.register(XRegList, 1);
    end;
    in definition variable XRegProc I tryed all possibilities like:
    'plsql://myprofile.QCallBack1'
    'plsql://myprofile.QCallBack1?PR=0'
    'plsql://QCallBack1'
    'plsql://myprofile.QCallBack1'
    and so on.
    The Callback looks like:
    procedure QCallBack1(
    context out raw,
    reginfo out sys.aq$_reg_info,
    descr out sys.aq$_descriptor,
    payload out raw,
    payloadl out number)
    is
    begin
    insert into MyOwnTable (my_text) values ('Message notification callback called.');
    commit;
    end;
    with compilation i have not problems. I am running oracle 9i release 2.
    the enque procedure looks like:
    procedure put(
    APayload in raw,
    ACorrelation in varchar2)
    is
    XEnq_opts dbms_aq.enqueue_options_t;
    XMsg_props dbms_aq.message_options_t;
    XMsg_id raw(16);
    begin
    XMsg_props.correlation := ACorrelation;
    dbms_aq.enqueue('Que1', XEnq_opts, XMsg_props, APayload, XMsg_id);
    commit;
    end;
    All rights are corectly sets under SYSTEM user.
    Please help somebody why it does not work. I not see problem byt I need to call some procedure when new message arive into que. I need to have paralel process, I can not solve it with loops and so on.
    Thanks for every ideas. In next week I can show you source code. Today I can not.
    Regards, Zdenek.
    For Oracle9i and above DBMS_AQ.REGISTER can be used for PL/SQL callback notification.
    If running earlier version of Oracle, use DBMS_AQ.LISTEN to get a similar functionality.
    It depends upon the URL that you specify while registering, that decides if callback will be executed or
    not.
    If you post the code fragment(s) of how you created the notification procedure and how you registered it,
    maybe we can look to see if it is correct.
    There have been a number of discussions on this forum about PL/SQL notifications. I'm running
    into the same problem:
    - create the notification procedure
    - register the procedure
    - enqueue a message
    - NOTHING HAPPENS
    It seems that the notification procedure is not executed.
    The discussions on this forum were all inconclusive. Did anybody get this to work? If yes, can
    you post an example (i.e. a script that creates the queue, create the procedure, registers the
    procedure and enqueues a message)?
    Is there a table/view that contains the registrations?
    What system parameters are relevant to this functionality?
    Where are errors in calling the notification procedure logged?

  • AQ Propagation Notifications/PLSQL Callback Query?

    I have the following scenario working but have a question:
    I have two databases, I Enqueue a message onto a Queue in Database 1 and scheduling Propagation to a Queue in Database 2.
    In Database 2 the queue has a PL/SQL procedure registered (using DBMS_AQ.Register) so that as the propagated message arrives it calls the procedure which dequeues it and saves the message to the Table.
    It is all working fine, except that the Dequeue process on Database 2 seems to get invoke after approx 5 mins after it is Enqueued. SO you can see the message on the Subscribing Queue with an Enqueue Time, and it seems to always be about 5 mins later till the procedure is kicked off to dequeue it.
    How do you set the time that it takes to dequeue the message?
    There are no parameters on the DBMS_AQ_Register proc to set this.
    I can't find anything in the docs?
    I originally had a demo setup using PL/SQL callback on a local Queue (without propagation between two Databases) and the Dequeue was virtually instantaneous?
    Regards
    Stuart

    Hello,
    jobqueue_interval is not unsupported it is just hidden. In most cases the default is enough which is why it is hidden. As I recall the default is 5 seconds in 10.2 so it does not explain the 5 minute delay you are seeing. AQ only ever uses 1/2 the available job_queue_processes so if only 1 is available I would be surprised if it worked at all. Have you increased the number to 10?
    There are no other ways to tune notification callbacks in any available version of Oracle that I am aware of.
    Thanks
    Peter

  • Where can i find plsql callback procedure error

    I am using Oracle 11.2.0.3.
    I have registered a callback procedure to my queue (point to point persistent message queue). Is the error from callback procedure stored somewhere?
    I did see some entries to  SYS.AQ_SRVNTFN_TABLE_1 , which is exception table for notification queue but it did not had ORA error of why my callback procedure failed?
    DECLARE    reginfo    SYS.AQ$_REG_INFO;    reg_list  SYS.AQ$_REG_INFO_LIST;
    BEGIN    reginfo :=      sys.AQ$_REG_INFO ('NOTIFY_Q',                        DBMS_AQ.NAMESPACE_AQ,                        'plsql://sp_callback,                        HEXTORAW ('FF'));  
    reg_list := sys.AQ$_REG_INFO_LIST (reginfo);  
    DBMS_AQ.REGISTER (reg_list => reg_list, reg_count => 1);  
    COMMIT
    ; EXCEPTION 
      WHEN OTHERS    THEN    
    DBMS_OUTPUT.put_line (DBMS_UTILITY.FORMAT_ERROR_STACK);
    END;
    Thanks.

    I want to know what error is thrown by call back procedure. Right now, only option i have is to log  exception into a table. I wanted to know if oracle already logs the exception from callback procedure somewhere or if i can configure my callback to do so.

Maybe you are looking for

  • Why can't I see a file sent to me in acrobat

    Someone has sent me a file to vote in acrobat but I cannot find it?

  • IWeb still on Mobileme?

    I just tried to add to an old blog that I had last year and iWeb cannot connect with MobileMe.  I know it's on it's way out but has that already happend?  I do get a dialgoue box that says my internet is not working but that is not the case becasue I

  • Hide and show dock problems

    Hi all, Can anyone help with my dock problem. It wont show it's self anymore. I can turn off "Auotmatically hide and show dock" and it seems to function ok. But if i have that option selected it wont reveal, when i roll over the active area, it strob

  • Can't SETCOOKIE with Javascript with SAFARI

    Why can't a cookie be set/read when the HTML/Javascript application (eBOOK) is located on the local file system, or on a local network file server (ie: not a WEB server)? Opera, Firefox work great, but not Safari. This breaks the ability to locally e

  • Canon Pixma Printer prints from Windows, but not from iMac PLEASE HELP!

    I have a Canon Pixma IP-400 USB printer connected via Airport Express Base Station. I can print just fine from my Windows computer, but when I attempt to print from my iMac, I get +"Error Nubmer : 300 The printer does not respond. Make sure that the