Demaq: A Foundation for Declarative XML Message Processing Alexander Böhm Carl-Christian Kanne Guido Moerkotte University of Mannheim Carl-Christian Kanne, January 8, 2007 Demaq - p. 1/20
XML Messaging XML Introduction ● XML Messaging ● Networks of XML Queues ● Messaging Rules ● ∞ -tier Architectures XML ● State of the Art Customer Demaq XML Supplier A XML Appendix Manufacturer XML XML XML Supplier B XML Customer Supplier C XML XML XML SOA, Web Services, AJAX, RSS/Atom... Carl-Christian Kanne, January 8, 2007 Demaq - p. 2/20
Networks of XML Queues Introduction ● XML Messaging XML ● Networks of XML Queues ● Messaging Rules XML ● ∞ -tier Architectures XML ● State of the Art Demaq XML Appendix XML XML XML XML XML XML XML Carl-Christian Kanne, January 8, 2007 Demaq - p. 3/20
Messaging Rules ■ "If a request for an offer comes in, forward it to the Introduction ● XML Messaging legal, finance, and planning departments" ● Networks of XML Queues ● Messaging Rules ● ∞ -tier Architectures ■ "If the delivery of all items has been confirmed, ● State of the Art send a completion message to the customer" Demaq Appendix Carl-Christian Kanne, January 8, 2007 Demaq - p. 4/20
∞ -tier Architectures Introduction Network ● XML Messaging ● Networks of XML Queues ● Messaging Rules ● ∞ -tier Architectures XML ● State of the Art Demaq Messaging System Appendix XML App Server TP Monitor App Code Java Java C# Java C# DBMS Carl-Christian Kanne, January 8, 2007 Demaq - p. 5/20
State of the Art t o p ic = ( ( QIjmsSession ) t_sess ) . getTopic ( " strmadmin " , " oe_queue " ) ; Introduction t_pub = t_sess . createPublisher ( t o p ic ) ; ● XML Messaging db_conn = ( ( QIjmsSession ) t_sess ) . getDBConnection ( ) ; ● Networks of XML Queues ● Messaging Rules agent = new QIjmsAgent ( " e x p lic it _ e n q " , n u l l ) ; ● ∞ -tier Architectures adt_msg = ( ( QIjmsSession ) t_sess ) . createAdtMessage ( ) ; ● State of the Art lcr_data = new St r in g Bu f f e r ( ) ; Demaq lcr_data . append (" <ROW_LCR " ) ; lcr_data . append ( " xmlns= ’ h t t p : / / xmlns . tentacle .com/ streams / schemas / lc r ’ " ) ; Appendix lcr_data . append ( " xmlns : xsi = ’ h t t p : / / www.w3. org /2001/XMLSchema − instance ’ " ) ; lcr_data . append ( " xsi : schemaLocation = ’ h t t p : / / xmlns . tentacle .com/ streams / schemas / l c r " ) ; lcr_data . append ( " h t t p : / / xmlns . tentacle .com/ streams / schemas / l c r / streamslcr . xsd ’ > " ) ; lcr_data . append (" < source_database_name>source_dbname</ source_database_name > " ) ; . . . MORE DOCUMENT CONSTRUCTION HERE . . . xml_lcr = tentacle . xdb .XMLType . createXML ( db_conn , lcr_data . t o St r in g ( ) ) ; adt_msg . setAdtPayload ( xml_lcr ) ; ( ( QIjmsMessage) adt_msg ) . setSenderID ( agent ) ; System . out . p r i n t l n ( " Publish message 3 − XMLType containing LCR R O W" ) ; r e c i p L i s t = new QIjmsAgent [ 1 ] ; r e c i p L i s t [ 0 ] = new QIjmsAgent ( " e x p lic it _ d q " , n u l l ) ; ( ( QIjmsTopicPublisher ) t_pub ) . publish ( topic , adt_msg , r e c i p L i s t ) ; t_sess . commit ( ) ; Carl-Christian Kanne, January 8, 2007 Demaq - p. 6/20
Demaq Application Demaq Application Introduction Queue Queue Demaq Network Gateway ● Demaq Application Queue ● Demaq Language(s) Gateway ● Demaq QML Rules Queue Queue ● Demaq Sample Rule ● Demaq Server ● Messages all the way ● Demaq Project ● Thank you Appendix ■ Complete ■ Declarative ■ Executable Carl-Christian Kanne, January 8, 2007 Demaq - p. 7/20
Demaq Language(s) Demaq Application Introduction Queue Queue Network Demaq Gateway ● Demaq Application Queue ● Demaq Language(s) Gateway ● Demaq QML Rules Queue Queue ● Demaq Sample Rule ● Demaq Server Application Rules (QML) ● Messages all the way ● Demaq Project ● Thank you Appendix Message Queues (QDL) Queue Queue Gateway Queue Gateway Queue Queue Demaq Language Carl-Christian Kanne, January 8, 2007 Demaq - p. 8/20
Demaq QML Rules Introduction Demaq ● Demaq Application ■ "If the delivery of all items has been confirmed, ● Demaq Language(s) ● Demaq QML Rules send a completion message to the customer" ● Demaq Sample Rule ● Demaq Server ● Messages all the way ● Demaq Project ● Thank you Appendix Carl-Christian Kanne, January 8, 2007 Demaq - p. 9/20
Demaq QML Rules Introduction Demaq ● Demaq Application ■ "If the delivery of all items has been confirmed, ● Demaq Language(s) ● Demaq QML Rules send a completion message to the customer" ● Demaq Sample Rule ● Demaq Server ● Messages all the way ● Demaq Project ● Thank you Appendix XML messages new XML messages − → Carl-Christian Kanne, January 8, 2007 Demaq - p. 9/20
Demaq QML Rules Introduction Demaq ● Demaq Application ■ "If the delivery of all items has been confirmed, ● Demaq Language(s) ● Demaq QML Rules send a completion message to the customer" ● Demaq Sample Rule ● Demaq Server ● Messages all the way ● Demaq Project ● Thank you Appendix XQuery Update Facility + Queuing Primitives XML messages new XML messages − → Carl-Christian Kanne, January 8, 2007 Demaq - p. 9/20
Demaq Sample Rule Introduction create rule sendComplete for orderMsgs Demaq i f then ● Demaq Application ( / / deliverymsg / @type = " confirm " ) ● Demaq Language(s) ● Demaq QML Rules l e t fn : count ( qs : slice ( ) / / ordermsg / / item ) $ordered := ● Demaq Sample Rule ● Demaq Server l e t fn : count ( qs : slice ( ) / / deliverymsg / item ) $delivered := ● Messages all the way ● Demaq Project where $ordered eq $delivered ● Thank you Appendix return do enqueue <done> { / / orderID } </done> into customerReply Carl-Christian Kanne, January 8, 2007 Demaq - p. 10/20
Demaq Server Demaq Application Introduction Queue Queue Demaq Network Gateway ● Demaq Application Queue ● Demaq Language(s) Gateway ● Demaq QML Rules Queue Queue ● Demaq Sample Rule ● Demaq Server Application Rules (QML) ● Messages all the way ● Demaq Project Transport ● Thank you Appendix Rule Message Queues (QDL) Engine Transactional Queue Queue XML Gateway Queue Store Gateway Queue Queue Demaq Server Demaq Language Carl-Christian Kanne, January 8, 2007 Demaq - p. 11/20
Messages all the way ■ Everything is an XML message Introduction ◆ Rule Input Demaq ● Demaq Application ◆ Rule Output ● Demaq Language(s) ● Demaq QML Rules ● Demaq Sample Rule ◆ Errors ● Demaq Server ● Messages all the way ◆ Timeouts ● Demaq Project ● Thank you ■ Messages are processed once, but kept "forever" Appendix ■ Message History ◆ captures process state ◆ organized into slices (virtual queues) ◆ declarative expiration Carl-Christian Kanne, January 8, 2007 Demaq - p. 12/20
Demaq Project Demaq Application Introduction Queue Queue Demaq Network Gateway ● Demaq Application Queue ● Demaq Language(s) Gateway ● Demaq QML Rules Queue Queue ● Demaq Sample Rule ● Demaq Server Application Rules (QML) ● Messages all the way ● Demaq Project QEP Transport ● Thank you Appendix QEP Rule Message Queues (QDL) Engine Transactional QEP Queue Queue XML Gateway Queue Store Gateway Queue Queue Demaq Compiler Demaq Server Demaq Language Carl-Christian Kanne, January 8, 2007 Demaq - p. 13/20
Thank you Introduction Demaq ● Demaq Application http://demaq.net ● Demaq Language(s) ● Demaq QML Rules ● Demaq Sample Rule ● Demaq Server ● Messages all the way ● Demaq Project http://db.informatik.uni-mannheim.de ● Thank you Appendix Carl-Christian Kanne, January 8, 2007 Demaq - p. 14/20
Slices Requests Queue Introduction ... 23 47 9 42 Demaq Appendix Orders Queue ● Slices ● Slice usage ... 23 42 23 7 ● Error Handling Delivery Notifications Queue ● A Demaq Rule ● Work in progress ... 15 47 23 ● Demaq Goals Queues Slices ... ... ... 23 23 23 23 42 42 Slice for customer 23 Slice for customer 42 create property customerID fixed queue requests , orders , value d e l i v e r y N o t i f i c a t i o n s / / customerID create slicing customers on customerID Carl-Christian Kanne, January 8, 2007 Demaq - p. 15/20
Slice usage ■ Merge parallel control flow Introduction Demaq Check Credit Rating Appendix ● Slices Check Export ● Slice usage Restrictions Send/Refuse ● Error Handling Offer ● A Demaq Rule Check Plant ● Work in progress Capacity ● Demaq Goals Check Setup Costs create property fixed c o r r e l a t i o n I D queue creditCheck , exportCheck , setupCheck value plantCheck , / / c o r r e l a t i o n I D create slicing checkResults on c o r r e l a t i o n I D create rule merge for checkResults i f ( count ( qs : slice ( ) ) eq 4) then . . . Carl-Christian Kanne, January 8, 2007 Demaq - p. 16/20
Recommend
More recommend