Upload
nareshy
View
219
Download
0
Embed Size (px)
Citation preview
8/9/2019 Oracle AQs Presentation
1/15
Oracle
Advanced QueuingNaresh Kumar YNaresh Kumar Y
8/9/2019 Oracle AQs Presentation
2/15
AgendaAgenda
IntroductionIntroduction Environment setupEnvironment setup Packages to manage AQsPackages to manage AQs
PayloadPayload Queue tableQueue table Create QueueCreate Queue Grant privilegesGrant privileges essage propertiesessage properties En!eue optionsEn!eue options En!ueue messageEn!ueue message "e!eue options"e!eue options "e!ueue message"e!ueue message
8/9/2019 Oracle AQs Presentation
3/15
IntroductionIntroduction
E#changing messages andE#changing messages and
communicating bet$een t$o or morecommunicating bet$een t$o or more
di%erent application modulesdi%erent application modules
8/9/2019 Oracle AQs Presentation
4/15
Environment setupEnvironment setup
Administration and access privilegesAdministration and access privileges
&or advanced !ueuing are controlled&or advanced !ueuing are controlled
using the belo$ t$o rolesusing the belo$ t$o roles
AQ'A"INI()*A)+*'*+,E - Allo$sAQ'A"INI()*A)+*'*+,E - Allo$s
creation and administration o& !ueuingcreation and administration o& !ueuing
in&rastructure.in&rastructure.
AQ'/(E*'*+,E - Allo$s access toAQ'/(E*'*+,E - Allo$s access to!ueues &or en!ueue and de!ueue!ueues &or en!ueue and de!ueue
operations.operations.
8/9/2019 Oracle AQs Presentation
5/15
Packages to manage AQsPackages to manage AQs
"0('AQA" - )o per&orm belo$"0('AQA" - )o per&orm belo$
Admin operations like creatingAdmin operations like creating
!ueue1 !ueue tables1 stop !ueue1!ueue1 !ueue tables1 stop !ueue1
drop !ueue etc.drop !ueue etc.
"0('AQ - )o manage the Queues"0('AQ - )o manage the Queues
like en!ueue1 de!ueue etc.like en!ueue1 de!ueue etc.
8/9/2019 Oracle AQs Presentation
6/15
PayloadPayload
AQ handles messages kno$n asAQ handles messages kno$n as
payloads.payloads.
)he &ormat and structure o& the)he &ormat and structure o& themessages are designed by payloadmessages are designed by payload
Payload type can be either user-Payload type can be either user-
de2ned ob3ects 1 #ml type1 ANY"A)A1de2ned ob3ects 1 #ml type1 ANY"A)A1
*A4.*A4.
8/9/2019 Oracle AQs Presentation
7/15
Queue tableQueue table
Queue table store the !ueue in&ormationQueue table store the !ueue in&ormation 4e can create multiple !ueues &or the4e can create multiple !ueues &or the
single !ueue tablesingle !ueue table
Create !ueue table using the "0('AQCreate !ueue table using the "0('AQpackage.package. E#ample 55E#ample 55
"0('AQA".create'!ueue'table"0('AQA".create'!ueue'table
6!ueue'table 786!ueue'table 789##'event'!ueue'tbl919##'event'!ueue'tbl91
!ueue'payload'type 78 9customer'msg9!ueue'payload'type 78 9customer'msg9
:;:;
8/9/2019 Oracle AQs Presentation
8/15
8/9/2019 Oracle AQs Presentation
9/15
Grant privilegesGrant privileges
A&ter creating and starting !ueue1 $e needA&ter creating and starting !ueue1 $e need
to give grants to user schema to manageto give grants to user schema to manage
the !ueues.the !ueues.
E#ampleE#ample"0('AQA".grant'!ueue'privilege"0('AQA".grant'!ueue'privilege
6 privilege 78 9A,,916 privilege 78 9A,,91
!ueue'name 78 9a!'admin.event'!ueue91!ueue'name 78 9a!'admin.event'!ueue91grantee 78 9a!'user>grantee 78 9a!'user>
:;:;
8/9/2019 Oracle AQs Presentation
10/15
Message PropertiesMessage Properties
0e&ore en!ueue a message1 4e must0e&ore en!ueue a message1 4e must
create and set the properties o&create and set the properties o&
message by using the belo$ recordmessage by using the belo$ record
typetype "0('AQ.message'properties't;"0('AQ.message'properties't;
8/9/2019 Oracle AQs Presentation
11/15
Message Properties(Contd!Message Properties(Contd!
message_properties_tmessage_properties_t)YPE)YPEmessage'properties't I( *EC+*" 6message'properties't I( *EC+*" 6priority 0INA*Y'IN)EGE* "E@A/,) 1priority 0INA*Y'IN)EGE* "E@A/,) 1delay 0INA*Y'IN)EGE* "E@A/,) N+'delay1delay 0INA*Y'IN)EGE* "E@A/,) N+'delay1e#piration 0INA*Y'IN)EGE* "E@A/,) NEBE*1e#piration 0INA*Y'IN)EGE* "E@A/,) NEBE*1correlation BA*CA*D6D: "E@A/,) N/,,1correlation BA*CA*D6D: "E@A/,) N/,,1attempts 0INA*Y'IN)EGE*1attempts 0INA*Y'IN)EGE*1recipient'list a!F'recipient'list't1recipient'list a!F'recipient'list't1e#ception'!ueue BA*CA*D6: "E@A/,) N/,,1e#ception'!ueue BA*CA*D6: "E@A/,) N/,,1en!ueue'time "A)E1en!ueue'time "A)E1
state 0INA*Y'IN)EGE*1state 0INA*Y'IN)EGE*1sender'id a!F'agent "E@A/,) N/,,1sender'id a!F'agent "E@A/,) N/,,1original'msgid *A46H: "E@A/,) N/,,:;original'msgid *A46H: "E@A/,) N/,,:;
8/9/2019 Oracle AQs Presentation
12/15
Enqeue optionsEnqeue options
enqueue_options_tenqueue_options_t)YPE)YPE
en!ueue'options't I( *EC+*" 6en!ueue'options't I( *EC+*" 6
visibility 0INA*Y'IN)EGE* "E@A/,)visibility 0INA*Y'IN)EGE* "E@A/,)
+N'C+I)1+N'C+I)1relative'msgid *A46H: "E@A/,) N/,,1relative'msgid *A46H: "E@A/,) N/,,1
se!uence'deviation 0INA*Y'IN)EGE*se!uence'deviation 0INA*Y'IN)EGE*
"E@A/,) N/,,1"E@A/,) N/,,1trans&ormation BA*CA*D6HJ: "E@A/,)trans&ormation BA*CA*D6HJ: "E@A/,)
N/,,:;N/,,:;
8/9/2019 Oracle AQs Presentation
13/15
Enqueue messageEnqueue message
A&ter creating the !ueue1 $e can en!ueue theA&ter creating the !ueue1 $e can en!ueue the!ueue using "0('AQ!ueue using "0('AQ
E#ample 55E#ample 55 "0('AQ.en!ueue"0('AQ.en!ueue
6!ueue'name 78 9AQA"IN.=='C/()+E*'Q916!ueue'name 78 9AQA"IN.=='C/()+E*'Q91
en!ueue'options 78 a!'en!ueue'options1en!ueue'options 78 a!'en!ueue'options1message'properties 78message'properties 78
a!'message'properties1 payloada!'message'properties1 payload78 a!'message1 78 a!'message1
msgid 78 ra$'message'handlemsgid 78 ra$'message'handle:; :;
8/9/2019 Oracle AQs Presentation
14/15
"eqeue options"eqeue options
de!ueue'options't )YPE de!ueue'options't I(de!ueue'options't )YPE de!ueue'options't I(*EC+*" 6*EC+*" 6consumer'name BA*CA*D6J: "E@A/,) N/,,1consumer'name BA*CA*D6J: "E@A/,) N/,,1de!ueue'mode 0INA*Y'IN)EGE* "E@A/,)de!ueue'mode 0INA*Y'IN)EGE* "E@A/,)*E+BE1*E+BE1
navigation 0INA*Y'IN)EGE* "E@A/,)navigation 0INA*Y'IN)EGE* "E@A/,)NE=)'E((AGE1NE=)'E((AGE1visibility 0INA*Y'IN)EGE* "E@A/,) +N'C+I)1visibility 0INA*Y'IN)EGE* "E@A/,) +N'C+I)1$ait 0INA*Y'IN)EGE* "E@A/,) @+*EBE*1$ait 0INA*Y'IN)EGE* "E@A/,) @+*EBE*1msgid *A46H: "E@A/,) N/,,1msgid *A46H: "E@A/,) N/,,1
correlation BA*CA*D6D: "E@A/,) N/,,1correlation BA*CA*D6D: "E@A/,) N/,,1de!'condition BA*CA*D6LJJJ: "E@A/,) N/,,1de!'condition BA*CA*D6LJJJ: "E@A/,) N/,,1signature a!F'sig'prop "E@A/,) N/,,1signature a!F'sig'prop "E@A/,) N/,,1trans&ormation BA*CA*D6HJ: "E@A/,) N/,,1trans&ormation BA*CA*D6HJ: "E@A/,) N/,,1delivery'mode P,('IN)EGE* "E@A/,)delivery'mode P,('IN)EGE* "E@A/,)
PE*(I()EN):;PE*(I()EN):;
8/9/2019 Oracle AQs Presentation
15/15
"equeue message"equeue message
A&ter En!ueue the message1 4e can de!uue theA&ter En!ueue the message1 4e can de!uue the
message.message. E#ample 55E#ample 55
"0('AQ.de!ueue"0('AQ.de!ueue
6!ueue'name 78 9AQA"IN.=='C/()+E*'Q916!ueue'name 78 9AQA"IN.=='C/()+E*'Q91
de!ueue'options 78de!ueue'options 78
a!'de!ueue'options1a!'de!ueue'options1message'properties 78message'properties 78
a!'message'properties1 payloada!'message'properties1 payload
78 a!'message1 msgid78 a!'message1 msgid
78 ra$ message handle :; 78 ra$ message handle :;