AQ XMLType : Example to Enqueue an XMLType message in 10g AQ
I am looking for an example to enqueue a XMLType message in AQ oracle 10g version : I need the actual payload example,
When I enqueue a payload the queue rejects the message.
any Help would be appreciated
Thanks
stan
Create Queue Table
EXECUTE DBMS_AQADM.CREATE_QUEUE_TABLE (queue_table=> 'fraudxml_qtab', queue_payload_type => 'sys.XMLTYPE');
Create Queue
EXECUTE DBMS_AQADM.CREATE_QUEUE (queue_name => 'fraudxml_queue', queue_table => 'fraudxml_qtab');
EXECUTE DBMS_AQADM.START_QUEUE (queue_name => 'fraudxml_queue');
This is the Enqueue
SET TIMING ON
DECLARE
enqueue_options dbms_aq.enqueue_options_t;
indoc VARCHAR2(2000);
indomdoc dbms_xmldom.domdocument;
innode dbms_xmldom.domnode;
myParser dbms_xmlparser.Parser;
message_properties dbms_aq.message_properties_t;
message_handle RAW(16);
message sys.XMLTYPE;
BEGIN
FOR j IN 1 ..100000
loop
indoc := '<emp><name> Stan </name></emp>';
myParser := dbms_xmlparser.newParser;
dbms_xmlparser.parseBuffer(myParser, indoc);
indomdoc := dbms_xmlparser.getDocument(myParser);
message := XMLTYPE(indomdoc);
-- message := XMLTYPE('<test><name>Stan Kumar</name><ID>11111111</ID></test>');
dbms_aq.enqueue(queue_name => 'msg_queue',
enqueue_options => enqueue_options,
message_properties => message_properties,
payload => message,
msgid => message_handle);
COMMIT;
end loop;
END;
Similar Messages
-
Enqueue Array of Messages in JMS
Hi,
I want to enqueue array of messages using OJMS just like it can be done using DBMS_AQ.ENQUEUE_ARRAY in PL/SQL. And dequeue them either as an array of messages or as an individual message.
Any idea how?
Thanks in adv.
Sanju.Use metrics, I'm doing that now.
Create a topic called "mq.metrics.destination_list" and send it to the broker, then you get a mapped message reply with alot of info for each queue in the broker.
Here is what you get back:
// Define key words from the mapped name value pairs.
public static final String[] KEY_WORDS = {
"numAckedMsgs", "peakNumMsgs", "numMsgsIn", "peakMsgBytes",
"avgNumConsumers", "numBackupConsumers", "numActiveConsumers",
"numMsgs", "peakNumConsumers", "numMsgsOut", "msgBytesOut",
"avgNumBackupConsumers", "numExpiredMsgs", "avgNumMsgs",
"diskReserved", "numDiscardedMsgs", "numRolledbackMsgs",
"msgBytesIn", "avgNumActiveConsumers", "totalMsgBytes",
"numRejectedMsgs", "diskUtilizationRatio", "peakTotalMsgBytes",
"avgTotalMsgBytes", "peakNumBackupConsumers", "numPurgedMsgs",
"peakNumActiveConsumers", "numConsumers", "diskUsed"
numAckedMsgs will show how many messages were received.
I've created a queue monitor that sends pages if a queue get to deep or there are no consumers. -
MSCS H/A enqueue, replication and message servers services
Hi,
I'm looking at the documentation about "Installation of multiple SAP Systems in MSCS: MSSQL Server" but I have a few questions about the SCS and ASCS process.
Are the process setup as generic cluster service? Or are they SAP provided cluster services?
What monitoring is done with the the enqueue, replication and message server services in the cluster?Mike,
The SAPINST installer will install SCS and ASCS services into MSCS for you. They are installed inside the SAP group in cluster.
The message servers, controlled by either SCS is HA with MSCS. The enqueue services is HA with installation of ERS locally on both nodes. SCS + ERS + ERS provides a triangular HA that means the services is always on and can withstand an cluster failover. The cluster only controls the SCS service. The ERS services are local to each server.
Let me know if I did not answer the question.
jwise -
Enqueue server and Message server in ABAP/Java dual stack
Hi you guys,
I have some questions when studying SAP, could you please explain for me:
- In ABAP and Java system, do each stack have it own enqueue server and message server?
- What is the difference between Enqueue server and enqueue work process in ABAP stack?
- If there is one message server for each stack, which messager server (ABAP or Java) will the Web dispatcher connect directly to?
- How do ABAP message server and Java message server communicate with each other?
Thank you very much.1. in Dual Stack, normally you have ABAP Stack and SCS Central service Instance. ABAP Instance has Message server, SCS has it own Message server and enqueue server. ABAP instance doesn't have enqueue server, because the SCS already has enqueue service
2. Communication between ABAP and J2EE Engine uses RFC (JCo) or HTTP Interface.
Web Dispatcher will connect to the ICM of that instance, and the ICM is talking to Abap dispatcher and J2EE Dispatcher.
3. The term: enqueue server and enqueue work process , already shows its different quite obviously.
What so confuse about it ? do some search on SAP Online Documentation.
Regards,
Vincent -
MacMail has stopped noting when I have read an email. For example, I had 17 unread messages, so I read them. Despite me having read them AND deleted them, the inbox still has 17 new messages displayed. Can anyone help resolve the incorrect display?
Lord K. Thank you. Yes I am within the 90 time period, however I travel Intertionally and I can not receive not make a call to Apple. I was just at the Genius Bar in Chicago and they said, don't worry about it. It just floats out there, however, I can not recover my messages on a flash drive. I need to go back to my old computer which I don't have with me. My messages were in folders for a lawsuit. It is going to take an incredible amount of work for me to, you have no Idea. We are talking thousands of pages! I the defendent will have them during discovery so I am not so worried. However, I can not bring them to him on a Flashdrive when I meet with him without an extraordinary amount of presssure on my part. THis is not just some little email issue. This is suing EXPEDIA and Tripadviosr.com
-
I need to enqueue xml files.How can I do this?(I need to use the JMS interfaces)
I am able to create a topic connection and session.I am unable to figure out how to create a ObjectPayload with the xml mesage in it.
I have created the necessary queue by running the following scripts:
CREATE TYPE queue_message_type AS XMLType ;
EXEC DBMS_AQADM.CREATE_QUEUE_TABLE (queue_table => 'multi_message_xml_table', queue_payload_type => 'SYS.XMLTYPE', multiple_consumers => TRUE);
EXEC DBMS_AQADM.CREATE_QUEUE (queue_name => 'multi_xml_queue', queue_table => 'multi_message_xml_table');
EXEC DBMS_AQADM.START_QUEUE (queue_name => 'multi_xml_queue');
Thanks,
MahimaJust to follow up with some other information.
I created an AQ queue with AQ$_JMS_MESSAGE as payload type. Only, JDeveloper doen't recognize this queue when trying to create an AQ adapter in an ESB or BPEL project. It says it only supports RAW or OBJECT payload types. This seems like a bug; also see: ESB 10.1.3.1 Not Connecting to AQ QUEUE with error
So I changed the payload type to SYS.XMLType and it works fine.
The PL/SQL trigger I use to enqueue messages is:
CREATE OR REPLACE TRIGGER JMSUSER.AIT_TEST AFTER INSERT ON JMSUSER.TEST_AQ_TABEL FOR each row
declare
msg SYS.XMLType;
queue_options DBMS_AQ.ENQUEUE_OPTIONS_T;
msg_props DBMS_AQ.MESSAGE_PROPERTIES_T;
msg_id RAW(16);
Begin
msg := SYS.XMLType.createXML('<?xml version="1.0"?>' || '<id xmlns="http://www.approach-alliance.com">' || :new.ID || '</id>');
DBMS_AQ.ENQUEUE(
queue_name => 'TESTXML_QUEUE',
enqueue_options => queue_options,
message_properties => msg_props,
payload => msg,
msgid => msg_id);
end ;
I can then create an AQ adapter in the ESB and transform and/or route the XML content as desired.
Regards,
Ronald -
How to compare two xmltypes in oracle 10g ?
Hi,
I have a requirement that i have to compare two xmltypes of a table.
Is there any function available in oracle 10g that compares two xmltypes.
Regards
KrishnaThis can help for this question
Re: Help needed ! How to find out 'XML Difference' using XDK -
Seeking examples of custom XML Gateway message map
I've been asked to create some custom XML Gateway message maps for inbound/outbound XML data feeds.
I've followed along at [this tutorial|http://docs.oracle.com/cd/E12839_01/integration.1111/e10537/T430238T430339.htm#T430357], but it stops short of telling me how to define a custom message map.
Does anyone know of a resource I could look at - a web site, book, etc., that would cover the creation of a custom message map?Have a look
http://docs.oracle.com/cd/E18727_01/doc.121/e12954/T319774T319778.htm -
Is there any example code to send a message from Service Broker to ActiveMQ?
I would appreciate any links or discussion on this. I have found a number of similar questions but no definitive answer that it can be done. There is a .NET interface to ActiveMQ so maybe the answer is a C# CLR procedure to get this done.
Thanks
TomHi Thomas,
A C# CLR procedure sounds like a fitting solution, since basically what you need is to access some program external to SQL Server.
Note that doing so will require you to create an UNSAFE assembly within SQL Server, and probably also set the database as TRUSTWORTHY. These are serious security risks and not recommended unless there's no other choice.
A more secure solution would be to have some .NET application that accesses your Service Broker queue (instead of an automatic reader handling procedure), and programmatically sends its contents to the ActiveMQ. This is essentially a 3rd party component
that would need to be developed.
I hope that helps
Eitan Blumin; SQL Server Consultant - Madeira Data Solutions; -
PL/SQL message problems 10g
Hi,
Im having a problem with using the message function in my PL/SQL statement.
When I use for example:
MESSAGE('This is an example');
No message is displayed, the condition is being checked, I can tell, because it will not let me navigate away from the field, until the field is correct, I am checking that the field is less than a certain number.
However the error message I have defined in MESSAGE('This is an example') does not appear anywhere?
Why is this?MESSAGE function is user defined function in your project, isn't it?
You can use raise_application_error instead of that,
or you might to be able to get it by turning SEREVEROUTPUT ON.
SQL> execute raise_application_error(-20100,'My Error Message');
BEGIN raise_application_error(-20100,'My Error Message'); END;
ERROR at line 1:
ORA-20100: My Error Message
ORA-06512: at line 1
SQL> execute dbms_output.put_line('Test Message');
PL/SQL procedure successfully completed.
SQL> set serveroutput on
SQL> execute dbms_output.put_line('Test Message');
Test Message
PL/SQL procedure successfully completed.
SQL> execute MESSAGE('SHOULD NOT EARN MORE THAN MANAGER');
BEGIN MESSAGE('SHOULD NOT EARN MORE THAN MANAGER'); END;
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'MESSAGE' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored -
41052 Cannot find window. Invalid ID. error message in 10g
Hi guys, after migrating to 10g from 6i I am getting the above message when trying to go to another form by double clicking on an item. Can someone please help me why this is happening... and what should I do?
any help will be greatly appreciated...hi
if u r using the following code please then u have to mention the window1 here is an example:.
set_window_property (FORMS_MDI_WINDOW, window_state, maximize);
set_window_property( 'WINDOW1' ,window_state,maximize);sarah -
I've searched through the forum and can't find information for what I believe is a general problem that I'm having with Forms 10g (10.1.2).
None of the "normal" Forms messages are appearing. If I open a form, enter values in a field or two then refresh the page (to get a new version that I generated), I get a "beep", suggesting that the message that would normally appear, prompting me for action on the record that I created, should be displayed. However, no message appears.
I've also tried to display a message in response to a user-event from a WHEN-VALIDATE-ITEM, but it doesn't appear. The call does:
MESSAGE('---My Error Message---',ACKNOWLEDGE);
PAUSE;
But all I get is a message window with the prompt / message "Please Acknowledge".
What am I missing or doing wrong? I just want the "old" - Forms 6i type of behavior.
Thanks.Don't set the console property to null. Set it to your main window.
Also, if you want a message to appear in a dialog box instead of the status bar, then do this:
message('Your message goes here.');
message(' ', NO_ACKNOWLEDGE); -- a single spaceIf that still doesn't work, then maybe you have an ON-ERROR or ON-MESSAGE trigger that is not displaying messages. -
Issue with RN messages between 10g and 11g
Hi All,
We are facing some issues for RN messages;
We have configured Rosettanet Actions on both 10G and 11G . In 11G we have the RNTP (remote trading partner) in 10G we have host. The messages posted from host(10g) are not reaching the 11g remote TP, but failing due to the below errors;
<29-Aug-2012 14:47:07 o'clock IST> <Error> <oracle.soa.b2b.engine> <BEA-000000> <B2B Label:PCBPEL_11.1.1.6.0_GENERIC_111
214.0600.1553: java.lang.NullPointerException
at oracle.tip.b2b.exchange.rnif11.RNExchangePlugin.decodeIncomingMessage(RNExchangePlugin.java:212)
at oracle.tip.b2b.exchange.rnif11.RNExchangePlugin.decodeIncomingMessage(RNExchangePlugin.java:582)
at oracle.tip.b2b.engine.Engine.processIncomingMessageImpl(Engine.java:1919)
at oracle.tip.b2b.engine.Engine.processIncomingMessage(Engine.java:1650)
at oracle.tip.b2b.engine.Engine.incomingContinueProcess(Engine.java:4042)
at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:3718)
at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:3205)
at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:677)
at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:211)
at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184)
at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
Could anyone help us on this issue?
Regards,
RajHi Dheeraj ,
1. With Both 10G we are getting the below error with Rosettanent Exchange Protocol Version 01.10 :
Description: An unexpected error occurred during validation
StackTrace:
Error -: AIP-51505: General Validation Error: Error -: AIP-51505: General Validation Error: oracle.xml.parser.schema.XSDException
at oracle.tip.adapter.b2b.document.rn20.RNDocumentPlugin.processIncomingDocument(RNDocumentPlugin.java:163)
at oracle.tip.adapter.b2b.engine.Engine.processIncomingMessage(Engine.java:1927)
at oracle.tip.adapter.b2b.engine.Engine.incomingContinueProcess(Engine.java:2617)
at oracle.tip.adapter.b2b.engine.Engine.handleMessageEvent(Engine.java:2487)
at oracle.tip.adapter.b2b.engine.Engine.processEvents(Engine.java:2442)
at oracle.tip.adapter.b2b.data.MsgListener.onMessage(MsgListener.java:527)
at oracle.tip.adapter.b2b.data.MsgListener.run(MsgListener.java:374)
at java.lang.Thread.run(Thread.java:534)
However , when we changed the Exchange Protocol Version to V02.00 we got the below error :
Machine Info: (APT3VW03)
Description: B2B adapter general error
StackTrace:
Error -: AIP-50031: B2B adapter general error: Error -: AIP-50025: Repository error : Error -: AIP-50547: Trading partner agreement not found for the given input values: From party[NAME] "null", To party[NAME] "null", Business action name "RequestPurchaseOrderAction"; also verify agreement effectiveToDate
at oracle.tip.adapter.b2b.engine.Engine.processIncomingMessage(Engine.java:2006)
at oracle.tip.adapter.b2b.engine.Engine.incomingContinueProcess(Engine.java:2617)
at oracle.tip.adapter.b2b.engine.Engine.handleMessageEvent(Engine.java:2487)
at oracle.tip.adapter.b2b.engine.Engine.processEvents(Engine.java:2442)
at oracle.tip.adapter.b2b.data.MsgListener.onMessage(MsgListener.java:527)
at oracle.tip.adapter.b2b.data.MsgListener.run(MsgListener.java:374)
at java.lang.Thread.run(Thread.java:534)
2. With both 11G Environments we are getting the below error (Exchange Protocol Version 01.10):
<05-Sep-2012 13:49:36 o'clock IST> <Error> <oracle.soa.b2b.engine> <BEA-000000> <B2B Label:PCBPEL_11.1.1.6.0_GENERIC_111
214.0600.1553: java.lang.NullPointerException
at oracle.tip.b2b.exchange.rnif11.RNExchangePlugin.decodeIncomingMessage(RNExchangePlugin.java:212)
at oracle.tip.b2b.exchange.rnif11.RNExchangePlugin.decodeIncomingMessage(RNExchangePlugin.java:582)
at oracle.tip.b2b.engine.Engine.processIncomingMessageImpl(Engine.java:1919)
at oracle.tip.b2b.engine.Engine.processIncomingMessage(Engine.java:1650)
at oracle.tip.b2b.engine.Engine.incomingContinueProcess(Engine.java:4042)
at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:3883)
at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:3205)
at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:677)
at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:211)
at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184)
at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
>
<05-Sep-2012 13:49:36 o'clock IST> <Error> <oracle.soa.b2b.engine> <BEA-000000> <java.lang.NullPointerException
at oracle.tip.b2b.msgproc.DbAccess.insertMsgTblRowImpl(DbAccess.java:621)
at oracle.tip.b2b.msgproc.DbAccess.insertMsgTblRow(DbAccess.java:524)
at oracle.tip.b2b.msgproc.DbAccess.updateWireBusinessToErrorState(DbAccess.java:6241)
at oracle.tip.b2b.engine.Engine.handleInboundException(Engine.java:5130)
at oracle.tip.b2b.engine.Engine.handleExceptionBeforeIncomingTPA(Engine.java:5062)
at oracle.tip.b2b.engine.Engine.processIncomingMessageImpl(Engine.java:1983)
at oracle.tip.b2b.engine.Engine.processIncomingMessage(Engine.java:1650)
at oracle.tip.b2b.engine.Engine.incomingContinueProcess(Engine.java:4042)
at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:3883)
at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:3205)
at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:677)
at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:211)
at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184)
at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
Regards,
Raj -
using
:system.message_level:=25;
commit;
:system.message_level:=0;
i can suppress error message in froms 9i but when i run that form in iAS10g
the message "no changes to save" does not suppress.It's not a good idea to suppress error messages. If there is a problem, then you (or user) won't know.
If you are using the system.message_level only to try and suppress, the "no changes to save" message, then a better way is to check if there are changes before doing the commit. Like this:
IF :System.Form_Status = 'CHANGED' THEN
Commit_Form;
END IF; -
Getting messages in 10g database when archive turned on
Tue Oct 23 07:58:48 2007
Shutting down archive processes
Tue Oct 23 07:58:53 2007
ARCH shutting down
ARC2: Archival stopped
Tue Oct 23 08:00:40 2007
Memory Notification: Library Cache Object loaded into SGA
Heap size 5994K exceeds notification threshold (2048K)
KGL object name :select * from sys.dba_extents
Tue Oct 23 08:52:53 2007
Thread 1 cannot allocate new log, sequence 15834
Private strand flush not complete
Can any guru tell me that these messages are usual or something serious with database.pls responseThnaks for your valueable information.
these messages coming in alert.log and generation of archiving is so huge like in 5-10 seconds.please see below .
it also showing
ORACLE Instance AAAA - Can not allocate log, archival required
i have been increased destination size.But database is running.
Thread 1 cannot allocate new log, sequence 16220
Checkpoint not complete
Current log# 1 seq# 16219 mem# 0: +DATA/AAAA/onlinelog/group_1.262.627676809
Current log# 1 seq# 16219 mem# 1: +DATA/AAAA/onlinelog/group_1.263.627676811
Thread 1 advanced to log sequence 16220
Current log# 2 seq# 16220 mem# 0: +DATA/AAAA/onlinelog/group_2.264.627676813
Current log# 2 seq# 16220 mem# 1: +DATA/AAAA/onlinelog/group_2.265.627676817
Thread 1 cannot allocate new log, sequence 16221
Checkpoint not complete
Current log# 2 seq# 16220 mem# 0: +DATA/AAAA/onlinelog/group_2.264.627676813
Current log# 2 seq# 16220 mem# 1: +DATA/AAAA/onlinelog/group_2.265.627676817
Wed Oct 24 07:30:19 2007
Thread 1 advanced to log sequence 16221
Current log# 3 seq# 16221 mem# 0: +DATA/AAAA/onlinelog/group_3.266.627676819
Current log# 3 seq# 16221 mem# 1: +DATA/AAAA/onlinelog/group_3.267.627676821
Wed Oct 24 07:30:26 2007
ORACLE Instance AAAA - Can not allocate log, archival required
Thread 1 cannot allocate new log, sequence 16222
All online logs needed archiving
Current log# 3 seq# 16221 mem# 0: +DATA/AAAA/onlinelog/group_3.266.627676819
Current log# 3 seq# 16221 mem# 1: +DATA/AAAA/onlinelog/group_3.267.627676821
Thread 1 advanced to log sequence 16222
Current log# 1 seq# 16222 mem# 0: +DATA/AAAA/onlinelog/group_1.262.627676809
Current log# 1 seq# 16222 mem# 1: +DATA/AAAA/onlinelog/group_1.263.627676811
Wed Oct 24 07:30:36 2007
Thread 1 cannot allocate new log, sequence 16223
Checkpoint not complete
thanks & regards
Maybe you are looking for
-
TS3297 err-3235 failure to connect
Despite running all firewall checks and all internect connectivity checks multiple times, I am still having an issue with downdoaling movies from itunes with an err-3235 "network connection was reset" message appearing (never happened before). I hav
-
Best Store to buy macbook pro with retina display in india??
which is the best store?? keeping service in mind. Only in india
-
Problem installing Lightroom 5
ERROR: Third party payload installer Install Lightroom 5 CCM.exe failed with exit code: 1603 Installs to about 84 percent and then fails
-
Feature Request For Next iTunes/iPod Update - Useful For Many
Hi, I have always wanted a feature for iTunes like this: I want there to be "pocket" playlists - playlists for songs that I (and others) wouldn't normally listen to, but have in my library just for the heck of it, i.e. prank calls, music my parents r
-
Svrmgrl: can't load library 'libnsl.so.1
I get this error when im installing oracle. The directory the library is in is in ld.so.conf and I have run ldconfig. Thanks null