PURPOSE

TMQFORWARD - TUXEDO System/T Message Forwarding Server

SYNOPSIS

TMQFORWARD
SRVGRP="identifier"
SRVID="number"
REPLYQ=N
	CLOPT=" [ -A ] [ servopts options ] -- -q queuename[,queuename . . ..] [ -t trantime ]
	[ -i idletime ]  [ -e ] [ -d ] [ -n ]
	[ -f delay ] "

DESCRIPTION

The message forwarding server is a System/T-supplied server that forwards messages that have been stored using tpenqueue(3c) for later processing. The application administrator enables automated message processing for the application servers by specifying this server as an application server in the *SERVERS section.

The location, server group, server identifier and other generic server related parameters are associated with the server using the already defined configuration file mechanisms for servers. The following is a list of additional command line options that are available for customization.

-q queuename[,queuename...]

is used to specify the names of one or more queues/services for which this server forwards messages. Queue and service names are strings limited to 15 characters. This option is required.
-t trantime

is used to indicate the transaction timeout value used on tpbegin(3c) for transactions that dequeue messages and forward them to application servers. If not specified, the default value is 60 seconds.
-i idletime

is used to indicate the time that the server is idle after draining the queue(s) that it is reading. A value of 0 will indicate that the server will continually read the queue(s) which can be inefficient if the queues don't continually have messages. If not specified, the default value is 30 seconds.
-e

is used to cause the server to exit if it finds no messages on the queue(s). This, combined with the threshold command associated with the queue(s), can be used to start and stop the TMQFORWARD server in response to fluctuations of messages that are enqueued.
-d

is used to cause messages that result in service failure and have a reply message (non-zero in length) to be deleted from the queue after the transaction is rolled back.
-n

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

is used to case 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 requests, the delay numeric value can be used to indicate a delay, in seconds, between processing requests; use 0 for no delay.

Messages will be sent to a server providing a service whose name matches the queue name from which the message is read. The message priority will be the priority specified when the message was enqueued, if set. Otherwise, the priority will be the priority for the service, as defined in the configuration file, or the default value (50).

The message will be dequeued and sent to the server within a transaction. If the service succeeds, the transaction will be committed and the message is deleted from the queue. If the message is associated with a reply queue, then any reply from the service will be enqueued to the reply queue, along with the returned tpurcode. If the reply queue does not exist, the reply will be dropped.

If the service fails, then the transaction will be rolled back and the message will be put back on the queue, up to the number of times specified by the retry limit configured for the queue. When a message is put back on the queue, the rules for ordering and dequeueing that applied when it was first put on the queue are, in effect, suspended for delay seconds; this opens up the possibility that a message of a lower priority may be dequeued ahead of the restored message.

If the -d option is specified, then the message will be deleted from the queue if the service fails and a reply message is received from the server, and the reply message (and associated tpurcode) will be enqueued to the failure queue, if one is associated with the message and the queue exists.

Any configuration condition that prevents TMQFORWARD from de-queuing or forwarding messages will cause the server to fail to boot. These conditions include the following. The SRVGRP must have TMSNAME set to TMS_QM, and must have OPENINFO set to indicate the associated device and queue name. The SERVER entry must not be part of an MSSQ and must have REPLYQ set to N. The -q option must be specified in the command line options. The server must not advertise any services (e.g., the -s option must not be specified).

Handling Application Buffer Types

As delivered, TMQFORWARD handles the standard buffer types provided with TUXEDO System/T. If additional application buffer types are needed, then a customized version of TMQFORWARD needs to be built using buildserver(1) with a customized type switch.

If your application uses shared libraries, it is not necessary to go through this compile and link process. See the description in the "Buffers" chapter of the TUXEDO Administrator's Guide.

The files included by the caller should include only the application buffer type switch and any required supporting routines. buildserver is used to combine the server object file, $TUXDIR/lib/TMQFORWARD.o, with the application type switch file(s), and link it with the needed TUXEDO System/T libraries. The following example provides a sample for further discussion. buildserver -v -o TMQFORWARD -r TUXEDO/QM -f ${TUXDIR}/lib/TMQFORWARD.o \e -f apptypsw.o

The buildserver options are as follows:

-v

specifies that buildserver should work in verbose mode. In particular, it writes the cc command to its standard output.
-o name

specifies the file name of the output load module. The name specified here must also be specified in the *SERVERS section of the configuration file. It is recommended that TMQFORWARD be used for consistency. The application specific version of the command can be installed in $APPDIR and will be booted instead of the version in $TUXDIR/bin.
-r TUXEDO/QM

specifies the resource manager associated with this server. The value TUXEDO/QM appears in the resource manager table located in $TUXDIR/udataobj/RM and includes the library for the TUXEDO System/T queue manager.
-f $TUXDIR/lib/TMQFORWARD.o

specifies the object file that contains the TMQFORWARD service and should be specified as the first argument to the -f option.
-f firstfiles

specifies one or more user files to be included in the compilation and/or link edit phases of buildserver. Source files are compiled using the either the cc command or the compilation command specified through the CC environment variable. These files must be specified after including the TMQFORWARD.o object file. If more than one file is specified, file names must be separated by white space and the entire list must be enclosed in quotation marks. This option can be specified multiple times.

The -s option must not be specified to advertise services.

PORTABILITY

TMQFORWARD is supported as a TUXEDO System/T-supplied server on UNIX operating systems.

INTEROPERABILITY

TMQFORWARD may be run in an interoperating application, but it must run on a Release 4.2 or later node.

EXAMPLES

*GROUPS
# For NT/Netware, :myqueue becomes ;myqueue
TMQUEUEGRP LMID=lmid GRPNO=1 TMSNAME=TMS_QM
        OPENINFO="TUXEDO/QM:/dev/device:myqueue"
# no CLOSEINFO is required
*SERVERS
# recommended values RESTART=Y GRACE=0
TMQFORWARD SRVGRP="TMQUEUEGRP" SRVID=1001 RESTART=Y GRACE=0
        CLOPT=" -- -qservice1,service2" REPLYQ=N
TMQUEUE SRVGRP="TMQUEUEGRP" SRVID=1000 RESTART=Y GRACE=0
        CLOPT="-s ACCOUNTING:TMQUEUE"

SEE ALSO

buildserver(1),
servopts(5), 
TMQUEUE(5), 
tpenqueue(3c),
tpdequeue(3c),
ubbconfig(5), 
BEA TUXEDO Administrator's Guide 
BEA TUXEDO Programmer's Guide