Dispatcher: httpdispatch (standalone)

httpdispatch is the standalone dispatcher that starts the Genero Application Server (GAS) in command line. No web server is needed.

Important:

The standalone GAS is for development only; provided to simplify your development setup and configuration. For deployment and production systems, you must include a web server.

The Genero Application Server is set up using the GAS configuration file (as.xcf). This file can either be the default configuration file ($FGLASDIR/etc/as.xcf) or a custom one that you specify when starting the Genero Application Server.

The standalone dispatcher can operate in either HTTP or HTTPS mode. If you want to use HTTPS, you can set up SSL certificates by using the --cert-file and --cert-key options. For testing, you can use a self-signed certificate instead of the Certificate Authority (CA)-signed certificate required for production environments.

To learn how to create self-signed certificates, refer to the Certificates in practice section in the Genero Business Development Language User Guide.

You can start the standalone dispatcher from the command line by using the following commands:

For HTTP:
httpdispatch
For HTTPS:
httpdispatch --cert-file myCert.pem --cert-key myCert-key.pem 
Alternatively, on Linux®/UNIX™ if using the GAS systemd service, you can execute the following command:
systemctl start httpdispatch.service

Syntax

httpdispatch [options [...]] [@argfile]
  1. options can be an option as described in Table 1.
  2. argfile defines a file that contains a list of override (-E) commands. The options file must use the following format:
    option-name 
    option-value
    [...]
    For examples, go to Set override options in a file.

Options

Table 1. httpdispatch options
Option Description

-h

--help

Displays help information.

-p directory

--as-directory directory

Specify the Genero Application Server directory.

-f configuration_file

--configuration-file configuration_file

Specify which configuration file to use when starting the Genero Application Server dispatcher. If not specified, the default configuration file, $FGLASDIR/etc/as.xcf, is used.

-k

--no-keep-alive

Disable keep alive for HTTP connections. For debug purpose only.

-E name=value

--resource-overwrite name=value

Overwrites the resource defined in the configuration file or creates a new one.

Example:

httpdispatch
 -E res.dvm.wa=$FGLDIR/bin/myrun

If in the configuration file "res.dvm.wa" has another value it is now set to myrun. The final value is the one set in the option.

-V

--version

Displays version information.
--pid-file filename Write the dispatcher process-id to the specified file. The file is created. If the file exists, it is overwritten.
--dump-command Verify the dispatcher start-up commands by outputting them to standard out.
--cert-key pem-key Server private key, where pem-key can be the name of a PEM-encoded private key file.
--cert-file filename Server certificate, where filename is the name of the certificate file in the PEM format.
--keep-alive-timeout seconds Specify the time in seconds the dispatcher will wait for a subsequent HTTP request before closing the connection with the client. Once a request has been received, the timeout value applies. By default the keep-alive-timeout is 15 seconds.

The same timeout applies while the dispatcher reads the headers or body of a request. If no data arrives for that time, the dispatcher returns the HTTP status 408.

--application-group

XML file describing additional application groups.

--service-group

XML file describing additional service groups.

Request size limits

The standalone dispatcher limits the size of the HTTP requests it accepts, and refuses a larger request with an HTTP status:

Table 2. httpdispatch request size limits
Request part Default limit HTTP status when exceeded Configuration element
Headers, total size 65536 bytes (64 KB) 431 MAX_REQUEST_HEADER_SIZE
Body 104857600 bytes (100 MB) 413 MAX_REQUEST_BODY_SIZE

For the other HTTP statuses that httpdispatch returns, and how to resolve them, go to HTTP statuses from the standalone dispatcher.

What does "address already in use" mean ?

The message "address already in use" means that an application server (dispatcher) has already been started on the same port. Check the GAS configuration file (default $FGLASDIR/etc/as.xcf ) to identify the port where the application server (dispatcher) started. The port number is identified in the following section:
<INTERFACE_TO_CONNECTOR>
  <TCP_SERVER_PORT>$(res.ic.server.port)</TCP_SERVER_PORT>
  #  ...
</INTERFACE_TO_CONNECTOR>

The default port is specified by the resource res.ic.server.port, which is set to 6394. Set the values to a port which is not used by another application.

Restarting the standalone GAS

To restart httpdispatch, use:
kill -9

Once the web server restarts the dispatcher, the dispatcher uses the session table to reconnect to the various proxies. The applications maintained by proxies, are still running, and once the dispatcher is relaunched, the user can continue his or her work.

Pressing CTRL-C or sending SIGTERM will stop the standalone dispatcher, and in both cases the dispatcher will request all proxies to stop. With kill -9 the dispatcher process is killed yet the sessions remain alive and untouched. When the dispatcher is restarted, the sessions continue to be active. Notice, the fastcgi dispatcher will stop sessions on pressing CTRL-C too if started in standalone mode. But not on SIGTERM.