User Tools

Site Tools


Sidebar

Table Of Contents

endurox:v7.5.x:manuals:q.conf.5

q.conf

Name

q.conf — Persistent, Transactional Message Queue (TMQ) configuration file

Synopsis

<QUEUE_NAME>,svcnm=<SERVICE_NAME>,autoq=<AUTOMATIC_Q>,tries=<TRIES>,waitinit=<INIT_WAIT>,waitretry=<RETRY_WAIT>,waitretrymax=<WAIT_MAX>,mode=<MODE>[,txtout=<TXTOUT>][,errorq=<ERRORQ>][,workers=<NR_WORKERS>][,sync=<SYNC_MODE>]

DESCRIPTION

q.conf defines the message queues for tmqueue. The filename is passed to tmqueue in application -q parameter. This file can be shared between multiple tmqueue servers. It is recommended to define default queue (special name is @). So that during operations if specific queue is not found, then settings are taken from default queue. The queue definitions also might not be complete. If so, then defaults are used for other parameters. It is recommended to define default queue first. So that it can be using for other queue missing parameter defaulting. If using sub-sections in ini-config, the default shall be defined for each subsction.

Whitespace/empty lines are ignored. File may contains comments which are started at the beginning of the line with # symbol.

If for automatic queues number of TRIES attempts are exceeded for the message (due to failed service calls), messages are deleted from queue space. If errorq setting is configured for queue, request message is enqueued to this queue, prior deleting it from forward queue.

DEBUG CONFIGURATION FILE SYNTAX

QUEUE_NAME
Queue name. For default queue use @ symbol. Max name length is 15 symbols.
SERVICE_NAME
Service name to forward the message to. This is used for automatic queues. For manual queues you may put some dummy value into. Special value @ for service name identifies that service name is the same as queue name.
AUTOMATIC_Q
Y (y) - automatic queue. T (t) - automatic and call is performed in global transaction. N(n) - not automatic.
TRIES
Number of tires to send the message to SERVICE_NAME service. I.e retry will be done in case if call returns the error. Parameter is used by automatic queues.
INIT_WAIT
Number of seconds to be waited before starting to send the message to service. Node that the minimum wait time is defined by tmqueue -s scan time flag which makes the periodic sleeps before scanning the messages to be sent. This is setting used by automatic queues.
RETRY_WAIT
Increase number of seconds to wait for next retry of forwarding message to service. This setting is used only by automatic queues.
WAIT_MAX
Maximum number of seconds to wait after taking in account RETRY_WAIT_INC.
MODE
Queue mode, can be fifo or lifo. This setting affects tpdequeue().
TXTOUT
Transaction timeout, either global (target service call is made in within global transaction) if using T for autoq or local timeout for transaction.
ERRORQ
Name of the queue where to put failed/expired automatic forward request messages.
NR_WORKERS
Number of max busy worker threads for given queue, if queue is automatic. Absolute limit of total forwarders is set tmqueue(8) -f flag, this denotes the portion which given queue can occupy from shared forwarder thread pool. The default value is 1. Minimum value is 1.
SYNC_MODE
If more than one workers is used for automatic forwarding queues, this flag indicates how the the worker threads for single queue synchronize. If set to y or Y, then second worker thread only proceeds when first worker thread have performed tpacall(3) to destination service. If set to c or C, the second worker thread only proceeds when first worker have committed the result. If set to n or N, worker threads are not synchronized, and this is default for this flag.

FORWARD TRANSACTION TIMEOUT

When messages are forwarded by autoq=y or autoq=T setting, the transaction timeout and related XATMI time-outs are set by following principles:

  1. If service is invoked by transaction created by forward thread (autoq=T mode), timeout for transaction is set from txtout setting. If setting is not defined, transaction time-out is read from tmqueue(8) -t flag. With this time-out value the whole global transaction is completed, and the same time-out setting is applied to every XATMI IPC performed with forward thread in when global transaction is processed. The same setting is used if destination service call failed and error response, or counters needs to be updated.
  2. In case if calling autoq=y mode service, and service has <services … trantime="TOUT" autotran="Y"> set in ndrxconfig.xml(5), then service invocation is performed with XATMI tpcall(3) timeout set to particular TOUT value defined for service. For local transaction completions and XATMI IPCs (e.g. enqueue error/response, counter updates, etc.), timeout value is checked from as in step 1. i.e. either from txtout or from -t setting of tmqueue.
  3. In case if calling autoq=y and service is not defined in "<services>" or it is not transactiontional, time-out value for service call is set from txtout, if not available then from -t setting of tmqueue. For local transactions (e.g. counter updates, error/response enqueues, etc.) the same time-out value is used.

EXAMPLE

Sample configuration:

#
# @(#) EnduroX Persistent Queue Configuration
#
@,svcnm=-,autoq=n,waitinit=0,waitretry=0,waitretrymax=0,memonly=n,mode=fifo
# This will take other settings from default:
TESTA,svcnm=-,autoq=n,waitinit=5

# Automatic queue: Will try to send messages to TESTSVC
LTESTB,svcnm=TESTSVC,autoq=y,waitinit=1,waitretry=1,waitretrymax=0,memonly=n,mode=lifo

When using common-configuration then above sample is moved to ini files. The sample section would look like: (e.g. /app/dir/conf/endurox.ini)

#
# @(#) Enduro/X Persistent Queue Configuration
#
[@queue]
@=svcnm=-,autoq=n,waitinit=0,waitretry=0,waitretrymax=0,memonly=n,mode=fifo
# This will take other settings from default:
TESTA=svcnm=-,autoq=n,waitinit=5

# Automatic queue: Will try to send messages to TESTSVC
LTESTB=svcnm=TESTSVC,autoq=y,waitinit=1,waitretry=1,waitretrymax=0,memonly=n,mode=lifo

For common configuration sub-sections can be used by cctag, for example if you have following in your ndrxconfig.xml:

    <server name="tmqueue">
        <max>1</max>
        <srvid>1660</srvid>
        <cctag>qs1</cctag>
        <sysopt>-e /tmp/QS1.log -r -- -m QS1 -s1</sysopt>
    </server>
    <server name="tmqueue">
        <max>1</max>
        <srvid>1670</srvid>
        <cctag>qs2</cctag>
        <sysopt>-e /tmp/QS2.log -r -- -m QS2 -s1</sysopt>
    </server>

Then queues can be defined in sub-section per server cctag, for example:

#
#Q defaults (common)
#
[@queue]
@=svcnm=-,autoq=n,waitinit=0,waitretry=0,waitretrymax=0,memonly=n,mode=fifo

#
# manual queue, overridden to lifo
#
[@queue/qs1]
queue1=mode=lifo

#
# Automatic queue
#
[@queue/qs2]
queue2=svcnm=TESTSV,autoq=y,tries=3,waitinit=1,waitretry=5,waitretrymax=10

BUGS

Report bugs to support@mavimax.com

SEE ALSO

xadmin(8), ndrxd(8), ndrxconfig.xml(5) common_configuration(guides) tpenqueue(3) tpdequeue(3)

COPYING

© Mavimax, Ltd