![]() |
![]() |
|
|
Configuring the BEA MessageQ Bridge
BEA MessageQ V5.0 includes a messaging bridge that allows the exchange of messages between BEA MessageQ V5.0 and BEA TUXEDO V6.5. BEA MessageQ applications can send a message using pams_put_msg that a TUXEDO application can retrieve through a call to tpdequeue. TUXEDO applications can send a message using tpenqueue that a BEA MessageQ application can retrieve through a call to pams_get_msg(w). In addition, a BEA MessageQ application can invoke a TUXEDO service using pams_put_msg. It is also possible for a TUXEDO application to use tpenqueue to put a message on a queue and to use tpdequeue to retrieve a message from a queue.
This exchange of messages is made possible by two TUXEDO servers that are included in the BEA MessageQ kit and that run on the same machine as BEA MessageQ: TMQUEUE_BMQ and TMQFORWARD_BMQ.
TMQUEUE_BMQ redirects TUXEDO tpenqueue requests to a BEA MessageQ queue where they can be retrieved with pams_get_msg(w). TMQUEUE_BMQ also redirects pams_put_msg or tepenqueue requests to TUXEDO where they can be retrieved with tpdequeue.
TMQFORWARD_BMQ listens on specified BEA MessageQ queues and forwards pams_put_msg requests to a TUXEDO service. It also puts a reply or failure message on the sender's response queue.
The target queue and service are defined when TMQUEUE_BMQ and TMQFORWARD_BMQ are configured. This ensures that message exchange between BEA MessageQ and TUXEDO is transparent to the application.
Figure 15-1 illustrates message exchange between MessageQ and TUXEDO.
Figure 15-1 Message Exchange Between MessageQ and TUXEDO
The TMQUEUE_BMQ and TMQFORWARD_BMQ servers are part of the BEA MessageQ kit and are installed when BEA MessageQ is installed. During the installation procedure, you are prompted to choose one of the following installation options for BEA MessageQ and TUXEDO integration:
install on top of BEA TUXEDO V6.5
install without BEA TUXEDO
BEA TUXEDO must be installed and configured on the system where BEA MessageQ is being installed. The OpenVMS installation procedure requires that the TUXDIR logical is defined before the installation proceeds. If the TUXDIR logical is not defined, the following messages are displayed:
%VMSINSTAL-E-NOTUXDIR Cannot locate logical TUXDIR
%VMSINSTAL-E-NOTUXDIR MessageQ/TUXEDO bridge cannot be installed
If you choose to install on top of BEA TUXEDO V6.5, the applicable files for the TMQUEUE_BMQ and TMQFORWARD_BMQ servers are installed on your system. If you install without BEA TUXEDO, the TMQUEUE_BMQ and TMQFORWARD_BMQ servers are not installed on your system. See the installation and configuration documentation specific to your platform for detailed installation and configuration instructions.
Once the TMQUEUE_BMQ and TMQFORWARD_BMQ servers are installed, you enable message enqueuing and dequeuing for the application by specifying the servers as application servers in the *SERVERS section of the TUXEDO ubbconfig file. See the TMQUEUE_BMQ and TMQFORWARD_BMQ reference pages in the BEA MessageQ Reference Manual for detailed information on the server configuration syntax. Listing 15-1 shows a sample BEA TUXEDO ubbconfig file with the TMQUEUE_BMQ and TMQFORWARD_BMQ servers specified as application servers.
Listing 15-1 Sample BEA TUXEDO UBBCONFIG File
#Copyright (c) 1992 Unix System Laboratories, Inc.
#All rights reserved
#ident "@(#)apps:qsample/ubb.sample 60.5"
#
*RESOURCES
IPCKEY 52617
DOMAINID qsample
MASTER SITE1
MODEL SHM
#
*MACHINES
#
"birch.beasys.com"
LMID = SITE1
TUXDIR = "$3$DKB400:[TUXEDO]"
TUXCONFIG = "CYPRES$DKA200:[POPP.TUXTEST.QSAMPLE]TUXCONFIG"
TLOGDEVICE = "CYPRES$DKA200:[POPP.TUXTEST.QSAMPLE]TLOG"
TLOGSIZE=10
APPDIR = "CYPRES$DKA200:[POPP.TUXTEST.QSAMPLE]"
ULOGPFX = "CYPRES$DKA200:[POPP.TUXTEST.QSAMPLE]ULOG"
#
*GROUPS
#
GROUP1
LMID = SITE1 GRPNO = 1
TMSNAME=TMS TMSCOUNT=2
QUE1
LMID = SITE1 GRPNO = 2
TMSNAME = TMS_QM TMSCOUNT = 2
OPENINFO = "TUXEDO/QM,CYPRES$DKA200:[POPP.TUXTEST.QSAMPLE]QUE,QSPACE"
#
*SERVERS
#
DEFAULT: CLOPT="-A"
server SRVGRP=GROUP1 SRVID=2
#
TMQUEUE_BMQ
SRVGRP = QUE1 SRVID = 1
GRACE = 0 RESTART = Y CONV = N MAXGEN=10
CLOPT = "-s QSPACE:TMQUEUE -- -b 99 -g 51 "
#
TMQFORWARD_BMQ
SRVGRP=QUE1 SRVID= 5 GRACE=0 RESTART=Y CONV=N MAXGEN=10
CLOPT="-- -t 30 -q STRING -b 99 -g 52 " REPLYQ=N
*SERVICES
The ubbconfig file shown in Listing 15-1 can be used with the qsample sample application included in your BEA TUXEDO kit. No changes are required to the application. The client portion of the application (client.c) performs tpenqueue and tpdequeue operations to and from STRING and RPLYQ. Define secondary queues named STRING and RPLYQ in the queue configuration section (%QCT) of the DMQ$INIT.TXT file as shown in Listing 15-2.
Listing 15-2
%QCT ***** Queue Configuration Table ******
*
* ---Pool Quota--- UCB Q Q Confrm Perm Name Chk
* Queue Name Num Bytes Msgs Ctrl Send Type Own Style Act Scope ACL
*------------------- ---- ------- ---- ---- ---- ---- ---- ----- ---- ----- ----
*
QUEUE_1 1 64000 100 All . . . II Y L N
.
.
.
STRING 13 . . None . S . . N G N
RPLYQ 14 . . None . S . . N G N
*
%EOS
Note: On OpenVMS systems, the queues can be either global or local; on UNIX and Windows NT systems, the queues must be specified as global.
Target, Queue Space, and Queue Name Mapping
There are two areas that must be resolved when mapping the BEA MessageQ target and BEA TUXEDO queue space and queue name:
TUXEDO Queue Space to BEA MessageQ Group Name
BEA MessageQ uses the target argument of the pams_put_msg function to specify the target queue address for a message. TUXEDO uses the qspace and qname arguments of the tpenqueue and tpdequeue functions to specify the target queue for a message
The TUXEDO queue space name must be the name of a service advertised by TMQUEUE_BMQ or TMQFORWARD_BMQ. The service name maps directly to a BEA MessageQ group. By default, TMQUEUE_BMQ and TMQFORWARD_BMQ automatically offer services named "TMQUEUE_BMQ" and "TMQFORWARD_BMQ" unless the -s command line option is specified. These default services map to the BEA MessageQ group to which they are attached, as specified by the -g command line option.
The function name to which services should be mapped is TMQUEUE. Each entry in the TUXEDO ubbconfig file for a TMQUEUE_BMQ or TMQFORWARD_BMQ server should be configured with a different alias for the default function name using the TUXEDO -s command line option. For example, one configuration of TMQUEUE may be named Payroll, while another is named Sales. This provides a way to precisely specify a BEA MessageQ entry point for a particular tpenqueue or tpdequeue call. If multiple instances of the same advertised service are running, TUXEDO performs load balancing and data dependent routing to determine which server handles the request.
Listing 15-3 shows a portion of a ubbconfig file containing multiple TMQUEUE configurations:
Listing 15-3 UBBCONFIG File with Multiple TMQUEUE Configurations
*GROUPS
TMQUEUE_BMQGRPHQMGR GRPNO=1
TMQUEUE_BMQGRPHQPLEBE GRPNO=2
TMQUEUE_BMQGRPREMOTENA GRPNO=3
TMQUEUE_BMQGRPREMOTEEUROPE GRPNO=4
*SERVERS
TMQUEUE_BMQ SRVGRP="TMQUEUE_BMQGRPHQMGR" SRVID=1000 RESTART=Y
GRACE=0 CLOPT="-s Payroll:TMQUEUE -s
Promote:TMQUEUE -- -b 5 -g 7"
TMQUEUE_BMQ SRVGRP="TMQUEUE_BMQGRPHQPLEBE" SRVID=1000 RESTART=Y
GRACE=0 CLOPT="-s Payroll:TMQUEUE -s
Promote:TMQUEUE -- -b 5 -g 10"
TMQUEUE_BMQ SRVGRP="TMQUEUE_BMQGRPREMOTENA" SRVID=2002 RESTART=Y
GRACE=0 CLOPT="-s Sales:TMQUEUE -- -b 5 -g 42"
TMQUEUE_BMQ SRVGRP="TMQUEUE_BMQGRPREMOTEEUROPE" SRVID=2002
RESTART=Y GRACE=0 CLOPT="-s Sales:TMQUEUE -- -b 12 -g 53"
*SERVICES
Payroll ROUTING="SALARYROUTE"
Payroll ROUTING="HAIRCOLORROUTE"
*ROUTING
SALARYROUTE FIELD=Salary BUFTYPE="FML32"
RANGES="MIN - 50000:TMQUEUE_BMQGRPPLEBE,50001
-MAX:TMQUEUE_BMQGRPHQMGR"
HAIRCOLORROUTE FIELD=Hair BUFTYPE="FML32"
RANGES="`Gray':TMQUEUE_BMQGRPHQMGR,*:TMQUEUE_BMQGRPPLEBE"
In this example, three queue space names (Payroll, Promote, and Sales) are defined for two busses to four different BEA MessageQ groups (7, 10, 42, and 53). Two servers offer the same aliases (Payroll and Promote) with data dependent routing performed using the Sales and Hair fields respectively. The two other servers offer the same alias (Sales) with routing determined by load balancing and availability.
TUXEDO Queue to BEA MessageQ Queue
Any BEA MessageQ queue can be accessed by TUXEDO through the TMQUEUE_BMQ and TMQFORWARD_BMQ servers. However, BEA MessageQ queues are accessed in different ways depending on whether they are named or unnamed queues.
BEA MessageQ named queues can be local (group-wide) or global (bus-wide). To address a locally named queue from TUXEDO:
To access an unnamed BEA MessageQ queue from TUXEDO, use an absolute queue identifier as the second parameter for tpenqueue or tpdequeue. The absolute queue identifier is a combination of the BEA MessageQ group identifier and queue identifier formatted as group_id.queue_id. For example, queue 1005 in group 3 is specified as "3.1005". When accessing a queue in the local group, either specify the group as 0 or drop the group identifier and delimiter. For example, queue 1005 in the local group is specified either as "0.1005" or "1005". Queue identifiers that do not use this syntax, or are outside the valid range of group or queue numbers are assumed to be queue names.
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|