On this page |
Lightweight message queue server that uses request-reply over TCP. Uses a push-pull message mechanism where messages are pushed by any client and pulled by other clients.
mqserver.exe [-i ip] [-p port] [-n max_connections] [-l log_level] [-c connection_file] [-g log_file] [-w port max_connections urlpath] [-t max_idle_seconds] [-m max_events] [-r] [-s]
Example ¶
To... | Do this |
---|---|
Start a persistent MQ Server |
Callback Port is set to 53001 and Relay Port is set to 53000. HTTP server port is what is used by the pdg jobs (their Callback Port). The ports may have been chosen because they are accessible through machine firewalls. The Callback Port port must be open for outgoing connections on the farm machines, and incoming connections on the machine running MQ Server. Likewise the Relay Port must be open for incoming connections on the machine running MQ Server, and open for outgoing connections on the submitter’s machine (the machine running the TOP Cook). #!/bin/bash RELAYPORT=53000 HTTP_CALLBACK_PORT=53001 echo "STARTING MQSERVER with RELAY PORT ${RELAYPORT} and HTTP CALLBACK PORT ${HTTP_CALLBACK_PORT}" /mnt/hq/houdini_distros/hfs.linux-x86_64/bin/mqserver -s -p ${RELAYPORT} -n 1024 -l 2 -w ${HTTP_CALLBACK_PORT} 1024 result |
Connect to the persistent MQ Server |
With the above running on for example host
|
Options ¶
If the -i
option is provided, the server will use it as the IP address
for the client endpoint. Not specifying or using * results in server
automatically using the IP assigned to it. E.g. -i 127.0.0.1
If the -p
option is provided, the server will be run on the specified
port. Otherwise, the program will automatically scan for the first
available port.
The -n
option specifies the maximum number of connections. If it is
not specified, the maximum number of connections will default to 1024.
The -l
option specifies the log level. The log levels are:
0 - None, 1 - Errors, 2 - Warnings, 3 - All. If this option is not
provided, the log level will be set to 1 (Errors).
If the -c
option is provided, the server will write a connection
details file to the specified path.
If the -g
option is provided, the server will direct all logging to the
specified file by redirecting stdout
and stderr
.
If the -w
option is provided, a HTTP server will also be started
at specified port, with max connections, and url relative path
(e.g. '-w 5001 64 report/result' will listen at
http://127.0.0.1:5001/report/result with 64 max connections).
If the -t
option is provided, then this will automatically shutdown
the server after the specified time in seconds if there hasn’t been any
network activity during the time.
If the -m
option is provided, then the maximum number of events per tick
will be set to the specified value. The default is 50.
If the -k
option is provided, the server will authenticate itself to clients
using TLS with the certificate and private key in the file given. This can also
be provided using an environment variable with the name PDG_MQ_SERVER_CERT_KEY
.
If the -a
option is provided, TLS authentication will be required for
clients to connect; clients will be verified using the CA chains given.
CA chain file names must be comma separated without spaces; you can also use
standard 'globbing' syntax, ex: '-a *.pem,dir/extra.pem'. This can also be
provided using an environment variable with the name PDG_MQ_SERVER_CA_CHAINS
(files should be semicolon separated on windows and colon separated on mac/linux).
Clients can connect using the tls+tcp
protocol by setting the environment
variables PDG_MQ_CLIENT_CERT_KEY
and PDG_MQ_CLIENT_SERVER_NAME
to their
certificate/private key file path and server name (if present in the server’s
certificate) respectively. The enviroment variable PDG_MQ_CLIENT_CA_CHAIN
can
also be set to the server’s certificate file path if clients should be required
to authenticate the server.
If the -r
option is provided, the server will use round robin load
balancing when sending messages to clients with the same name.
If the -s
option is provided, then this will run as a persistent
server (e.g. service) which means it cannot be remotely shutdown
nor will it timeout when no clients are connected.