##-------------------------------------------------------------------- ## EMQX Retainer ##-------------------------------------------------------------------- ## Where to store the retained messages. ## ## Notice that all nodes in the same cluster have to be configured to retainer { ## enable/disable emqx_retainer enable = true ## Periodic interval for cleaning up expired messages. Never clear if the value is 0. ## ## Value: Duration ## - h: hour ## - m: minute ## - s: second ## ## Examples: ## - 2h: 2 hours ## - 30m: 30 minutes ## - 20s: 20 seconds ## ## Default: 0s msg_clear_interval = 0s ## Message retention time. 0 means message will never be expired. ## ## Default: 0s msg_expiry_interval = 0s ## When the retained flag of the PUBLISH message is set and Payload is empty, ## whether to continue to publish the message. ## see: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718038 ## ## Default: false #stop_publish_clear_msg = false ## The message read and deliver flow rate control ## When a client subscribe to a wildcard topic, may many retained messages will be loaded. ## If you don't want these data loaded to the memory all at once, you can use this to control. ## The processing flow: ## load batch_read_number retained message from storage -> ## deliver -> ## repeat this, until all retianed messages are delivered ## flow_control { ## The messages batch number per read from storage. 0 means no limit ## ## Default: 0 batch_read_number = 0 ## The number of retained message can be delivered per batch ## Range: [0, 1000] ## Note: If this value is too large, it may cause difficulty in applying for the token of deliver ## ## Default: 0 batch_deliver_number = 0 ## The rate limiter name for retained messages delivery. ## In order to avoid delivering too many messages to the client at once, which may cause the client ## to block or crash, or message dropped due to exceeding the size of the message queue. We need ## to specify a rate limiter for the retained messages delivery to the client. ## ## The names of the available rate limiters are taken from the existing rate limiters under `limiter.batch`. ## You can remove this field if you don't want any limit ## Default: retainer batch_deliver_limiter = retainer } ## Maximum retained message size. ## ## Value: Bytes max_payload_size = 1MB ## Storage backend parameters ## ## Value: built_in_database ## backend { type = built_in_database ## storage_type: ram | disc storage_type = ram ## Maximum number of retained messages. 0 means no limit. ## ## Value: Number >= 0 max_retained_messages = 0 } }