Send administrative messages to user agents
You can send administrative messages to user agents with the gasadmin send-message command.
The gasadmin send-message command allows an administrator of the GAS to send messages to connected users on the specified applications and sessions, or to connected user on all sessions running in the GAS.
The message can be a simple notification message, such as the server needs to restart, or the service will be unavailable due to maintenance at a specified date and time, and so on. The message length must be limited to 3066 bytes to avoid exceeding the HTTP header maximum length of 4096 bytes.
To send a message to connected users on all sessions running in the GAS, use the following command.
gasadmin send-message "The server will be shutting down in 10 minutes."
The user will see the message displayed on the front-end. The message will appear in the application interface Chromebar of the Genero Browser Client. No response is expected from the user.
The next paragraphs show examples of different uses of the command. (Line breaks have been added to the command examples to improve readability.)
Example 1: Send message to the specified applications
Specify the application by name. While you typically include both the group and the
application name using the format "--app
group-name/app-name
", you must not
include the group when the application is in the _default
application
group. For applications in the _default
group, simply provide the
application name using the format "--app app-name
".
gasadmin send-message --app gwc-demo
--app mygroup/myapp "hello world"
Example 2: Send message to the specified sessions
Specify the session with its session-id.gasadmin send-message --session b509ade99204f7cfc91726deba36dee6
--session 3e65a8fc5b10fa2f57cda0c44466cb74c7722a28 "hello world"
Example 3: Send message to the specified applications and sessions
The options --app
and --session
can be repeated and can
be specified in any order.
gasadmin send-message --app gwc-demo
--session b509ade99204f7cfc91726deba36dee6
--app mygroup/myapp
--session 3e65a8fc5b10fa2f57cda0c44466cb74c7722a28 "hello world"
Example 4: Send message to lists of applications and sessions
The options--app
and --session
can can take a
comma-separated list of
values.gasadmin send-message --app gwc-demo,mygroup/myapp
--session b509ade99204f7cfc91726deba36dee6,3e65a8fc5b10fa2f57cda0c44466cb74c7722a28
"hello world"
Handle user inactivity
In case of user inactivity at the time of the broadcast, the message will be displayed when
the front-end next sends a response via the USER_AGENT ping request to keep the session
alive. The default $app.timeout.useragent
setting in the GAS configuration
file (as.xcf) is 300 seconds. The GAS administrator should allow for
this timeout delay before taking any action such as shutting down the server.
USER_AGENT
ping is configurable per application, but it is recommended
you use the same timeout for all applications, and when starting the dispatcher provide the
value via the override -E
option as follows:
httpdispatch -E app.timeout.useragent=300