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
VWRUDJHGLVNRUQRQSHUVLVWHQWLQPHPRU\
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/<4
3ROOTXHXHIRUUHTXHVWV
3XWUHSOLHVRQ5(3/<4
704)25:$5'
6\QFKRQRXVFDOO
4XHXH
6SDFH
SERVICE Queue1
{...
tpreturn()
}
6HUYHU
BEA Tuxedo Application Administration
© BEA Systems, Inc.
CQUE-8
Store and Forward with TMQFORWARD
This example illustrates how the system might use a QUEUE SPACE with three queues in
conjunction with service forwarding:
1. The client enqueues a request for “Queue1”.
2. The BEA Tuxedo server, TMQUEUE, receives the request and stores it on the queue for
“Queue1”.
3. When this has been done successfully, the client receives a positive response.
4. The BEA Tuxedo server, TMQFORWARD, dequeues the request at the specified time.
5. TMQFORWARD sends the request to service “Queue1” in transaction mode.
6. The service “Queue1” returns to TMQFORWARD upon completion of processing.
7. TMQFORWARD puts the reply on the queue “REPLYQ.”
8. The client issues a request to read any replies which may be queued.
9. TMQUEUE receives the request and removes the reply from the reply queue.
10. TMQUEUE returns to the client with the reply form.
The TMQFORWARD server would be needed only if the messages queued required that a service
call be made. For example, the queue could be used for inter-process (Tuxedo client or server)
communication where one process puts the message on the queue and another removes it, as shown
in the “Basic Peer-to-Peer Example: /Q” on the preceding page.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-8
BEA Tuxedo Application Administration
CQUE
Review
ƒ In this section we talked about
¾ an
overview of the Tuxedo /Q subsystem
¾ the components of the /Q subsystem,
including the Tuxedo /Q Servers
BEA Tuxedo Application Administration
© BEA Systems, Inc.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-9
CQUE-9
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-10
CQUE-10
BEA Tuxedo Application Administration
CQUE
Section
/Q Configuration and
Administration
2
At the end of this section you will be able to
• configure the TMQUEUE Server
• configure the TMQFORWARD Server
• use qmadmin to create Qspaces and Queues
BEA Tuxedo Application Administration
© BEA Systems, Inc.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-11
CQUE-11
BEA Tuxedo Application Administration
CQUE
GROUPS Configuration
ƒ In the *GROUPS section
¾ Add
a separate group for each queue space
¾ Add the TMS server, TMS_QM , for the group
¾ Configure the OPENINFO string for TMS_QM ; it
must contain a Queue Space name
UBBCONFIG
...
#For Windows, OPENINFO=“... :MyQSPACE” becomes “...;MyQSPACE”
*GROUPS
$OZD\V706B40
QUE1
4XHXH6SDFH'HYLFH
LMID = SITE1
GRPNO=2
TMSNAME = TMS_QM
TMSCOUNT = 4
OPENINFO = “Tuxedo/QM:/home/QUEFS:MyQSPACE”
...
4XHXH6SDFH1DPH
$OZD\V7X[HGR40
BEA Tuxedo Application Administration
© BEA Systems, Inc.
CQUE-12
/Q Configuration
*GROUPS Section
The *GROUPS section must contain a separate group for each queue space. Each such server
group entry must contain the following:
• The transaction server, TMS_QM
• The OPENINFO string necessary for the queue space associated with the group
In the UNIX example on the slide, a group QUE1 is listed with a transaction server TMS_QM. The
store and forward queue Resource Manager name is “Tuxedo/QM.” This is the name listed in the
RM file found under $TUXDIR/udataobj (UNIX) or %TUXDIR%\udataobj (Windows). In
this string, the full path name (either a file name or UNIX raw device name) of the queue space
device and a queue space name needs to be specified.
Note the slightly different syntax for the OPENINFO string for UNIX and Windows systems:
# UNIX
TMQUEUEGRP1 GRPNO=1 TMSNAME=TMS_QM
OPENINFO="TUXEDO/QM:/home/QUEFS:MyQSPACE"
# For Windows, : MyQSPACE becomes ; MyQSPACE
TMQUEUEGRP2 GRPNO=2 TMSNAME=TMS_QM
OPENINFO="TUXEDO/QM:c:\QUEFS;MyQSPACE "
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-12
BEA Tuxedo Application Administration
CQUE
SERVERS: TMQUEUE Server
*SERVERS Section: TMQUEUE
6\QWD[
TMQUEUE CLOPT="-s qspace:TMQUEUE -- [-t timeout]"
3DUDPHWHUV
-s qspace:TMQUEUE
$ OLDVHVWKH4XHXH6SDFHQDPHDVDVHUYLFHQDPHWRWKHVHUYLFH
IXQFWLRQQDPHG7048(8(HQDEOHVUHTXHVWVWREHVHQWWR
7048(8(XVLQJWKH4XHXH6SDFHQDPH
-t timeout
7LPHRXWYDOXHXVHGIRUHQTXHXHRUGHTXHXHRSHUDWLRQVGHIDXOW
VHFV
UBBCONFIG
*SERVERS
TMQUEUE SRVGRP=QUE1 SRVID=1
CLOPT = "-s MyQSPACE:TMQUEUE -- -t 20´
BEA Tuxedo Application Administration
© BEA Systems, Inc.
CQUE-13
/Q Configuration
*SERVERS Section: TMQUEUE(5)
List the server TMQUEUE as a regular server in the *SERVERS section of the
UBBCONFIG file. There are some boot options for this server.
Syntax
TMQUEUE CLOPT="-s qspacename:TMQUEUE -- [-t timeout]"
Parameters
-s qspace:TMQUEUE
Defines the qspace name as a service that will be advertised by the TMQUEUE server.
This allows requests that involve the queue space to be sent to the request queue of the
TMQUEUE server by referencing the qspace name. TMQUEUE is a built-in service
function in the TMQUEUE server. The -s option aliases the qspacename to the
TMQUEUE service.
-t timeout
A timeout value for queue operations to complete. The default is 30 seconds.
Example
In the example on the slide, the server TMQUEUE offers the service MYSERVICE, with a timeout
of 60 seconds.
For a complete list of options with this server, refer to the TMQUEUE(5) section in the BEA Tuxedo
reference documentation.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-13
BEA Tuxedo Application Administration
CQUE
SERVERS: TMQFORWARD Server
*SERVERS Section: TMQFORWARD
6\QWD[
TMQFORWARD CLOPT="-- -q qname[,qname...] [-t trantime]
[-i idletime] [-e] [-d] [-n] [-f delay]"
3DUDPHWHUV
-q qname[,qname...]
-t option
-i idletime
/LVWRITXHXHVIURPZKLFKWKHVHUYHUIRUZDUGVPHVVDJHVPDQGDWRU\
$WUDQVDFWLRQWLPHRXWYDOXH'HIDXOWLVVHFRQGV
7KHWLPHWKHVHUYHULVLGOHDIWHUDOOWKHUHDGTXHXHVDUHGUDLQHG
'HIDXOWLVVHFRQGV
-e
-d
&DXVHVWKHVHUYHUWRH[LWLIWKHUHDUHQRPHVVDJHVRQLWVTXHXHV
&DXVHVPHVVDJHVWKDWUHVXOWLQDVHUYLFHIDLOXUHWREHGHOHWHGIURPWKH
TXHXH,IDIDLOXUHTXHXHLVVSHFLILHGWKHUHSO\LVSODFHGWKHUH
-n
-f delay
6HQGVPHVVDJHVZLWKWKH731275$1IODJVHW
6HQGVPHVVDJHVXVLQJWSIRUZDUG ZLWKGHOD\ LQWHUYDO
BEA Tuxedo Application Administration
© BEA Systems, Inc.
CQUE-14
Parameters
-q qname[,qname...]
A comma separated list of queues from which the server will
forward messages. This is mandatory.
-t option
Transaction timeout value. The default is 60 seconds.
-i idletime
Time the server is idle after all the queues it is reading are drained.
The default is 60 seconds; a value of 0 causes the server to
continuously read its queues.
-e
Causes the server to exit if it there are no messages on its queues.
-d
Causes messages that result in a service failure to be deleted from
the queue. If a failure queue is specified, the reply is placed there.
If the original message is to be deleted at the same time as the retry
limit is reached, the original message will be put in the error queue.
-n
Causes is used to cause messages to be sent using the
TPNOTRAN flag. This flag allows for forwarding to server groups
that are not associated with a resource manager.
-f delay
Causes the server the server to forward the message to the service
instead of using tpcall. The message is sent such that a reply is not
expected from the service. The TMQFORWARD server does not
block waiting for the reply from the service and can continue
processing the next message from the queue. To throttle the system
such that TMQFORWARD does not flood the system with
the delay numeric value can be used to indicate a delay, in seconds,
between processing requests; use zero for no delay.
requests,
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-14
BEA Tuxedo Application Administration
CQUE
TMQFORWARD Configuration Example Of Relationships
...
UBBCONFIG
*GROUPS
QUE1
LMID = SITE1
GRPNO=2
TMSNAME = TMS_QM
TMSCOUNT = 4
OPENINFO = “Tuxedo/QM:/home/QUEFS:MyQSPACE”
APPGRP TMSNAME=TMS ...
4XHXH6SDFH1DPH
*SERVERS
TMQUEUE SRVGRP=QUE1 SRVID=1 CLOPT="-s MyQSPACE:TMQUEUE”
/2$16 LVD4XHXHLQ0\463$&(
TMQFORWARD
SRVGRP=QUE1
SRVID=5
CLOPT=´-- -q LOANS´
4XHXH1DPHPDWFKHV6HUYLFH1DPH
LOANSVR
SRVGRP=APPGRP
SRVID=10
CLOPT=´-s LOANS´
BEA Tuxedo Application Administration
© BEA Systems, Inc.
CQUE-15
In the example on the slide, the application server LOANSVR is configured to be in a separate
server group, APPGRP, supported by the null TMS server, TMS. This enables the LOANS service
to be called within a distributed transaction.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-15
BEA Tuxedo Application Administration
CQUE
qmadmin (1)
ƒ qmadmin(1): create and manage queue
spaces and queues
ƒ Creating a Queue Space and Queues with
qmadmin
¾ Specify
the path to a file, or raw disk device,
where the queue filesystem is to be located
¾ Format this file system and create a minimum
of one queue space
¾ Open the created queue space and create the
named queues
BEA Tuxedo Application Administration
© BEA Systems, Inc.
CQUE-16
Store and Forward Queue Administration - qmadmin
Create and manage a queue space and queues with the qmadmin(1) administration utility.
Before running qmadmin, you must specify the path to a file, or for raw disk slice mount point,
where the queue filesystem is to be located.
Next, you must format this file system and create a minimum of one queue space.
Finally, to configure individual queues, you must open a queuespace and define queues.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-16
BEA Tuxedo Application Administration
CQUE
Defining the /Q Filesystem
ƒ Use QMCONFIG environment variable to
specify the path to the queue space file
system; can also specify a value for
QMCONFIG on command line of qmadmin
81,;([DPSOH
QMCONFIG=/dev/dsk/c0b0t0d0s; export QMCONFIG
qmadmin
:LQGRZV([DPSOH
set QMCONFIG=c:\apps\QUEFS
qmadmin
81,;([DPSOH6SHFLI\LQJWKH )LOHV\VWHP DVDILOHRQFRPPDQGOLQH
qmadmin
/home/student01/QUEFS
BEA Tuxedo Application Administration
© BEA Systems, Inc.
CQUE-17
Defining the Physical Location for the /Q Filesystem
The queue space is contained in a BEA Tuxedo file system. You may add queue spaces to an
existing file system, or create a new one. As a matter of practice, the only time you put multiple files
in a /T file system is when the file system is allocated as a raw disk slice.
Use the QMCONFIG environment variable to identify the location of the /T file system that contains
the queue space in order to use qmadmin. QMCONFIG should be set by exporting it directly into
the environment prior to running the qmadmin command, or by specifying the filesystem path as
an argument to the qmadmin command.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-17
BEA Tuxedo Application Administration
CQUE
qmadmin
ƒ Used to create, modify, and view queue
spaces and queues
ƒ Partial List of qmadmin commands
&RPPDQG
crdl
qspacecreate
qopen
qcreate
qset
qlist
qinfo
qdestroy
&UHDWHDQHQWU\LQWKH8QLYHUVDO'HYLFH/LVW8'/
&UHDWHDTXHXHVSDFHILOHLQWKH7ILOHV\VWHP
2SHQVDTXHXHVSDFHWRDGGPRGLI\TXHXHGHILQLWLRQV
'HILQHTXHXHVLQWKHFXUUHQWO\RSHQTXHXHVSDFH
6HWVWKHTXHXHQDPHXVHGE\RWKHUFRPPDQGV
/LVWVPHVVDJHVRQDTXHXHVSHFLILHGE\TVHW
/LVWVLQIRUPDWLRQIRUDTXHXHRUIRUDOOTXHXHV
'HVWUR\WKHQDPHGTXHXH
BEA Tuxedo Application Administration
© BEA Systems, Inc.
CQUE-18
qmadmin
The Tuxedo queue administration program qmadmin(1) can be used to create, modify, and view
message queues.
Syntax of Partial List of qmadmin Commands:
crdl [device [offset [size]]]
qspacecreate [-n nonpersistent_msg_memory[b,B]] parameters ...
qopen [queue_space_name]
qcreate [queue_name [qorder [out_of_order [retries [delay [high
[low [cmd]]]]]]]] [-d persist|nonpersist] [-n nhigh,nlow,ncmd]
qset [queue_name]
qlist
qinfo [queue_name]
qdestroy [-p|-f] [-y] [queue_name]
For Tuxedo 7.1, 8.0 Memory-based Queues
[-n nonpersistent_msg_memory[b,B]]
The -n option specifies the size of memory to reserve in shared memory to hold non-persistent
messages for all queues in the queue space. The memory size may be specified in bytes (number
followed by a “b” suffix) or in blocks (B) where the block size is equivalent to the disk block size.
The [b.B] suffix is optional for -n.
Copyright © BEA Systems, Inc.
.
All Rights Reserved. Unauthorized Duplication Prohibited
CQUE-18
BEA Tuxedo Application Administration
CQUE
qmadmin(1) Example
qmadmin - Copyright 1987 BEA; 1991 USL.
QMCONFIG=/home/QUEFS
> crdl /home/QUEFS
Starting Offset: 0
Size in disk pages: 1000
Created device /home/QUEFS, offset 0, size 1000
> 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