You are on page 1of 22

2006 BEA Systems, Inc.

Tuxedo/Q Subsystem
Applications Administration
At the end of this module, you will be able to:
Understand the /Q subsystem architecture and
components
Configure Tuxedo application to support persistent
queues
Monitor and manage /Q subsystem messages using
qmadmin
Module 12
Tuxedo/Q Subsystem Applications Administration-1
2006 BEA Systems, Inc. 354
Road Map
1. /Q Subsystem Overview
/Q Components
/Q Architecture Examples
2. Configuring Tuxedo for /Q Support
Tuxedo/Q Subsystem Applications Administration-2
2006 BEA Systems, Inc. 355
Review: /Q Subsystem
















RequestQ
ReplyQ
Enqueue request
to RequestQ
Dequeue reply
from ReplyQ
Client
Service

Server
4
3
2
1
1. Client sends request to the /Q Subsystem
Server (message is stored to disk)
2. Message is forwarded on
to the appropriate service
4. Client later dequeues the reply
from the /Q Subsystem Server
3. Service sends reply to the /Q Subsystem
Server (message is stored to disk)
Tuxedo/Q Subsystem Applications Administration-3
2006 BEA Systems, Inc. 356
/Q Features Overview
The Tuxedo /Q Subsystem provides a means of storing
requests for deferred processing and forwarding stored
messages.
Requests are safe-stored to disk storage.
Requests can also be held in memory for faster access but
with less reliability.
Messages in queues may be ordered in various ways:
FIFO | LIFO | priority | expiration time | (a combination)
The /Q Subsystem is managed as an XA-compliant
resource with a provided TMS Server.
Not available in version 6.5
Tuxedo/Q Subsystem Applications Administration-4
2006 BEA Systems, Inc. 357
Tuxedo /Q Subsystem Components
For every Queuespace there must be a corresponding
Server group containing:
One or more TMQUEUE servers.
Two or more TMS_QM servers.
A logical named segment on a Qspace containing messages Queue
A pre-allocated space on the device that contains Queues Queuespace
A binary file or raw disk device used to store the Qspace Queuespace Device
Tuxedo /Q admin client (similar to tmadmin) qmadmin
Description Administration
Description /Q System Processes
Assigned to a Qspace; enqueues and dequeues messages TMQUEUE
Assigned to one or more Queues; forwards messages to services TMQFORWARD
Assigned to a Qspace; manages 2PC for XA transactions TMS_QM
The TMQFORWARD
Server is optional
Tuxedo/Q Subsystem Applications Administration-5
2006 BEA Systems, Inc. 358
Basic Peer-to-Peer /Q Example

TMQUEUE
Client 1
tpenqueue(Queue1)
Client 2
tpdequeue(Queue1)
4
5 2
6
3
1
Queue1
QS
Qspace
Device
Tuxedo/Q Subsystem Applications Administration-6
2006 BEA Systems, Inc. 359
Store and Forward with TMQFORWARD

TMQUEUE
Client
tpenqueue(UPDATE)
. . .
tpdequeue(REPLYQ)
App Server
UPDATE Service
4
5
2
6
3
1
ErrorQ
QS
Qspace
Device
UPDATE
ReplyQ
TMQFORWARD
7
8
9
10
Tuxedo/Q Subsystem Applications Administration-7
2006 BEA Systems, Inc. 360
Section Review
Recognize the /Q subsystem components
Identify common /Q architectural patterns
In this section, we learned how to:
Tuxedo/Q Subsystem Applications Administration-8
2006 BEA Systems, Inc. 361
Road Map
1. /Q Subsystem Overview
2. Configuring Tuxedo for /Q Support
Server Group Configuration Requirement
Configuring the /Q Subsystem servers
Using qmadmin to Configure Qspaces
Using qmadmin to Monitor and Manage Qspaces
Tuxedo/Q Subsystem Applications Administration-9
2006 BEA Systems, Inc. 362
/Q Subsystem Configuration
The BEA Tuxedo /Q administrator has three primary
areas of responsibility, which are:
Configuration of resources
Creation of the Qspace and Queues
Monitoring and maintenance of the facility
Most tasks require a close cooperation with the
application developers.
The configuration and the queue attributes must exactly
reflect the requirements of the application.
Most /Q applications have already been configured for
functional testing and QA testing.
Tuxedo/Q Subsystem Applications Administration-10
2006 BEA Systems, Inc. 363
GROUPS Configuration
In the GROUPS section:
Add a separate group for each Qspace.
Add the TMS server, TMS_QM for the group.
Configure the OPENINFO string for the Qspace; it must
contain the device name and the name of the Qspace.
In UNIX, the syntax changes slightly using a : instead of a ; between the
Qspace device name and the Qspace name
Always TUXEDO/QM
Qspace Device
Always TMS_QM
Example UBBCONFIG text file:
*GROUPS
QUEGROUP1
LMID=SITE1 GRPNO=1
TMSNAME=TMS_QM TMSCOUNT=4
OPENINFO=TUXEDO/QM:C:\appdir\QSDEVICE;AppQS
10
0101
1110
Qspace Name
Tuxedo/Q Subsystem Applications Administration-11
2006 BEA Systems, Inc. 364
TMQUEUE Server
In the SERVERS section:
Define one or more TMQUEUE servers.
Example UBBCONFIG text file:
*SERVERS
TMQUEUE
SRVGRP=QUEGROUP1 SRVID=100 MIN=2
CLOPT=-s AppQS:TMQUEUE t 45
10
0101
1110
Parameters
-s QSname:TMQUEUE
Advertises the Qspace name as a service name to the internal
TMQUEUE function; enables requests to be sent to the correct
TMQUEUE server using this service name alias.
-t timeout
Timeout value used for enqueue or dequeue operations;Default: 30s
Description
Alias MUST match
the Qspace name
Tuxedo/Q Subsystem Applications Administration-12
2006 BEA Systems, Inc. 365
TMQFORWARD Server
Optionally, if your application is using a store-and-
forward paradigm:
Define one or more TMQFORWARD servers.
Example TMQFORWARD server definition:
TMQFORWARD
SRVGRP=QUEGROUP1 SRVID=110 MIN=2
CLOPT=-- -q UPDATE,DEPOSIT i 15 t 120
10
0101
1110
Send service request as tpfoward() instead of tpcall() -f delay
Sets blocking timeout when used with n and -f
-b timeout
One or more queues to poll and dequeue. (Required) -q qname[,qname]
A transaction timeout value. Default: 60s -t timeout
Allows for non-transactional service calls -n
Causes server to exit if there are no messages on its queues -e
Server idle time after all queues are drained. Default: 60s -i idleTime
Description Parameter
Tuxedo/Q Subsystem Applications Administration-13
2006 BEA Systems, Inc. 366
Putting It All Together
Example UBBCONFIG text file:
*MACHINES
STUDENT14 LMID=SITE1
APPDIR=C:\appdir TUXDIR=C:\bea\tuxedo9.0
TUXCONFIG=C:\appdir\tuxconfig
TLOGDEVICE=C:\appdir\DEVICE TLOG=appTlog
*GROUPS
QUEGROUP1 LMID=SITE1 GRPNO=1
TMSNAME=TMS_QM TMSCOUNT=4
OPENINFO=TUXEDO/QM:C:\appdir\QSDEVICE;AppQS
*SERVERS
TMQUEUE
SRVGRP=QUEGROUP1 SRVID=100 MIN=2
CLOPT=-s AppQS:TMQUEUE t 45
TMQFORWARD
SRVGRP=QUEGROUP1 SRVID=110 MIN=2
CLOPT=-- -q UPDATE,DEPOSIT i 15 t 120
10
0101
1110
/Q is an XA-compliant RM.
The machine must have a TLOG
Tuxedo/Q Subsystem Applications Administration-14
2006 BEA Systems, Inc. 367
/Q Subsystem Administration
Use the qmadmin utility to:
Create the Qspace device
Initialize the Qspace and define Queues
Monitor and modify the Queues
Move or delete messages from Queues
The qmadmin utility runs independent from the
application; use before or after tmboot.
To execute qmadmin:
Starting the qmadmin utility within a QMCONFIG environment:
C:\> set QMCONFIG=C:\apps\QUEUEDEVICE
C:\> qmadmin
Starting the qmadmin utility with an initial argument:
C:\> qmadmin C:\apps\QUEUEDEVICE
Set QMCONFIG to
the QS Device
<or>
Specify as a
command-line
argument
Tuxedo/Q Subsystem Applications Administration-15
2006 BEA Systems, Inc. 368
Common qmadmin Commands
Refer to Tuxedo Docs>Reference>Section 1>qmadmin(1)
Display information for all in-flight transactions qprinttrans
Used to set qmadmin to a specific Queue within the Qspace qset
Displays general info on all Queues within Qspace qinfo
Monitoring Commands
Moves messages from the set Queue to another Queue in QS qchangequeue
Changes the priority for messages in a set Queue qchangeprio
Deletes messages from the set Queue qdeletemsg
Modifies the parameters for a set Queue
qchange
Creates the Qspace binary file device crdl
Creates a Qspace on device (additional options presented) qspacecreate
Changes the parameters for a Qspace qspacechange
Creates a named Queue in the QS (additional options presented) qcreate
Used to open a specific Qspace on the device qopen
Description Subcommand
qlist List all messages currently on the set Queue
Tuxedo/Q Subsystem Applications Administration-16
2006 BEA Systems, Inc. 369
Creating the Qspace Device and Qspace
Use the crdl command to create the Qspace device;
qspacecreate to define the Qspace.
Creating the Qspace device example:
C:\> set QMCONFIG=C:\apps\QUEUEDEVICE
C:\> qmadmin
> crdl C:\apps\QUEUEDEVICE 0 1000
Offset=0
Size=1000 blocks
Defining the Qspace parameters:
> qspacecreate
Queue space name: AppQS
IPC Key for queue space: 62639
Size of queue space in disk pages: 800
Number of queues in queue space: 3
Number of concurrent transactions in queue space:36
Number of concurrent processes in queue space: 8
Number of messages in queue space: 400
Error queue name: ErrorQ
Initialize extents (y, n [default=n]): y
Blocking factor [default=16]: 16
Tuxedo/Q Subsystem Applications Administration-17
2006 BEA Systems, Inc. 370
Defining Queues on the Qspace
Use the qcreate command to define each Queue
within the Qspace.
These commands are normally configured in a setup script.
Defining the Queues parameters within a Qspace:
> qopen AppQS
> qcreate
Queue name: UPDATE
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: alert.cmd
Queue UPDATE created
>
You must first
open the Qspace
Tuxedo/Q Subsystem Applications Administration-18
2006 BEA Systems, Inc. 371
Runtime Monitoring and Management
You can monitor and make most changes to the
Qspace while the application is running.
You can also execute commands on a shutdown application.
Most qmadmin commands are scoped
hierarchically.
Queue2
MyQspace
Qspace Device
Queue1
qmadmin
-qspacecreate
-qspacelist
-qopen MyQspace
-qcreate
-qchange
-qinfo
-qset Queue1
-qlist
-qchangequeue
-qdeletemsg
Tuxedo/Q Subsystem Applications Administration-19
2006 BEA Systems, Inc. 372
Section Review
Configure the TMQUEUE and TMQFORWARD servers
Configure a Server Group for a Qspace
Create and define Qspace parameters using qmadmin
Monitor and manage Qspace messages
In this section, we learned how to:
Tuxedo/Q Subsystem Applications Administration-20
2006 BEA Systems, Inc. 373
Lab Exercise
For details on the exercise, refer to the Lab Guide.
If questions arise, ask the instructor.
The instructor will determine the stop time.
Lab 13 QUE: Configure, Deploy, and
Manage a Tuxedo/Q Subsystem Application
Tuxedo/Q Subsystem Applications Administration-21
2006 BEA Systems, Inc. 374
Module Review
Leverage the /Q subsystem architecture and
components to support persistent messaging
Configure the UBBCONFIG to map Server Groups
to QSPACE configurations
Monitor and manage /Q subsystem messages using
qmadmin
In this module, we learned how to:
Tuxedo/Q Subsystem Applications Administration-22

You might also like