1+
2+ CREATE type Message_type as object (subject VARCHAR2 (30 ), text VARCHAR2 (80 ));
3+ /
4+ -- Creating an Object type queue
5+ BEGIN
6+ DBMS_AQADM .CREATE_TRANSACTIONAL_EVENT_QUEUE (
7+ queue_name => ' objType_TEQ' ,
8+ storage_clause => null ,
9+ multiple_consumers => true,
10+ max_retries => 10 ,
11+ comment => ' ObjectType for TEQ' ,
12+ queue_payload_type => ' Message_type' ,
13+ queue_properties => null ,
14+ replication_mode => null );
15+ DBMS_AQADM .START_QUEUE (queue_name=> ' objType_TEQ' , enqueue => TRUE, dequeue=> True);
16+ END;
17+ /
18+
19+ -- Creating a RAW type queue:
20+ BEGIN
21+ DBMS_AQADM .CREATE_TRANSACTIONAL_EVENT_QUEUE (
22+ queue_name => ' rawType_TEQ' ,
23+ storage_clause => null ,
24+ multiple_consumers => true,
25+ max_retries => 10 ,
26+ comment => ' RAW type for TEQ' ,
27+ queue_payload_type => ' RAW' ,
28+ queue_properties => null ,
29+ replication_mode => null );
30+ DBMS_AQADM .START_QUEUE (queue_name=> ' rawType_TEQ' , enqueue => TRUE, dequeue=> True);
31+ END;
32+ /
33+
34+ -- Creating JSON type queue:
35+ BEGIN
36+ DBMS_AQADM .CREATE_TRANSACTIONAL_EVENT_QUEUE (
37+ queue_name => ' jsonType_TEQ' ,
38+ storage_clause => null ,
39+ multiple_consumers => true,
40+ max_retries => 10 ,
41+ comment => ' jsonType for TEQ' ,
42+ queue_payload_type => ' JSON' ,
43+ queue_properties => null ,
44+ replication_mode => null );
45+ DBMS_AQADM .START_QUEUE (queue_name=> ' jsonType_TEQ' , enqueue => TRUE, dequeue=> True);
46+ END;
47+ /
48+ DECLARE
49+ subscriber sys .aq $_agent;
50+ BEGIN
51+ subscriber := sys .aq $_agent(' teqBasicObjSubscriber' , NULL , NULL );
52+ DBMS_AQADM .ADD_SUBSCRIBER (queue_name => ' objType_TEQ' , subscriber => subscriber);
53+
54+ subscriber := sys .aq $_agent(' teqBasicRawSubscriber' , NULL , NULL );
55+ DBMS_AQADM .ADD_SUBSCRIBER (queue_name => ' rawType_TEQ' , subscriber => subscriber);
56+
57+ subscriber := sys .aq $_agent(' teqBasicJsonSubscriber' , NULL , NULL );
58+ DBMS_AQADM .ADD_SUBSCRIBER (queue_name => ' jsonType_TEQ' , subscriber => subscriber);
59+ END;
60+ /
61+ select * from ALL_QUEUES where OWNER= ' DBUSER' and QUEUE_TYPE= ' NORMAL_QUEUE' ;
62+ /
63+ EXIT;
0 commit comments