首页 > 技术文章 > RabbitMQ配置文件(advanced.config)

masy-lucifer 2020-08-23 22:23 原文

这是advanced.config配置文件示例:

 

[

%% ------------------------------------------------ ----------------------------

%%高级Erlang网络/群集选项。

%%

%%有关详细信息,请参见https://www.rabbitmq.com/clustering.html

%% ------------------------------------------------ ----------------------------

%%设置net_kernel的滴答时间。

%%请参阅http://erlang.org/doc/man/kernel_app.html和

%% https://www.rabbitmq.com/nettick.html了解更多详细信息。

%%

%% {kernel,[{net_ticktime,60}]},

%% ------------------------------------------------ ----------------------------

%% RabbitMQ Shovel插件

%%

%%有关详细信息,请参见https://www.rabbitmq.com/shovel.html

%% ------------------------------------------------ ----------------------------

 

{rabbitmq_shovel,

[{shovels,

[%% A named shovel worker.

%% {my_first_shovel,

%% [

 

%% 列出要消费的源代理。

%%

%% {sources,

%% [%% URI(s) and pre-declarations for all source broker(s).

%% {brokers, ["amqp://user:password@host.domain/my_vhost"]},

%% {declarations, []}

%% ]},

 

%%列出要发布到的目标代理。

%% {destinations,

%% [%% A singular version of the 'brokers' element.

%% {broker, "amqp://"},

%% {declarations, []}

%% ]},

 

%% shovel 中消息队列的名称

%%

%% {queue, <<"your-queue-name-goes-here">>},

 

%% 可选的预取计数。

%%

%% {prefetch_count, 10},

 

%%何时确认消息:

%%-no_ack:从不(自动)

%%-on_publish:每封邮件重新发布后

%%-on_confirm:目标经纪人确认收货时

%%

%% {ack_mode, on_confirm},

 

%% 覆盖出站basic.publish的字段。

%%

%% {publish_fields, [{exchange, <<"my_exchange">>},

%% {routing_key, <<"from_shovel">>}]},

 

%% 要在重新发布时设置的basic.properties的静态列表。

%%

%% {publish_properties, [{delivery_mode, 2}]},

 

%%尝试尝试之前要等待的秒数连接失败时重新连接。

%%

%% {reconnect_delay, 2.5}

 

%% ]} %% my_first_shovel的结尾

]}

%% Rather than specifying some values per-shovel, you can specify

%% them for all shovels here.

%%除了指定每个shovel的某些值外,您还可以指定

%%他们为这里的所有shovel。

%%

%% {defaults, [{prefetch_count, 0},

%% {ack_mode, on_confirm},

%% {publish_fields, []},

%% {publish_properties, [{delivery_mode, 2}]},

%% {reconnect_delay, 2.5}]}

]},

 

{rabbitmq_auth_backend_ldap, [

%%

%% 授权

%% =============

%%

 

%% LDAP插件可以针对您的服务器执行各种查询

%% LDAP服务器确定授权问题。看到

%% https://www.rabbitmq.com/ldap.html#authorisation了解更多信息。

 

%% 设置确定虚拟主机访问时要使用的查询

%%

%% {vhost_access_query, {in_group,

%% "ou=${vhost}-users,ou=vhosts,dc=example,dc=com"}},

 

%% 设置要在确定资源(例如队列)访问时使用的查询

%%

%% {resource_access_query, {constant, true}},

 

%% 设置查询以确定用户拥有哪些标签

%%

%% {tag_queries, []}

]}

].

github链接:https://github.com/rabbitmq/rabbitmq-server/blob/master/docs/advanced.config.example

推荐阅读