Back to home page

Enduro/X

 
 

    


0001 Q.CONF(5)
0002 =========
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 q.conf - Persistent, Transactional Message Queue (TMQ) configuration file
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 <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>]
0014 
0015 
0016 DESCRIPTION
0017 -----------
0018 'q.conf' defines the message queues for 'tmqueue'. The filename is passed to 'tmqueue' in 
0019 application '-q' parameter. This file can be shared between multiple 'tmqueue' servers.
0020 It is recommended to define default queue (special name is '@'). So that during 
0021 operations if specific queue is not found, then settings are taken from 
0022 default queue. The queue definitions also might not be complete. If so, then
0023 defaults are used for other parameters. It is recommended to define default 
0024 queue first. So that it can be using for other queue missing parameter defaulting.
0025 If using sub-sections in ini-config, the default shall be defined for each subsction.
0026 
0027 Whitespace/empty lines are ignored. File may contains comments which are 
0028 started at the beginning of the
0029 line with '#' symbol.
0030 
0031 If for automatic queues number of 'TRIES' attempts are exceeded for the message
0032 (due to failed service calls), messages are deleted from queue space. If *errorq*
0033 setting is configured for queue, request message is enqueued to this queue, prior
0034 deleting it from forward queue.
0035 
0036 DEBUG CONFIGURATION FILE SYNTAX
0037 -------------------------------
0038 
0039 *QUEUE_NAME*::
0040     Queue name. For default queue use *@* symbol. Max name length is 15 symbols.
0041 *SERVICE_NAME*::
0042     Service name to forward the message to. This is used for automatic queues. For manual queues
0043     you may put some dummy value into. Special value *@* for service name identifies
0044     that service name is the same as queue name.
0045 *AUTOMATIC_Q*::
0046     *Y* (*y*) - automatic queue. *T* (*t*) - automatic and call is performed in 
0047     global transaction. *N*(*n*) - not automatic.
0048 *TRIES*::
0049     Number of tires to send the message to 'SERVICE_NAME' service. I.e retry will be done in case
0050     if call returns the error. Parameter is used by automatic queues.
0051 *INIT_WAIT*::
0052     Number of seconds to be waited before starting to send the message to service. Node that
0053     the minimum wait time is defined by tmqueue '-s' scan time flag which makes the periodic sleeps
0054     before scanning the messages to be sent. This is setting used by automatic queues.
0055 *RETRY_WAIT*::
0056     Increase number of seconds to wait for next retry of forwarding message to service.
0057     This setting is used only by automatic queues.
0058 *WAIT_MAX*::
0059     Maximum number of seconds to wait after taking in account 'RETRY_WAIT_INC'.
0060 *MODE*::
0061     Queue mode, can be *fifo* or *lifo*. This setting affects 'tpdequeue()'.
0062 *TXTOUT*::
0063     Transaction timeout, either global (target service call is made in within global
0064     transaction) if using *T* for 'autoq' or local timeout for transaction.
0065 *ERRORQ*::
0066     Name of the queue where to put failed/expired automatic forward request messages.
0067 *NR_WORKERS*::
0068     Number of max busy worker threads for given queue, if queue is automatic.
0069     Absolute limit of total forwarders is set *tmqueue(8)* *-f* flag, this denotes
0070     the portion which given queue can occupy from shared forwarder thread pool. 
0071     The default value is *1*. Minimum value is *1*.
0072 *SYNC_MODE*::
0073     If more than one *workers* is used for automatic forwarding queues, 
0074     this flag indicates how the the worker threads for single queue synchronize. 
0075     If set to *y* or *Y*, then second worker thread only proceeds
0076     when first worker thread have performed *tpacall(3)* to destination service.
0077     If set to *c* or *C*, the second worker thread only proceeds
0078     when first worker have committed the result. If set to *n* or *N*, worker
0079     threads are not synchronized, and this is *default* for this flag.
0080 
0081 
0082 FORWARD TRANSACTION TIMEOUT
0083 ---------------------------
0084 
0085 When messages are forwarded by *autoq=y* or *autoq=T* setting, the transaction timeout
0086 and related XATMI time-outs are set by following principles:
0087 
0088 1. If service is invoked by transaction created by forward thread (*autoq=T* mode), timeout for
0089 transaction is set from *txtout* setting. If setting is not defined, transaction time-out is
0090 read from *tmqueue(8)* -t flag. With this time-out value the whole global transaction is completed,
0091 and the same time-out setting is applied to every XATMI IPC performed with forward thread in when
0092 global transaction is processed. The same setting is used if destination service call failed and
0093 error response, or counters needs to be updated.
0094 
0095 2. In case if calling *autoq=y* mode service, and service has <services ... trantime="TOUT" autotran="Y"> set
0096 in *ndrxconfig.xml(5)*, then service invocation is performed with XATMI *tpcall(3)* timeout set to
0097 particular 'TOUT' value defined for service. For local transaction completions and XATMI IPCs
0098 (e.g. enqueue error/response, counter updates, etc.), timeout value is checked from as in step *1.* i.e.
0099 either from *txtout* or from *-t* setting of *tmqueue*.
0100 
0101 3. In case if calling *autoq=y* and service is not defined in "<services>" or it is not transactiontional,
0102 time-out value for service call is set from *txtout*, if not available then from *-t* setting of *tmqueue*.
0103 For local transactions (e.g. counter updates, error/response enqueues, etc.) the same time-out value is used.
0104 
0105 
0106 EXAMPLE
0107 -------
0108 
0109 Sample configuration:
0110 ---------------------------------------------------------------------
0111 #
0112 # @(#) EnduroX Persistent Queue Configuration
0113 #
0114 @,svcnm=-,autoq=n,waitinit=0,waitretry=0,waitretrymax=0,memonly=n,mode=fifo
0115 # This will take other settings from default:
0116 TESTA,svcnm=-,autoq=n,waitinit=5
0117 
0118 # Automatic queue: Will try to send messages to TESTSVC
0119 LTESTB,svcnm=TESTSVC,autoq=y,waitinit=1,waitretry=1,waitretrymax=0,memonly=n,mode=lifo
0120 ---------------------------------------------------------------------
0121 
0122 When using common-configuration then above sample is moved to ini files. The sample section would look like:
0123 (e.g. '/app/dir/conf/endurox.ini')
0124 ---------------------------------------------------------------------
0125 #
0126 # @(#) Enduro/X Persistent Queue Configuration
0127 #
0128 [@queue]
0129 @=svcnm=-,autoq=n,waitinit=0,waitretry=0,waitretrymax=0,memonly=n,mode=fifo
0130 # This will take other settings from default:
0131 TESTA=svcnm=-,autoq=n,waitinit=5
0132 
0133 # Automatic queue: Will try to send messages to TESTSVC
0134 LTESTB=svcnm=TESTSVC,autoq=y,waitinit=1,waitretry=1,waitretrymax=0,memonly=n,mode=lifo
0135 ---------------------------------------------------------------------
0136 
0137 For common configuration sub-sections can be used by *cctag*, for example if you have following in your
0138 ndrxconfig.xml:
0139 
0140 ---------------------------------------------------------------------
0141     <server name="tmqueue">
0142         <max>1</max>
0143         <srvid>1660</srvid>
0144         <cctag>qs1</cctag>
0145         <sysopt>-e /tmp/QS1.log -r -- -m QS1 -s1</sysopt>
0146     </server>
0147     <server name="tmqueue">
0148         <max>1</max>
0149         <srvid>1670</srvid>
0150         <cctag>qs2</cctag>
0151         <sysopt>-e /tmp/QS2.log -r -- -m QS2 -s1</sysopt>
0152     </server>
0153 ---------------------------------------------------------------------
0154 
0155 Then queues can be defined in sub-section per server cctag, for example:
0156 
0157 ---------------------------------------------------------------------
0158 
0159 #
0160 #Q defaults (common)
0161 #
0162 [@queue]
0163 @=svcnm=-,autoq=n,waitinit=0,waitretry=0,waitretrymax=0,memonly=n,mode=fifo
0164 
0165 #
0166 # manual queue, overridden to lifo
0167 #
0168 [@queue/qs1]
0169 queue1=mode=lifo
0170 
0171 #
0172 # Automatic queue
0173 #
0174 [@queue/qs2]
0175 queue2=svcnm=TESTSV,autoq=y,tries=3,waitinit=1,waitretry=5,waitretrymax=10
0176 ---------------------------------------------------------------------
0177 
0178 BUGS
0179 ----
0180 Report bugs to support@mavimax.com
0181 
0182 SEE ALSO
0183 --------
0184 *xadmin(8)*, *ndrxd(8)*, *ndrxconfig.xml(5)* *common_configuration(guides)*
0185 *tpenqueue(3)* *tpdequeue(3)*
0186 
0187 COPYING
0188 -------
0189 (C) Mavimax, Ltd