summaryrefslogtreecommitdiff
path: root/docs/rabbitmq.config.example
blob: 074c6999a33545baac55a98413c89b10d2374450 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
[
 %% ----------------------------------------------------------------------------
 %% RabbitMQ Sample Configuration File.
 %%
 %% See http://www.rabbitmq.com/configure.html for details.
 %% ----------------------------------------------------------------------------

 {rabbit,
  [%%
   %% Network Connectivity
   %%

   %% By default, RabbitMQ will listen on all interfaces, using
   %% the standard (reserved) AMQP port.
   %%
   %% {tcp_listeners, [5672]},

   %% To listen on a specific interface, provide a tuple of {IpAddress, Port}.
   %% For example, to listen only on localhost for both IPv4 and IPv6:
   %%
   %% {tcp_listeners, [{"127.0.0.1", 5673},
   %%                  {"::1",       5673}]},

   %% SSL listeners are configured in the same fashion as TCP listeners,
   %% including the option to control the choice of interface.
   %%
   %% {ssl_listeners, [{"0.0.0.0", 5672}]},

   %% Log levels (currently just used for connection logging).
   %% One of 'info', 'warning', 'error' or 'none', in decreasing order
   %% of verbosity. Defaults to 'info'.
   %%
   %% {log_levels, [{connection, info}]},

   %%
   %% Security/AAA & Default VHost/User
   %%

   %% Configuring SSL.
   %% See http://www.rabbitmq.com/ssl.html for full documentation.
   %%
   %% {ssl_options, [{cacertfile,"/path/to/testca/cacert.pem"},
   %%                {certfile,"/path/to/server/cert.pem"},
   %%                {keyfile,"/path/to/server/key.pem"},
   %%                {verify, verify_peer},
   %%                {fail_if_no_peer_cert, true}]},

   %% Choose the available SASL mechanism(s) to expose.
   %% The two default (built in) mechanisms are 'PLAIN' and
   %% 'AMQPLAIN'. Additional mechanisms can be added via
   %% plugins.
   %%
   %% See http://www.rabbitmq.com/authentication.html for more details.
   %% {auth_mechanisms, ['PLAIN', 'AMQPLAIN']},

   %% Select an authentication database to use. RabbitMQ comes bundled
   %% with a built-in auth-database, based on mnesia.
   %% {auth_backends, [rabbit_auth_backend_internal]},

   %%
   %% Configurations supporting the rabbitmq-auth-mechanism-ssl and
   %% rabbitmq-ldap plugins.
   %%
   %% NB: These options require that the relevant plugin is enabled.
   %% See http://www.rabbitmq.com/plugins.html for further details.
   %%

   %% The RabbitMQ-auth-mechanism-ssl plugin makes it possible to
   %% authenticate a user based on the client's SSL certificate.
   %%
   %% To use auth-mechanism-ssl, add to or replace the auth_mechanisms
   %% list with the entry 'EXTERNAL'.
   %%
   %% {auth_mechanisms, ['EXTERNAL']},

   %% The rabbitmq-auth-backend_ldap allows the broker to perform
   %% authentication and authorisation by deferring to an external LDAP server.
   %%
   %% For more information about configuring the LDAP backend, see
   %% http://www.rabbitmq.com/ldap.html.
   %%
   %% Enable the LDAP auth backend by adding to or replacing the
   %% auth_backends entry:
   %%
   %% {auth_backends, [rabbit_auth_backend_ldap]},

   %% Name of the virtual host to create on first start. See
   %% http://www.rabbitmq.com/access-control.html for further information
   %% about vhosts and access control.
   %%
   %% {default_vhost, <<"/">>},

   %% User name to create on first start.
   %% {default_user, <<"guest">>},

   %% Password for the default user.
   %% {default_pass, <<"guest">>},

   %% Tags for default user.
   %%
   %% For more details about tags, see the documentation for the
   %% Management Plugin at http://www.rabbitmq.com/management.html.
   %%
   %% {default_user_tags, [administrator]},

   %% Set up access control (permissions) for the default user.
   %%
   %% The permissions list consists of rules for configure, write and read
   %% permissions. See http://www.rabbitmq.com/access-control.html for
   %% further details.
   %%
   %% {default_permissions, [<<".*">>, <<".*">>, <<".*">>]},

   %%
   %% Misc/Advanced Options:
   %%
   %% NB: Change these only if you understand what you are doing!
   %%

   %% Set the default AMQP heartbeat delay (in seconds).
   %% {heartbeat, 600},

   %% Set the max permissible size of an AMQP frame (in bytes).
   %% {frame_max, 131072},

   %% Socket configuration.
   %%
   %% See (http://www.erlang.org/doc/man/inet.html#setopts-2) for
   %% further documentation.
   %%
   %% {tcp_listen_options, [binary,
   %%                       {packet,        raw},
   %%                       {reuseaddr,     true},
   %%                       {backlog,       128},
   %%                       {nodelay,       true},
   %%                       {exit_on_close, false}]},

   %%
   %% Resource Limits & Flow Control.
   %%
   %% See http://www.rabbitmq.com/memory.html for more details.
   %%

   %% Memory-based Flow Control threshold.
   %% {vm_memory_high_watermark, 0.4},

   %% Fraction of the high watermark limit at which queues start to
   %% page message out to disc in order to free up memory.
   %% {vm_memory_high_watermark_paging_ratio, 0.5},

   %% Set disk free limit (in bytes). Once free disk space reaches this
   %% lower bound, a disk alarm will be set - see the documentation
   %% listed above for more details.
   %%
   %% {disk_free_limit, 1000000000},

   %% Alternatively, we can set a limit relative to total available RAM.
   %%
   %% {disk_free_limit, {mem_relative, 1.0}},

   %% Override the file handle limit.
   %%
   %% {file_handles_high_watermark, 10000000},

   %% How to respond to cluster partitions.
   %% See http://www.rabbitmq.com/partitions.html for further details.
   %%
   %% {cluster_partition_handling, ignore},

   %% Make clustering happen *automatically* at startup - only applied
   %% to nodes that have just been reset or started for the first time.
   %% See http://www.rabbitmq.com/clustering.html#auto-config for
   %% further details.
   %%
   %% {cluster_nodes, {['rabbit@my.host.com'], disc}},

   %% Set (internal) statistics collection granularity.
   %% {collect_statistics, none},

   %% Statistics collection interval (in milliseconds).
   %% {collect_statistics_interval, 5000},

   %% Explicitly enable/disable hipe compilation.
   %% {hipe_compile, true},

  ]},

 %% ----------------------------------------------------------------------------
 %% Advanced Erlang Networking/Clustering Options.
 %%
 %% See http://www.rabbitmq.com/clustering.html for details
 %% ----------------------------------------------------------------------------
 {kernel,
  [%% Provide an explicit port-range for inter-node communications.
   %% See http://www.rabbitmq.com/clustering.html#firewall for further details.
   %%
   {inet_dist_listen_min, 10000},
   {inet_dist_listen_max, 10005}
  ]}

 %% ----------------------------------------------------------------------------
 %% RabbitMQ Management Plugin
 %%
 %% See http://www.rabbitmq.com/management.html for details
 %% ----------------------------------------------------------------------------

 {rabbitmq_management,
  [%% Pre-Load schema definitions from the following JSON file.
   %% {load_definitions, "/path/to/schema.json"},

   %% Log all requests to the management HTTP API to a file.
   %% {http_log_dir, "/path/to/access.log"},

   %% Change the port on which the HTTP listener listens,
   %% specifying an interface for the web server to bind to.
   %% Also set the listener to use SSL and provide SSL options.
   %%
   %% {listener, [{port, 12345},
   %%             {ip, "127.0.0.1"},
   %%             {ssl, true},
   %%             {ssl_opts, [{cacertfile, "/path/to/cacert.pem"},
   %%                         {certfile,   "/path/to/cert.pem"},
   %%                         {keyfile,    "/path/to/key.pem"}]}]},

  ]},

 {rabbitmq_management_agent,
  [%%
   %% Misc/Advanced Options:
   %%
   %% NB: Change these only if you understand what you are doing!
   %%

   %% {force_fine_statistics, true}
  ]},

 %% ----------------------------------------------------------------------------
 %% RabbitMQ Shovel Plugin
 %%
 %% See http://www.rabbitmq.com/shovel.html for details
 %% ----------------------------------------------------------------------------

 {rabbitmq_shovel,
  [{shovels,
    [%% A named shovel worker.
     %% {my_first_shovel,
     %%  [

     %% List the source broker(s) from which to consume.

     %%   {sources,
     %%    [%% URI(s) and pre-declarations for all source broker(s).
     %%     {brokers, ["amqp://user:password@host.domain/my_vhost"]},
     %%     {declarations, []}
     %%    ]},

     %% List the destination broker(s) to publish to.

     %%   {destinations,
     %%    [%% A singular version of the 'brokers' element.
     %%     {broker, "amqp://"},
     %%     {declarations, []}
     %%    ]},

     %% Name of the queue to shovel messages from.
     %%   {queue, <<"your-queue-name-goes-here">>},

     %% Optional prefetch count.
     %%   {prefetch_count, 10},

     %% when to acknowledge messages:
     %% - no_ack: never (auto)
     %% - on_publish: after each message is republished
     %% - on_confirm: when the destination broker confirms receipt
     %%   {ack_mode, on_confirm},

     %% Static list of basic.properties to set on re-publication.
     %%   {publish_properties, [{delivery_mode, 2}]},

     %% Overwrite fields of the outbound basic.publish.
     %%   {publish_fields, []},

     %% The number of seconds to wait before attempting to
     %% reconnect in the event of a connection failure.
     %%   {reconnect_delay, 2.5}
    ]}
  ]},

 %% ----------------------------------------------------------------------------
 %% RabbitMQ Stomp Adapter
 %%
 %% See http://www.rabbitmq.com/stomp.html for details
 %% ----------------------------------------------------------------------------

 {rabbitmq_stomp,
  [%% Listen only on localhost (ipv4 & ipv6) on a specific port.
   %% {tcp_listeners, [{"127.0.0.1", 61612},
   %%                  {"::1",       61612}]},

   %% Listen for SSL connections on a specific port.
   %% {ssl_listeners, [61613]},

   %% Extract name from client certificate when using SSL.
   %% {ssl_cert_login, true},

   %% Use cn instead of dn when reading from the SSL cert.
   %% {ssl_cert_login_from, common_name},

   %% Set a default user name and password. This is used as the default login
   %% whenever a CONNECT frame omits the login and passcode headers.
   %%
   %% {default_user, [{login, "guest"},
   %%                 {passcode, "guest"}]}
  ]},

 %% ----------------------------------------------------------------------------
 %% RabbitMQ MQTT Adapter
 %%
 %% See http://hg.rabbitmq.com/rabbitmq-mqtt/file/stable/README.md for details
 %% ----------------------------------------------------------------------------

 {rabbitmq_mqtt,
  [%% Set the default user name and password. Will be used as the default login
   %% if a connecting client provides no other login details.
   %%
   %% {default_user, <<"guest">>},
   %% {default_pass, <<"guest">>},

   %% Enable anonymous access.
   %% {allow_anonymous, true},

   %% Specify the vhost to which the adapter connects.
   %% {vhost, <<"/">>},

   %% Specify the exchange to which messages from MQTT clients are published.
   %% {exchange, <<"amq.topic">>},

   %% Specify TTL (time to live) to control the lifetime of non-clean sessions.
   %% {subscription_ttl, 1800000},

   %% Set the prefetch count (governing the maximum number of unacknowledged
   %%  messages that will be delivered).
   %% {prefetch, 10},

   %% TCP/SSL Configuration (as per the broker configuration)
   %% {ssl_listeners, []},
   %% {tcp_listeners, [1883]},

   %% TCP/Socket options (as per the broker configuration).
   %% {tcp_listen_options, [binary,
   %%                       {packet,    raw},
   %%                       {reuseaddr, true},
   %%                       {backlog,   128},
   %%                       {nodelay,   true}]}
  ]},

 %% ----------------------------------------------------------------------------
 %% RabbitMQ AMQP 1.0 Support
 %%
 %% See http://hg.rabbitmq.com/rabbitmq-amqp1.0/file/default/README.md
 %% for details
 %% ----------------------------------------------------------------------------

 {rabbitmq_amqp1_0,
  [%% Connections that are not authenticated with SASL, will connect as this
   %% account. See the README for more information.
   %% {default_user, "guest"},

   %% Enable protocol strict mode. See the README for more information.
   %% {protocol_strict_mode, false}
  ]},

 %% ----------------------------------------------------------------------------
 %% RabbitMQ LDAP Plugin
 %%
 %% See http://www.rabbitmq.com/ldap.html for details.
 %%
 %% ----------------------------------------------------------------------------

 {rabbitmq_auth_backend_ldap,
  [%% Specify server's to bind to. You *must* set this in order for the plugin
   %% to work properly.
   {servers, ["your-server-name-goes-here"]}

   %% Set user DN pattern.
   %% {user_dn_pattern, "cn=${username},ou=People,dc=example,dc=com"},

   %% Enable SSL.
   %% {use_ssl, false},

   %% Specify the LDAP port.
   %% {port, 389},

   %% Enable logging of LDAP queries.
   %% {log, false},

   %% Set the query to use when determining vhost access.
   %% {vhost_access_query, {in_group
   %%                        "ou=${vhost}-users,ou=vhosts,dc=example,dc=com"}},

   %% Set the query to use when determining resource (e.g., queue) access.
   %% {resource_access_query, {constant, true}},

   %% Set queries to determine which tags a user has.
   %% See https://www.rabbitmq.com/management.html#permissions for a detailed
   %% explanation of tags/permissions.
   %% {tag_queries, []}
  ]}
].