QUECMDS Section


The QUECMD section defines the processing for each message received. There are 3 commands that can be processed by DBNet.

CLNT

The CLNT command is used to transfer the message from the local DBNet to a remote DBNet. The CLNT command uses a program called IFCP to transfer the message. The message will be transferred to the pending queue on the remote DBNet.

EXEC

The EXEC command is used to run a program on the local computer. The parameters can be specified on the QUECMD. The first parameter must be the threadedness attribute(single or multi).

FTPGET

The FTPGET command is used to transfer a file from the remote system to the local system. The FTPGET command uses the username and password from the HOST section to log into the remote system. The MESSAGE section defines the directory, filename and permission of the local file. FTPGET uses an internal implementation of the ftp client to provide more robust processing. FTPGET does not have any command line parameters.

FILE

The FILE command applies to WMO messages only. The command provides a mechanism for WMO messages to be accumulated in a specified file. The File name can contain the strftime format specifiers as defined by the standard C library. The specifiers beginning with % are used to get the current date/time whereas the specifiers that begin with $ will use the WMO message header time.

Because of the multiprocessing nature of DBNet we had to provide a mechanism to control the number of process that can be running simultaneously. Each command has a "threadedness" attribute, some are built in, some are user defined. The CLNT command is single threaded based upon Host ID and Message ID i.e.: only one CLNT command to cray4 for Message ID BF20 can be executing at any particular time. However many CLNT commands can be executing to different hosts at any particular time. The FPTGET command has a similar property. Only one FTPGET to a Host ID and Message ID can be running at one time. The EXEC command allows this property to be controlled by this table.

The format of a QUECMD is:

QUECMD message-type HOSTID:MESSAGEID command_timeout(minutes) command_parameters

for example, the command:

QUECMD ALERT ^0066GE46 FTPGET 10

will ftp the file from the originating host when an ALERT from host 0066 with a Message ID of GE46 is received. The ftp will automatically be retried for 10 minutes if it fails.

The command:

QUECMD ALERT ^0066GE47 CLNT 30 cray4.fb4.noaa.gov

will forward ALERT messages from host 0066 Message ID GE46 to cray4 using IFC.

There is one more format for QUECMDS. The GROUP format. There are times where several commands need to operate on the same message. The order and synchronization of the commands may be critical to the success of each command. To provide this flow control/threaded processing DBNet uses the GROUP command. The GROUP command ties together a series of QUECMDS. The order of running of each command can be controlled based on the success or failure of the previous command. The example below will run the program process_data on the input BUFR message. If process_data completes successfully the processing will continue by running process_data_2. If process_data_2 completes successfully then the ENDGROUP will be processed. If process_data or process_data_2 fails the program alert_user_to_failure will be executed. Each command will execute one time.

GROUP BUFR ^0066BF20 Process_buffer_data single 60

GCMD CONT:2 0 CONT 0 EXEC 1 single process_data

GCMD CONT 0 CONT:3 0 EXEC 1 single process_data_2

GCMD CONT 0 CONT 0 EXEC 1 single alert_user_to_failure

ENDGROUP

The first line of the GROUP is the group definition line. The definition lines defines what data the group should process, the name of the group, the multithreadedness of the group and the timeout value. In this example the group will process BUFR message from host 0066 of type BF20. The name of the group is "Process_buffer_data". The group is single threaded. The timeout value is 60 minutes. Each line within the group has the following format:

GCMD failure-process:line-number failure-retry-count sucesssfull-process:line-number successful-retry-count command.

The failure-process:line-number field defines the next entry in the group to process should this entry fail. The second line of the group command above will cause the group processing to continue at GCMD 2 (3rd GCMD) if process_data fails. This field can be either CONT or ABORT with an optional :line-number. The failure retry count is the number of times to retry executing this command. In this case 0 means do not retry if this command fails. the retry count in combination with the timeout determines how long to try a command. A -1 retry count means try infinite number of times, or until timeout minutes have past. The successfull-process:line-number has the same meaning for successful executions. The command field is the entire command as specified above.

See Also