www.krengeltech.com

RXS Router Configuration

From Wiki

User Guide
v2.10+

Contents

RXS Router Configuration

Additional RXS Router configuration can be controlled by changing the options in the shipped *CONFIG record in the RXS Router control file RXSRTRCTL. The various control options are as follows:

routingid
Routing identifier
loglvl
Logging level (0, 1 or 2)
allowreset
Allow *RESET option from client (*YES|*NO)
debugmode
Run in debug mode(*YES|*NO)

The *CONFIG record in the RXSRTRCTL file is shipped as follows:


  -routingid rxsrtr -loglvl 0 –allowreset *no –debugmode *no

Control Option: routingid

The routingid flag defines the type of routing that should be performed by RXSRTR. Depending on its value, RXSRTR will use either 'static' or 'dynamic' routing to determine the value of the request routing identifier (RRID), which actually defines the call definition. If the routingid flag is not specified, a value of 'RXSRTR' is assumed.

Static (environment variable) routing

If the routingid flag has a value which begins with ENVVAR:, RXSRTR will check the specified environment variable on each request to determine the RRID. For instance, if the routingid flag is specified as follows:

  -routingid envvar:http_soapaction

then whenever RXSRTR is called by the HTTP server, it will retrieve the value of the HTTP_SOAPACTION environment variable and will use that value as the RRID.

This processing will be performed for every request handled by RXSRTR, irrespective of the actual URL used.

If the specified environment variable is a path name, you may specify a qualifier of a colon followed by a slash, immediately following the environment variable name, e.g.:

  -routingid envvar:http_soapaction:/

and RXSRTR will use only the last path segment of the environment variable as the RRID. For instance, if the value of the HTTP_SOAPACTION variable is

  https://www.mycompany.com/webservices/local/values/focus/getasset

then the RRID used would be 'GETASSET'.


Dynamic routing

If the routingid flag has a value which does not begin with ENVVAR:, RXSRTR will use 'dynamic' routing, whereby the actual URL used by the client will be parsed to determine the RRID.

RXSRTR uses the following steps to determine the RRID from the URL (as soon as the RRID has been determined, further steps are bypassed):

  1. The value of the QUERY_STRING environment variable is retrieved as {querystring}
  2. The SCRIPT_NAME environment variable is retrieved as {scriptname} and parsed into its constituent 'segments'. For instance, a SCRIPT_NAME value of /rxsrtr/petstore/item' is parsed into 3 separate segments – 'rxsrtr', 'petstore' and 'item'. All values are converted to upper-case for comparison purposes during parsing.
  3. If one of the {scriptname} segments has a value of routingid and the next segment is not blank, that next segment is used as the RRID.
  4. If {querystring} is blank, the first {scriptname} segment (retrieved in step 2) is used as the RRID.
  5. If one of the variables in {querystring} is routingid, its value is used as the RRID.
  6. Otherwise the first {scriptname} segment is used as the RRID.

This means that all of the following example URI's will result in an RRID of 'MICKEY' (assuming that the value of the routingid flag has the default value of 'RXSRTR')

  1. http://192.168.0.1/rxsrtr/mickey/foo/bar
  2. http://192.168.0.1/mickey/foo/bar
  3. http://192.168.0.1/foo/bar?fname=john&rxsrtr=mickey&lname=smith
  4. http://192.168.0.1/mickey/foo/bar?fname=john&lname=smith

In case 1, RXSRTR is specified as a path segment and the subsequent path segment is not blank, so it is used as the RRID. In case 2, RXSRTR is not specified as any of the path segments, and the QUERY_STRING variable is blank, so the first path segment is used as the RRID. In case 3, RXSRTR is not specified as any of the path segments. However, the QUERY_STRING variable does contain a variable called RXSRTR, so that variable's value is used as the RRID. In case 4, RXSRTR is not specified as any of the path segments, and the none of the QUERY_STRING variables is called 'RXSRTR', so the first path segment is used as the RRID.

Control Option: loglvl

The loglvl flag defines the level of logging that will be performed by RXSRTR.

There are three different logging levels available within RXSRTR:

0. Error – Only errors encountered by RXSRTR during initialization or when processing a request are logged.
1. Basic – All initialization information is logged, as well as basic information about each request, including user profile swaps, addition of libraries to the library list, routing identifiers used and the SCRIPT_NAME and QUERY_STRING values used for the request
2. Full – Complete information about each request is logged, including parameter values and response data (where appropriate)

All log entries are written to the RXSRTRLOG file, which contains a 1024-byte free-format field called DATA. Each log record consists of the following:

Start position in DATA field Length of data Data
1 1 Log level ('0', '1' or '2') of log entry
3 26 Qualified HTTP server job name
30 26 Log entry timestamp
57 967 Log entry data

If logging level 1 is specified, all logging at level 0 is also included. If logging level 2 is specified, all logging at logging level 0 and logging level 1 is also included.

If the loglvl flag is not specified or is set to a value other than 0, 1 or 2, logging level 0 is assumed.

Control Option: allowreset

If the allowreset flag is set to *YES, a user can reset the RXS Router from the browser by specifying a value of '*RESET' in the URL (e.g. 'http://192.168.0.1/rxsrtr/*reset'). This will cause the RXS Router to reload all control records from the RXSRTRCTL file. It is recommended that a value of *YES is specified only if the RXS Router is being used on a development machine, since there is no checking to ensure which client used the reset option.

If the allowreset flag is not specified or is set to a value other than *YES, a value of *NO is assumed.

Control Option: debugmode

If the debugmode flag is set to *YES, RXSRTR will run in debug mode. In this mode, instead of calling the specified program, RXSRTR will return a webpage displaying details of the program which would be called, as well as any the values of the QUERY_STRING and SCRIPT_NAME environment variables (if they have been changed due to any conversion options specified with the cvtopt flag).

If the debugmode flag is not specified or is set to a value other than *YES, a value of *NO is assumed.