Introduction
Configuration
Language Support
AMQP 0-9-1 Overview
More Exchange Types
More Consumer Features
Queue Deep-dive
Other Features
Reliable Message Delivery
High Availability
Monitoring
Management HTTP API
Tutorials
Networking
LavinMQ CLI
Configuration files
What is the LavinMQ configuration file?
Most settings in LavinMQ can be tuned using the configuration file. The structure of the configuration file is INI and comprises key-value pairs for properties and sections that organize the properties. The sections are split into four; one [main] section for general settings, one for the LavinMQ Management Interface [mgmt], one for amqp settings [amqp], one for MQTT settings [mqtt], one for clustering settings [clustering]. The syntax can be explained as:
- One setting uses one line
- Lines are structured Key = Value
- Any line starting with the ; character indicates a comment
Where is the configuration file located?
The default configuration file location is /etc/lavinmq/lavinmq.ini
How do config changes take effect?
Changes to the configuration file will be applied after a restart of LavinMQ.
Configuration settings
The tables below outline the different settings available for LavinMQ by section, including their default values and examples.
[main]
consumer_timeout |
Default consumer timeout for acks.
Default: consumer_timeout = nil (UInt64?)
|
data_dir |
The path of the data directory where all data is stored.
Default: data_dir = /var/lib/lavinmq (String)
|
data_dir_lock |
Use file lock in the data directory
Default: data_dir_lock = true
|
default_consumer_prefetch |
Default prefetch value for consumers if not set by consumer.
Default: default_consumer_prefetch = 65535
|
default_password |
Hashed password for default user. Use lavinmqctl hash_password or /api/auth/hash_password to generate password hash.
Default: default_password = +pHuxkR9fCyrrwXjOD4BP4XbzO3l8LJr8YkThMgJ0yVHFRE+
|
default_user |
Default user.
Default: default_user = guest
|
free_disk_min |
The minimum value of free disk space in bytes before LavinMQ starts to control flow.
Default: free_disk_min = 0
|
free_disk_warn |
The minimum value of free disk space in bytes before LavinMQ warns about low disk space.
Default: free_disk_warn = 0
|
guest_only_loopback |
Limit guest user to only connect from loopback address.
Default: guest_only_loopback = true
|
log_exchange |
Enable log exchange
Default: log_exchange = false
|
log_file |
Path to file log file. If no path is set, log is written to STDOUT.
Default: log_file = nil
|
log_level |
Controls how detailed the log should be. The level can be one of:
Default: log_level = info
|
max_deleted_definitions |
Number of deleted queues, unbinds etc that compacts the definitions file.
Default: max_deleted_definitions = 8192
|
segment_size |
Size of segment files.
Default: segment_size = 8388608
|
set_timestamp |
Boolean value for setting the timestamp property.
Default: set_timestamp = false
|
socket_buffer_size |
Socket buffer size in bytes.
Default: socket_buffer_size = 16384
|
stats_interval |
Statistics collection interval in milliseconds.
Default: stats_interval = 5000
|
stats_log_size |
Number of entries in the statistics log file before oldest entry removed.
Default: stats_log_size = 120
|
tcp_keepalive |
tcp_keepalive settings as a tuple, {idle, interval, probes/count}.
Default: tcp_keepalive = {60, 10, 3}
|
tcp_nodelay |
Boolean value for disabling Nagle's algorithm, and sending the data as
soon as it's available.
Default: tcp_nodelay = false
|
tcp_recv_buffer_size |
TCP receive buffer size.
Default: tcp_recv_buffer_size = nil
|
tcp_send_buffer_size |
TCP send buffer size.
Default: tcp_send_buffer_size = nil
|
tls_cert |
TLS certificate (including chain).
Default: tls_cert = nil
Example: tls_cert = /etc/lavinmq/cert.pem
|
tls_key |
Private key for the TLS certificate.
Default: tls_key = nil
Example: ls_key = /etc/lavinmq/key.pem
|
tls_ciphers |
List of TLS ciphers to allow
Example: tls_ciphers = nil
|
tls_min_version |
Minimum allowed TLS version. Allowed options:
Default: tls_min_version = 1.2
|
[mgmt]
bind |
IP address that the HTTP server will listen on.
Default: bind = 127.0.0.1
|
port |
Port used for connections.
Default: port = 15672
|
tls_port |
Port used for TLS connections.
Default: tls_port = -1
|
unix_path |
UNIX path to listen to
Default: unix_path = /tmp/lavinmq-http.sock
|
[amqp]
bind |
IP address that both the AMQP and HTTP servers will listen on.
Default: bind = 127.0.0.1
|
channel_max |
Maximum number of channels to negotiate with clients. Setting to 0 means
an unlimited number of channels.
Default: channel_max = 2048
|
frame_max |
Maximum frame size in bytes.
Default: frame_max = 1048576
|
heartbeat |
Timeout value in seconds suggested by the server during connection
negotiation. If set to 0 on both server and client, heartbeats are
disabled.
Default: Heartbeat = 0
|
max_message_size |
The maximum message size in bytes.
Default: max_message_size = 128 * 1024**2
|
port |
Port used for AMQP connections
Default: port = 5672
|
systemd_socket_name |
Default:
systemd_socket_name = lavinmq-amqp.socket
|
tcp_proxy_protocol |
Boolean value for PROXY protocol on amqp tcp connections
Default: tcp_proxy_protocol = false
|
tls_port |
Port used for TLS (AMQPS) connections
Default: tls_port = 5671
|
unix_path |
UNIX path to listen to
Default: unix_path = /tmp/lavinmq.sock
|
unix_proxy_protocol |
Boolean value for PROXY protocol on unix domain socket connections
Default: unix_proxy_protocol = true
|
[MQTT]
bind |
IP address that AMQP, MQTT, and HTTP servers will listen on.
Default: bind = 127.0.0.1
|
port |
Port for non-TLS MQTT connections.
Default: port = 1883
|
tls_port |
Port for TLS-enabled MQTT connections
Default: port = 8883
|
mqtt_unix_path |
UNIX path to listen to
Default: unix_path = /tmp/lavinmq-mqtt.sock
|
max_inflight_messages |
Maximum number of messages in flight simultaneously.
Default: 65535
|
[clustering]
advertised_uri |
Advertised URI for the clustering server.
Default: advertised_uri = nil
|
bind |
Listen for clustering followers on this address.
Default: bind = 127.0.0.1
|
enabled |
Enable clustering.
Default: enabled = false
|
etcd_endpoints |
Comma separated host:port pairs
Default: etcd_endpoints = localhost:2379
|
etcd_prefix |
Key prefix used in etcd.
Default: etcd_prefix = lavinmq
|
max_unsynced_actions |
Maximum number of unsynced actions.
Default: max_unsynced_actions = 8192
|
port |
Listen for clustering followers on this port.
Default: port = 5679
|
Example configuration file
An example configuration file can be found in the LavinMQ repo on GitHub.
[main]
data_dir = /var/lib/lavinmq
guest_only_loopback = true
log_level = info
[mgmt]
bind = 0.0.0.0
port = 15672
tls_port = 15671
unix_path = /tmp/lavinmq-http.sock
[amqp]
bind = 0.0.0.0
port = 5672
tcp_proxy_protocol = false
tls_port = 5671
unix_path = /tmp/lavinmq.sock
unix_proxy_protocol = true
Ready to take the next steps? Here are some things you should keep in mind:
Managed LavinMQ instance on CloudAMQP
LavinMQ has been built with performance and ease of use in mind - we've benchmarked a throughput of about 1,000,000 messages/sec. You can try LavinMQ without any installation hassle by creating a free instance on CloudAMQP. Signing up is a breeze.
Help and feedback
We welcome your feedback and are eager to address any questions you may have about this piece or using LavinMQ. Join our Slack channel to connect with us directly. You can also find LavinMQ on GitHub.