1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/mqtt-rs-rmqtt

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
store-message.md 2.2 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
rmqtt Отправлено 26.08.2024 16:37 72c18f5

English | 简体中文

Store unexpired messages

Messages that are published will be stored until they expire. As long as a message remains unexpired, any subscriptions made to the corresponding topic after the message is published will be forwarded. Messages will be automatically cleared once they expire.

Plugin:

rmqtt-message-storage

Plugin configuration file:

plugins/rmqtt-message-storage.toml

Plugin configuration options:

##--------------------------------------------------------------------
## rmqtt-message-storage
##--------------------------------------------------------------------

##ram, redis
storage.type = "ram"

##ram
storage.ram.cache_capacity = "3G"
storage.ram.cache_max_count = 1_000_000
storage.ram.encode = true

##redis
storage.redis.url = "redis://127.0.0.1:6379/"
storage.redis.prefix = "message-{node}"

##Quantity of expired messages cleared during each cleanup cycle.
cleanup_count = 5000

Currently, there are two supported storage engines: "ram" and "redis." "ram" stores data in local memory and allows configuration of maximum memory usage or maximum number of messages. It also supports indicating whether messages should be encoded before storage. "redis" storage currently only supports single-node configurations. Prefix configuration facilitates multiple RMQTT nodes using the same Redis storage service. {node} will be replaced with the identifier for the current node.

By default, this plugin is not enabled. To activate it, you must add the rmqtt-message-storage entry to the plugins.default_startups configuration in the main configuration file rmqtt.toml, as shown below:

##--------------------------------------------------------------------
## Plugins
##--------------------------------------------------------------------
#Plug in configuration file directory
plugins.dir = "rmqtt-plugins/"
#Plug in started by default, when the mqtt server is started
plugins.default_startups = [
    #"rmqtt-retainer",
    #"rmqtt-auth-http",
    #"rmqtt-cluster-broadcast",
    #"rmqtt-cluster-raft",
    #"rmqtt-sys-topic",
    "rmqtt-message-storage",
    #"rmqtt-session-storage",
    "rmqtt-web-hook",
    "rmqtt-http-api"
]

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/mqtt-rs-rmqtt.git
git@api.gitlife.ru:oschina-mirror/mqtt-rs-rmqtt.git
oschina-mirror
mqtt-rs-rmqtt
mqtt-rs-rmqtt
master