RabbitMQ新旧配置文件格式

编辑于 2022-05-10 02:31:04 阅读 1085

新的配置格式更简单,更易于人类阅读和机器生成。与 RabbitMQ 3.7.0 之前使用的经典配置格式相比,它也相对有限。例如,在配置 LDAP 支持时,可能需要使用深度嵌套的数据结构来表达所需的配置。为了满足这种需求,现代 RabbitMQ 版本允许在单独的文件中同时使用两种格式:

配置文件 rabbitmq.conf 允许配置 RabbitMQ 服务器和插件。从 RabbitMQ 3.7.0 开始,格式为 sysctl 格式。

主配置文件新,旧的变化

# 一种新的样式格式片段,rabbitmq.conf 文件使用这种格式。
ssl_options.cacertfile           = /path/to/ca_certificate.pem
ssl_options.certfile             = /path/to/server_certificate.pem
ssl_options.keyfile              = /path/to/server_key.pem
ssl_options.verify               = verify_peer
ssl_options.fail_if_no_peer_cert = true

%% 经典格式片段,现在由 advanced.config 文件使用。
[
  {rabbit, [{ssl_options, [{cacertfile,           "/path/to/ca_certificate.pem"},
                           {certfile,             "/path/to/server_certificate.pem"},
                           {keyfile,              "/path/to/server_key.pem"},
                           {verify,               verify_peer},
                           {fail_if_no_peer_cert, true}]}]}
].

https://www.rabbitmq.com/configure.html

广而告之,我的新作品《语音助手》上架Google Play了,欢迎下载体验