CQUE The /Q Queue Subsystem
Short Description
Download CQUE The /Q Queue Subsystem...
Description
BEA Tuxedo Application Administration
CQUE
Module
CQUE The /Q Queue Subsystem At the end of this module you will ¾ understand store and forward queuing ¾ understand where and how the /Q subsystem can be used by applications ¾ configure the queuing subsystem to support applications that use the queuing feature
BEA Tuxedo Application Administration © BEA Systems, Inc.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-1
CQUE-1
BEA Tuxedo Application Administration
CQUE
Road Map
/Q Subsystem Overview /Q Configuration and Administration Lab Workshop
BEA Tuxedo Application Administration © BEA Systems, Inc.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-2
CQUE-2
BEA Tuxedo Application Administration
CQUE
Section
1 /Q Subsystem Overview At the end of this section you will • understand store and forward queuing • understand how the /Q subsystem can be used • identify the main components of /Q
BEA Tuxedo Application Administration © BEA Systems, Inc.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-3
CQUE-3
BEA Tuxedo Application Administration
CQUE
Review: /Q Subsystem &OLHQW (QTXHXHUHTXHVW WR“RequestQ”
6HUYHU
6HUYLFH
RequestQ
'HTXHXH UHSO\ IURP“ReplyQ”
ReplyQ
&OLHQW4XHXHV5HTXHVW
6HUYHU5HDGV5HTXHVW
&OLHQW5HDGV5HSO\
6HUYLFH4XHXHV5HSO\
BEA Tuxedo Application Administration © BEA Systems, Inc.
CQUE-4
Store and Forward There are two important aspects of the store and forward paradigm: • The target of the message (the receiver) does not have to be running at the time the message is “sent” as it is stored in a queue for later recovery by the target • The target of the message is free to recover the request at some (later) time most appropriate for processing the message The store and forward paradigm is a variation of the request/reply paradigm, where the processing by the server is to be deferred for a period of time. Such deferral may be due to a deliberate aspect of the application’s design, or it may be a consequence of a service being unavailable. BEA Tuxedo supports the store and forward paradigm through its stable-storage and shared memory queuing facility (/Q). The slide illustrates a typical example of a store and forward data flow. An example of use of the Store and Forward paradigm is to capture an input request when the database is not “up” at the time but the transaction can be processed later and the result can be communicated back to the originating end-user by some means, for example an e-mail message or receipt via postal mail. With the Tuxedo 6.5 and earlier releases, persistent storage (disk) was the only mechanism for the store and forward messages to guard against loss of messages.However, the feature has been extended in Tuxedo 7.1, 8.0 to allow for the message store to be memory-based instead of disk. While this has the obvious disadvantage of loss of messages in case of system failure, it also provides a very fast store/retrieve facility for some type of applications that can tolerate some message loss in the event of a system hardware or software failure.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-4
BEA Tuxedo Application Administration
CQUE
/Q Features Overview
The Tuxedo /Q component provides a
means of storing requests for deferred processing and fowarding stored messages Requests are “safe-stored” to disk storage ¾ Requests
can also be held in memory for faster access but with less reliability (not 6.5)
Messages in queues may be ordered in various ways ¾ first
in-first out (FIFO), time-based,...
The /Q subsystem is managed as an XA resource with a provided TMS BEA Tuxedo Application Administration © BEA Systems, Inc.
CQUE-5
Overview of /Q Features Tuxedo System /Q allows messages to be queued to stable storage. ATMI provides functions to directly add or remove messages to/from these queues. Reply messages and error messages can be queued for later return to client programs. An administrative command utility is provided for creating, listing, and modifying the queues. Prewritten servers are included to accept requests to enqueue and dequeue messages, to forward messages from the queue for processing, and to manage the transactions that involve the queues. Access to the /Q subsystem is provided by an X/OPEN XA-compliant resource manager interface. This interface is necessary so that enqueuing and dequeuing can be done as part of a two-phase committed transaction in coordination with other XA-compliant resource managers. In Tuxedo 7.1 & 8.0, /Q queues can also be configured to be memory based instead of only disk based. This feature was introduced because the model of queueing/dequeuing requests is so useful that it can also be used for applications that benefit from this feature but are not too concerned about loss of messages should a failure occur. Typically such applications either do not care about the lost messages (they can be repeated) or the messages are also stored in some other place and can be resent. Also the reliability of systems and software has increased considerably and a failure is less likely to occur compared to the period when the /Q subsystem was first introduced.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-5
BEA Tuxedo Application Administration
CQUE
Tuxedo /Q Components 7HUP QUEUE SPACE
'HILQLWLRQ $SUHDOORFDWHGVWRUDJHVSDFHRIIL[HGVL]HLQZKLFKDFROOHFWLRQ RITXHXHVPD\EHFUHDWHG$FWVDVDNLQGRIIROGHURUGLUHFWRU\ IRUTXHXHVH[FHSWWKDWDFWXDOVSDFHLVDOORFDWHGIRUWKHTXHXH VSDFH 1DPHGVHJPHQWRIVWRUDJHDUHDZLWKLQDTXHXHVSDFHZKHUH PHVVDJHVDUHVWRUHG6WRUDJHDUHDFDQEHHLWKHUSHUVLVWHQW VWRUDJHGLVN RUQRQSHUVLVWHQWLQPHPRU\
QUEUE
$GPLQLVWUDWLRQ 7X[HGRDGPLQLVWUDWLRQSURJUDPIRUWKHVWRUHDQGIRUZDUG4
qmadmin
VXEV\VWHP6 LPLODULQXVDJHWRtmadmin
46HUYHUV TMQUEUE TMQFORWARD
3ODFHVDQGUHWULHYHVPHVVDJHVRQWKHUHTXHVWHGTXHXH 2SWLRQDO 'HTXHXHVDQGIRUZDUGVPHVVDJHVWRDSSOLFDWLRQ VHUYLFHV 7X[HGR4706IRUDTXHXHVSDFHFRRUGLQDWHVTXHXH RSHUDWLRQVZLWKLQDGLVWULEXWHGWUDQVDFWLRQ
TMS_QM
BEA Tuxedo Application Administration © BEA Systems, Inc.
CQUE-6
Terms and Definitions QUEUE Named storage area where messages are stored. Storage area can be either persistent (storage disk) or non-persistent (in-memory). QUEUE SPACE A pre-allocated storage space of fixed size where a collection of queues may be stored Administration qmadmin BEA Tuxedo /Q queue manager administration program Supplied Servers TMQUEUE BEA Tuxedo server process that manages a queue space often called the “queue manager” TMQFORWARD BEA Tuxedo server process that “watches” for messages on specified queues and then calls specified services using the message as input to the service request APPQ_MIB The programmatic interface to BEA Tuxedo/Q queue manager administration TMS_QM BEA Tuxedo server process that manages transactions for /Q Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-6
BEA Tuxedo Application Administration
CQUE
Basic Peer-to-Peer /Q Example &OLHQW
3 1
tpenqueue(“Queue1”)
2 TMQUEUE
5HDGZULWHPHVVDJHV
4XHXH
4XHXH 6SDFH
5
tpdequeue(“Queue1”)
4 6
&OLHQW
BEA Tuxedo Application Administration © BEA Systems, Inc.
CQUE-7
Basic Peer-to-Peer /Q Example This example shows how the system would use a QUEUE SPACE with one queue for peer-to-peer communication: (1) The first client enqueues a request on “Queue1” witht the ATMI tpenqueue() function call. (2) The BEA Tuxedo server, TMQUEUE, receives the request and stores it on the queue “Queue1.” (3) When this has been done successfully, the tpenqueue() function in the client completes without error. (4) The second client issues a request with tpdequeue() to read any items that may be queued in “Queue1.” (5) TMQUEUE receives the request and reads the request data from the queue. (6) TMQUEUE returns the stored message to the second client with the completion of the tpdequeue() function call. Note: Although the example in the diagram shows clients, these could also be (Tuxedo) servers performing the tpenequeue() and tpdequeue() functions.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-7
BEA Tuxedo Application Administration
CQUE
Store and Forward with TMQFORWARD $OOHQTXHXHVGHTXHXHV
tpenqueue (“Queue1”)
&OLHQW
tpdequeue (“REPLYQ”)
7048(8( 5HDGZULWHPHVVDJHV
4XHXH 4XHXH 4XHXH 5(3/ qspacecreate -n 1000 2SWLRQDO $GGLWLRQDO Queue space name: MyQSPACE VKDUHGPHPRU\VL]HLQ IPC Key for queue space: 62639 Size of queue space in disk pages: 500 EORFNVIRUQRQSHUVLVWHQW PHVVDJHVQRWLQ Number of queues in queue space: 6 Number of concurrent transactions in queue space:36 Number of concurrent processes in queue space: 12 Number of messages in queue space: 100 Error queue name: errque Initialize extents (y, n [default=n]): y 3URFHVVHVWKDWDWWDFK Blocking factor [default=16]: 16 GLUHFWO\WRWKLVTVSDFH ...
BEA Tuxedo Application Administration © BEA Systems, Inc.
CQUE-19
qmadmin(1) Example The example of qmadmin(1) has been modified slightly to fit on the slide. It also uses the nonpersistent features that are not available in Tuxedo 6.5; in this case or in 7.1/8.0, if only persistent storage is required, leave out the -n 1000. 1. A file of 1000 pages is created on the device /home/QUEFS using the crdl command. For Windows systems, the command is as follows: crdl C:\apps\QUEFS • A queue space, MyQSPACE, is created with 1000 blocks of memory for non-persistent storage, and 500 pages of disk space for persistent query. This is done using the qspacecreate command. The queue space will contain up to six queues. • The processes that can attach to a queuespace are TMQUEUE, TMQFORWARD, TMS_QM, and qmadmin.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-19
BEA Tuxedo Application Administration
CQUE
...qmadmin(1) Example $WWKHSURPSWWKHGHIDXOWYDOXHIRUD SDUDPHWHULVGLVSOD\HGDV>GHIDXOW @ 7RVHOHFWWKHGHIDXOWW\SH(QWHU! >qopen MyQSPACE >qcreate Queue name: MyQueue Queue order (priority, time, fifo, lifo): fifo Out-of-ordering enqueuing (top, msgid,): none Retries [default=0]: 2 Retry delay in seconds [default=0]: 30 High limit for queue capacity warning: 80% Reset (low) limit for queue capacity warning: 0% Queue capacity command: highwarning -sh No default queue capacity command Queue MyQueue created
BEA Tuxedo Application Administration © BEA Systems, Inc.
CQUE-20
The queue space, MyQSPACE, is opened with the qopen command. 3. The queue, MyQueue, is created in the queue space MyQSPACE using the qcreate command. It will be a FIFO queue and it will not allow reordering. The message may be dequeued up to two times, if necessary. The default behavior for this queue is to store messages on disk. Also, when 80% of the queue capacity is filled, the shell command “high warning -sh” automatically is spawned to generate a warning. 4. qmadmin(1) will prompt the user interactively for values, or it can be run from a shell (script) file. Note: The output will look slightly different on a Windows system.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-20
BEA Tuxedo Application Administration
CQUE
...qmadmin(1) Example
BEA Tuxedo Application Administration © BEA Systems, Inc.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-21
CQUE-21
BEA Tuxedo Application Administration
CQUE
Review
In this section we talked about ¾ adding
UBBCONFIG configuration entries to support a /Q queuing application ¾ using the qmadmin utility to create qspaces and queues to hold the queued messages
BEA Tuxedo Application Administration © BEA Systems, Inc.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-22
CQUE-22
BEA Tuxedo Application Administration
CQUE
Review
In this module we discussed store and forward queuing concepts ¾ the components of the /Q subsystem ¾ configuring /Q subsystem related entries in the UBBCONFIG configuration file ¾ using the qmadmin utility to create qspaces and queues ¾
BEA Tuxedo Application Administration © BEA Systems, Inc.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-23
CQUE-23
BEA Tuxedo Application Administration
CQUE
Lab Workshop
Please refer to the Lab Exercises guide and do lab CQUE. The suggested time for this lab is 60 minutes. The Instructor will determine when it is appropriate to stop.
BEA Tuxedo Application Administration © BEA Systems, Inc.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-24
CQUE-24
View more...
Comments