Registered callback does not dequeue messages in order

PROCEDURE notifycb(
CONTEXT IN RAW,
reginfo IN SYS.aq$_reg_info,
descr IN SYS.aq$_descriptor,
payload IN RAW,
payloadl IN NUMBER )
AS
no_messages EXCEPTION;
PRAGMA exception_init( no_messages, -25228 );
dequeue_options dbms_aq.dequeue_options_t;
message_properties dbms_aq.message_properties_t;
msgid RAW( 16 );
message XMLTYPE;
BEGIN
dequeue_options.consumer_name := descr.consumer_name;
dequeue_options.msgid := descr.msg_id;
dbms_aq.dequeue(
descr.queue_name,
dequeue_options, message_properties,
message, msgid );
INSERT INTO xmltest
( create_ts, enqueue_time, xml )
VALUES
( systimestamp, message_properties.enqueue_time, message );
EXCEPTION
WHEN no_messages
THEN NULL;
END;
BEGIN
dbms_aq.REGISTER(
SYS.aq$_reg_info_list(
SYS.aq$_reg_info(
'Q_TEST:QUEUE_SUBSCRIBER',
dbms_aq.namespace_aq,
'plsql://QUEUE_OWNER.NOTIFYCB?PR=1',
HEXTORAW( 'FF' )
, 1 );
END;
DECLARE
v_enqueue_options dbms_aq.enqueue_options_t;
v_message_properties dbms_aq.message_properties_t;
v_message_handle RAW( 16 );
xml XMLTYPE;
BEGIN
FOR x IN 1 .. 10 LOOP
SELECT XMLELEMENT( "x", x ) INTO xml FROM dual;
dbms_aq.enqueue(
queue_name => 'QUEUE_OWNER.Q_TEST',
enqueue_options => v_enqueue_options,
message_properties => v_message_properties,
payload => xml,
msgid => v_message_handle );
END LOOP;
COMMIT;
END;
select * from xmltest
order by create_ts;
16-JUN-08 04.04.27.065311000 PM 06/16/2008 08:04:20 PM <x>4</x>
16-JUN-08 04.04.27.078027000 PM 06/16/2008 08:04:20 PM <x>3</x>
16-JUN-08 04.04.27.155730000 PM 06/16/2008 08:04:20 PM <x>5</x>
16-JUN-08 04.04.27.268137000 PM 06/16/2008 08:04:20 PM <x>6</x>
16-JUN-08 04.04.27.357706000 PM 06/16/2008 08:04:20 PM <x>7</x>
16-JUN-08 04.04.27.479633000 PM 06/16/2008 08:04:20 PM <x>8</x>
16-JUN-08 04.04.27.577086000 PM 06/16/2008 08:04:20 PM <x>9</x>
16-JUN-08 04.04.27.612511000 PM 06/16/2008 08:04:20 PM <x>10</x>
16-JUN-08 04.04.27.979631000 PM 06/16/2008 08:04:20 PM <x>2</x>
16-JUN-08 04.04.28.084615000 PM 06/16/2008 08:04:20 PM <x>1</x>

The solution I found is to use a loop to dequeue messages in order, rather than by the supplied msgid, and to use DBMS_LOCK to prevent the callbacks from processing messages in parallel.
create or replace PROCEDURE notifycb(
context IN RAW,
reginfo IN SYS.aq$_reg_info,
descr IN SYS.aq$_descriptor,
payload IN RAW,
payloadl IN NUMBER )
AS
no_messages EXCEPTION;
PRAGMA exception_init( no_messages, -25228 );
dequeue_options dbms_aq.dequeue_options_t;
message_properties dbms_aq.message_properties_t;
msgid RAW( 16 );
message XMLTYPE;
lockhandle VARCHAR2(128) := NULL;
lockstatus NUMBER;
BEGIN
dequeue_options.consumer_name := descr.consumer_name;
dequeue_options.wait := dbms_aq.no_wait;
dbms_lock.allocate_unique( 'NOTIFYCB_LOCK', lockhandle );
lockstatus := dbms_lock.request( lockhandle, DBMS_LOCK.X_MODE, release_on_commit => TRUE );
IF lockstatus != 0 AND lockstatus != 4
THEN
RETURN;
END IF;
BEGIN
LOOP
dbms_aq.dequeue(
descr.queue_name,
dequeue_options, message_properties,
message, msgid );
INSERT INTO xmltest
( create_ts, enqueue_time, xml )
VALUES
( systimestamp, message_properties.enqueue_time, message );
END LOOP;
EXCEPTION
WHEN no_messages
THEN NULL;
END;
COMMIT;
END;

Similar Messages

  • AQ on RAC: Callback does not dequeue (sometimes)

    Hi,
    We've got the following problem on 11.2.0.3:
    RAC consists of 2 instances.
    The Queue Table is defined with primary instance set to 1.
    On instance 1 parameter job_queue_processes is set to 10 - on instance 2 it is set to 0!
    Queues defined on this Queue Table are dequeued via callback functions.
    Normally every incoming messages should be dequeued automatically by the defined callback functions. But in our setup this does not seem to work: messages are regularly hanging with status READY and need a manual dequeue.
    What's wrong with this setup? Why does this not work?
    Thanks for any input,
    Stephan

    Hi,
    You need to check if there is any inconsistency.
    select count(*) from sys.aq_srvntfn_table n where n.user_data.msg_id in
    (select n.user_data.msg_id msgid from sys.aq_srvntfn_table n minus select msgid from APP_SCHEMANAME.APP_QUEUE_TABLENAME)
    and n.user_data.queue_name = '"APP_SCHEMANAME"."APP_QUEUENAME"';
    Note : in 10.1 onwards, where the schema and queue name can be mixed case, that the query to identify the mismatch needs to reference the n.user_data.queue_name correctly by enclosing the APP_SCHEMANAME and APP_QUEUENAME in double quotes
    If above returns any row:
    ACTION PLAN:
    This shows messages are in the notification queue but not in the user-created application queue.
    For those msgids returned, manually dequeue these messages by specifying the message id from the notification queue : AQ_SRVNTFN_TABLE_Q (in versions below 11.2) or AQ_SRVNTFN_TABLE_Q_<N> (in versions starting 11.2). In doing this, we are removing the message in the notification queue which is not in the Application queue. This should allow the notification activity to move on. e.g.
    set serveroutput on
    declare
    enqueue_options dbms_aq.enqueue_options_t;
    message_properties dbms_aq.message_properties_t;
    dequeue_options dbms_aq.dequeue_options_t;
    message_handle raw(16);
    mes aq$_srvntfn_message;
    begin
      dequeue_options.wait := dbms_aq.no_wait;
      dequeue_options.consumer_name := '<consumer_name>'
      dequeue_options.msgid := '<msg id>';    -- <<< supply mesage id
      dbms_aq.dequeue(queue_name => 'AQ_SRVNTFN_TABLE_Q',   -- <<< as appropriate
      dequeue_options => dequeue_options,
      message_properties => message_properties,
      payload => mes,
      msgid => message_handle);
      dbms_output.put_line('removed: ' || message_handle);
      commit;
    end;
    It may be required to kill off the register driver jobs to restart the mechanism correctly after the queues have been reconciled and the above query returns 0 rows indicating queues are consistent. It  is also recommended to restart the database after this process has been completed before enqueueing further messages into the user-created application queue.
    Note : you may need to specify a consumer_name in the above if the related queue is a multi consumer queue
    Thanks,
    Reena

  • Sales order stock does not exist Message no. M7184

    Hello Gurus,
    I am getting this error while creating post goods issue.
    "Sales order stock 1000000276 000010 does not exist Message no. M7184"
    When i do MMBE it shows :
    Finished Store  2300  Unrestricted use 2000
    We are using MTO and in MRP 3 we have strategy group 20.
    What i suppose to do in order to do PGI without any issue. Means SO -> Delivery ->PGI
    Regards

    HI
    check your process that means for MTO cases Stock will be assigned to sale order line item so try to assign the stock to sale order line item
    Assign stock to Sale order line item :
    Go to MB1B , use movement type 411 and special stock indicator E , enter plant and Storage location and assign the stock to that Sale order and line item number
    Check and Revert
    Regards,
    Prasanna

  • I'm trying to set up my Facetime but I'm getting a message that says my registering device does not have appropriate credentials

    I'm trying to set up my Facetime on my laptop but I'm getting an error message that says my registering device does not have appropriate credentials. How can I fix this?

    katharina,
    The specific circuit board I was talking about is the "Logic Board" which should have the serial number of your computer embeded electronnicaly.  Sometimes the technicians who replace this board do not bother to enter the computer's serial number into it after making the repair/replacement.  Probably because they don't think that it is important.  The only way you can have this done is to bring it back to the shop where it was repaired, and have them do it. On some Macs you can check the electronic serial number by clicking on the Apple logo on the top left hand corner of the screen, then clicking on "about this mac" then clicking on "more info" button on the window which will appear.  If you can't see any serial number, then your replacement board was not serialized.

  • When attempting to log into Facetime the following message appears "the registering device does not have appropriate credentials"

    Hi there
    I've been trying to log into my facetime, i put in my apple ID and passward but once i click "sign in" the following message appears "the registering device does not have appropriate credentials".
    I have installed all my software updates, made sure my apple ID email is verified, have made sure my date/time/time zone is correct as suggested in other posts but this hasn't worked. I've also tried to delete and re-install facetime but this hasn't worked either.
    Please advise me on what i need to do
    Thanks 

    Hello vbabs
    Check out the article below for troubleshooting FaceTime activation and other issues as well.
    FaceTime for Mac: Troubleshooting FaceTime
    http://support.apple.com/kb/ts4185
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • Sales order does not allow make-to-order production

    Dear Friends,
    I am trying to do do planned order for sales order in MD50 it was showing the error message as
    "Sales order does not allow make-to-order production"
    Can any one solve this
    Shakthi

    Hi Shakthi,
    It is also possible to set the priority for Requirement Type determination like
    0 Material master strategy, then item category and MRP type
    1 Item Category and MRP Type
    2 as 1, with check for allowed requirement type.
    The transaction for this is same as "Requirement Type Determination :
    Sales and Distribution --> Basic Functions --> Availability Check and Transfer of Requirements --> Transfer of Requirements --> Determination Of Requirement Types Using Transaction
    Look for "Source".
    In this transaction, Please, check "Requirements".
    Please, make sure of the following 2 things :
    1. If you do not set an indicator for maintaining the requirements class: Transfer of requirements is not carried out, irrespective of the specification you make at schedule line level for the transaction.
    So it is necessary to mantain the setting first at the Requirements Class. As mentioned in my earlier posts, the requirement class for the material can be found out from Planning Strategy / MRP3 view --> Main strategy (defined in the strategy group) --> Requirement Class for Customer Requirements.
    The IMG path for "Define Strategy" is Production --> Production Planning --> Demand Management --> Planned Independent Requirements --> Planning Strategy --> Define Strategy.
    2. Once the "Requirements" indicator is set in Requirement Class, the requirements indicator at the Schedule Line decides whether or not you require transfer of requirments for the relevant transaction.
    I hope this should solve your problem.
    Regards,
    Sandeep

  • HT204408 When trying to log into face time I get the registering device does not have appropriate credentials, I have OSX 10.8.4 on my Mac Pro. I can log in using my IPAD

    When trying to log into face time I get the registering device does not have appropriate credentials after I sign in, I have OSX 10.8.4 on my Mac Pro. I can log into face time without a problem using my IPAD.>

    Please take each of the following steps that you haven't already tried, until the issue is reolved. If there's no resolution after Step 3, post your results.
    Step 1
    Sign out of iMessage in the Accounts tab of the preferences dialog, then sign back in.
    Step 2
    Log out of your user account and log back in.
    Step 3
    Boot in safe mode and test, then reboot as usual and test again.
    Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and  Wi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.

  • Number range  for object MDTB does not exist - Message no. 61501

    Hi All ,
      I have done the necessary configurations in PP say
    Order Type
    Order Type Dependent Parameters
    Scheduling parameters for planned & production order
    Confirmation parameters
    Availabilty check etc
    and iam able to create planned & production order and confirma the production order.
    I want to configure for MRP: -
    Settings done are
    Have activeted planning file entry for all plants.
    When i run MRP system throws a error <b>Number range  for object MDTB does not exist - Message no.61501 </b>
    Is there anything to do with plant parameters OPPQ and Mrp Group OPPR.
    I just tried plant parameters,standard 0001 is not available for copying.
    Suggest me how to proceed to set MRP.
    Shankar

    Hi shankar
      it is a good practice while creating the plant copying the plant from the standard plant so that all the standard table enteries will be copied  for the plant as the standard plant is not there youcan think of copying from any other plant similar to your plant which has the required entry. else
    in SE16N  check the NRIV table for the Object MDTB. if enteris found then make the table entry with the help of abaper.
    hope this helps
    regards
    SK

  • "Entry sheet does not exist message no. SE012"

    Dear all,
    One SES is created and saved. Now if i check system message as below.
    "Entry sheet does not exist message no. SE012"
    Please advice

    Hi Deepu,
                    Please check in the PO, if in the Item Detail, The tab "Purchase Order History" is there or not, if it is there with the SES no, it means that the SES is created and you might not be able to view the same Please check the same no in the table ESSR.
    Hope it helps you.
    Regards,
    Yawar Kahn

  • Item 000010 does not exist Message no. V1331

    Hi Experts
    While creating third party sales order with Item Category "TAS", I am getting the error "Item 000010 does not exist
    Message no. V1331" .  What would be reason for it and also kindly help me with the solution for this.
    Thanks and Regards
    M.Dheerendar Jain

    Hi,
    Check the following OSS notes, if they're applicable:
    127309      Error V1331 when you create sales orders
    420093      Message V1331 with item entry in the sales order
    1375071      Message V1 331 when you create subitems using IDocs
    Regards,
    Raghu.

  • Login problem in FaceTime in my MacBook Pro.... "The registering device does not have appropriate credentials."

    I am not able to loing FaceTime and have tried to get support from apple communities also, but none of those worked out.... Please help me to resolve "The registering device does not have appropriate credentials."

    Hello GAURAV,
    Thank you for providing the details of the issue you are experiencing with logging into FaceTime.  I recommend the following article:
    FaceTime, Game Center, Messages: Troubleshooting sign in issues
    http://support.apple.com/kb/TS3970
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Archieve does not exist for purchase order

    Hello Gururs,
    When i tried to change the delivery date for the PO and when i trying to save the PO
    then it throws the error messages-'Archieve does not exist for purchase order'.
    PO was created in feb.
    Please help me how can i solve this issue.
    BR
    Ashish

    Can you give a more detailed information.
    What transaction you actually use, what you enter step by step until you get to the error: 'Archieve does not exist for purchase order'
    This message sounds like you want change a PO which is already archived.
    A change to an archived PO is not really logical,  as you can only archive closed business cases. and if the business case is closed, then why would you change the delivery date.
    A PO from February should not really be archived already in June. I never saw it in practice, as you could not do any anual reporting
    I would assume further that SAP found the entered PO number in the archive index but did not find the way to the archive itself. This can happen if the archive file was deleted or moved manually.
    I am not sure if the next messae has really anything to do with your purchase order, thats why I ask you to post the exact steps until the messages come up:
    Le fichier archieve 000524-002SD_COND n'existe pas is the message discription
    But even this message explains more or less the same, that the physical archive is no longer in the same place where it is expected to be found according to the info in records of table ADMI_FILES.

  • Facetime says registering devise does not have proper credintials

    Trying to get face time to work and getting the message registering devise does not have proper credentials. What does that mean and how do I correct it?

    Hi ramjet49,
    Thanks for visiting Apple Support Communities.
    It sounds like you may be seeing unexpected behavior when activating FaceTime with your Apple ID. I recommend starting with the troubleshooting steps found here:
    FaceTime for Mac: Troubleshooting FaceTime
    http://support.apple.com/kb/ts4185
    Best Regards,
    Jeremy

  • When I try to log in into my facetime it tells me that the registering device does not have appropriate credentials. how do I fix it?

    When I try to log in into my facetime it tells me tha the registering device does not have apropiate credentials. how do I fix it?

    Check for the latest updates for your OS,  you'll get that error message if you do not have the latest security updates for your operating system.

  • I have an IMac and an IPad 2. IMac receives and sends email. IPad does not. Message says name

    My IMac sends and receives email without problems. My IPad two does not. Message says user name & password incorrect. This is a constant problem forcing me to repeatedly change names & passwords in order to get email on the IPad. How can I sync these two units to recognize a single user name and password? Help! Considering a returrn to the Morse Code.  

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    iPad Mail
    http://www.apple.com/support/ipad/mail/
     Cheers, Tom

Maybe you are looking for

  • VPN Client Accounts: "Username and passwords must consist of numbers or letters"

    I am configuring a username in the VPN Client Accounts withing a Cisco WRVS4400N. The username I must enter is in the form: [email protected] Unfortunately, when I input that username, the system informs me that I cannot have anything other than numb

  • Asset master creation?

    Dear Sap Gurus, Can any one xplain asset master creation & asset procurement. I did exceise of seraching this post in sdn before posting here? please advise on this more clearly if you!!!!. Regards TG

  • Drill Down BeX Query with hierarchy in WEBI

    Hi, I am using a Bex Query with Hierarchy in my WEBI report. Is it possible to drill down ? I am not able to use Scope of Analysis because it is disabled. I am very new to WEBI. Please help me out. Thanks in Advance. Lakshmi Mohan

  • Sending novell command from PHP

    Hi, I am trying to unzip a file from php. I am trying to run a unzip command from phpm but the novell server won't take it. when i do: <?php exec("unzip DATA1:/zipfile.zip"); ?> i get: unable to find load file SYS:/TMP/UNZIP when i do: <?php exec("ec

  • Cisco Meeting Place Express 2.0 Exchange Server Configuration error.

    Hi I have Cisco Meeting  Place Express 2.0 installed on server. Meting Place uses Linux (Red Hat)  as base operation system. v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url