-
Notifications
You must be signed in to change notification settings - Fork 0
Advanced Options
Outboxer leverages a YAML configuration file for setting up advanced options such as concurrency levels, buffer limits, and polling intervals.
Command line options take the highest precedence and are applied first. If a configuration file exists at the default location, config\outboxer.yml
, it will be read next to apply any settings not specified on the command line. Lastly, if neither command line options nor the configuration file provides certain settings, Outboxer will use its internal defaults. This tiered approach ensures you can finely tune the behavior of Outboxer for your specific needs. You can also specify a different location for the configuration file using command line flags.
The configuration file uses YAML format and allows specifying settings that are global or environment-specific.
Here's an example of the configuration file:
---
:buffer: 100
:concurrency: 1
:tick: 0.1
:poll: 5.0
:heartbeat: 5.0
:log_level: 1
staging:
:buffer: 250
:concurrency: <%= ENV['RAILS_MAX_THREADS'] %>
- buffer: The limit for the message buffer size.
- concurrency: The number of threads to run concurrently.
- tick: The interval at which the buffer checks for new messages.
- poll: The frequency, in seconds, at which Outboxer polls for new events.
- heartbeat: The interval, in seconds, for sending heartbeat signals to ensure the process is alive.
- log_level: The severity level for logging events (1 for critical, 5 for debug, etc.).
Note: Environment-specific settings override the global settings
You can also specify configuration options directly on the command line and these will override the settings in the configuration file
outboxer_publisher [options]
-
-c, --concurrency INT
: Set the number of concurrent threads. -
-b, --buffer LIMIT
: Set the buffer limit for messages. -
-p, --poll NUM
: Set the poll interval in seconds. -
-C, --config PATH
: Specify the path to a YAML config file. -
-l, --log-level LEVEL
: Set the logging level. -
-V, --version
: Print the version of Outboxer and exit. -
-h, --help
: Show the help message.
Outboxer reads the specified YAML configuration file, processes it with ERB, and then loads the settings according to the specified or detected environment. If the configuration file does not exist, Outboxer will proceed with default settings.
Use this approach to customize Outboxer's operation for different deployment environments, ensuring it performs optimally according to your application's specific needs.