Baetyl-timer Configuration
Last Updated:2020-08-18
By default, the module reads configuration file from the etc/baetyl working directory, and the configuration file format is interpreted as follows:
hub:
clientid: Client ID of Client connection Hub. It should not be empty when cleansession is false .
address: [Must] Address of Client connection Hub.
username: [Must] User name of Client connection Hub.
password:If you use account password, you must fill out the password of Client connection Hub, outherwise you do not need to fill out it.
ca: If certificate two-way authentication is adopted, the CA certificate path of Client connection Hub should be filled out.
key: If certificate two-way authentication is adopted, the client private key path of Client connection Hub should be filled out.
cert: If certificate two-way authentication is adopted, the client public key path of Client connection Hub should be filled out.
timeout: Default value: 30s, Time-out period of Client connection Hub
interval: Default value: 1m, Maximum interval time for reconnection of Client connection Hub, increasing to the maximum value from 500 microseconds by doubling.
keepalive: Default value: 10m, Holding time of Client connection Hub
cleansession: Default value: false, Session persistence of Client connection Hub or not.
validatesubs: Default value: false, Client checks Hub subscription result or not; exit after reporting of error in case of subscription failure discovered.
buffersize: Default value: 10, Size of memory queue for Client to send messages to Hub ; message loss can be caused by abnormal exit, and the messages with QoS = 1 will depend on Hub to resend.
timer: timer association attributes
interval: timer module timing interval
publish:
topic: Timing result published to the subject of Hub
#Payload supports golang template, and currently, two types of functions are supported: Time and Rand
payload: "{ \"datetime\": {{.Time.Now}},\"timestamp\": {{.Time.NowUnix}},\"timestampNano\": {{.Time.NowUnixNano}},\"random1\": {{.Rand.Int}},\"random2\": {{.Rand.Int63}},\"random3\": {{.Rand.Intn 10}},\"random4\": {{.Rand.Float64}},\"random5\": {{.Rand.Float64n 60}}, \"anyString\": \"inputString\" }"
logger: Log configuration item
path: It is empty by default, i.e., no file is printed; if a file is appointed, it will be output to file.
level: Default value: Info, log level, supporting debug, info, warn and error.
format: Default value: Text, log print format, supporting text and json
age:
max: Default value: 15, Maximum number of days a log file is retained
size:
max: Default value: 50, Log file size limit, unit MB.
backup:
max: Default value: 15, Maximum number of log files retained.