# address of the rabbitmq server
rabbitmq-address:       amqp://guest:guest@localhost/delayer

# queue from which delayed message are read (can also be exchange:routingkey to listen to a specific exchange)
rabbitmq-queue:         delayed

# exchange to which messages are published after passing their delay
rabbitmq-exchange:

# routing key used for messages that are published after passing their delay, when set to
# an empty string, messages will be published with their original routing key
rabbitmq-routingkey:    immediate

# should the reply_to property of messages define the queue to which messages are published?
# If so, it overrides the rabbitmq-exchange and rabbitmq-routingkey above. Messages without a
# reply-to setting will be sent to the above exchange/routingkey anyways. When this setting it
# false, the reply-to header is not even inspected and all messages are forwarded to the exchange.
rabbitmq-usereplyto:    false

# quality of service: number of messages loaded from rabbitmq into memory by the main thread
# this number should be a bit higher than the groupsize because that is the number of messages
# that are kept in memory to group multiple writes into a single transaction, add some extra
# for messages that are transit (consume -> publish > receive-confirm > send-ack)
rabbitmq-qos:           1000

# throttle: number of messages to publish to rabbitmq by the reviver-thread, if this limit is
# reached we wait until rabbitmq has handled enough messages, this setting is used to prevent
# that we overload rabbitmq (rabbit gets slow when you send too many messages)
rabbitmq-throttle:      1000

# directory or mongodb:// url where data is to be stored 
# Note that each running instance of the delayer should have its own mongo collection or directory
storage:                /tmp/amqpdelayer

# for lmdb storage, max size of the database files
mapsize:                10GB

# the number of write operations to group in one transaction (make sure this is lower than the
# qos otherwise no new messages are loaded while the transaction is being filled), this prevents
# that we store one-message-at-a-time, but bundles multiple writes in a single operation
groupsize:              500

# timeout: max number of seconds to wait before flushing in-memory messages to storage, and acking
# them, make sure this timeout is lower than the RabbitMQ consumer-timeout, messages are thus
# flushed to disk either when the groupsize is reached, or when the timer expires
timeout:                120

# batchsize: the min number of messages that are (attempted) to be loaded from storage in one go, 
# used in combination with the rabbitmq throttle (see above) to prevent that small batches are 
# loaded then publishing is just below the throttle (if throttle=100, batchsize=10 and 95 publish
# msgs, are in transit, the delayer waits until this drops to 90 to load the next batch of 10)
batchsize:              100

# the operation mode, can be "delayer", "reviver" or "both". when running as "delayer", it only
# reads messages from rabbitmq and forwards them, or puts them in storage, when running as "reviver"
# it only checks storage and passes it on to rabbitmq. Default is to do both.
mode:                   both

# the shutdown procedure, when you set this to "return" or "forward", all messages that are stored are 
# published back to RabbitMQ on shutdown. With "return" they are published back tot the queue from
# which they were read, and "forward" passes them on to the configured exchange and queue (see above).
# For historical reasons, the value "republish" is treated the same as "forward". This options is
# useful when running in a containerized environment with non-persistent storage (like emptyDir on 
# Kubernetes). This will ensure that messages are published back to RabbitMQ before the application 
# closes down and the storage is removed. Default behavior is to keep the messages in original storage 
# (this is only implemented for LMDB storage).
shutdown:               none

# for lmdb based storage, we also have to specify a maxsize for the storage, set this to something big
mapsize:                10GB

# only messages that have a timestamp for this number of seconds in the future are delayed
treshold:               0

# if a message is stored, it will be stored at least / at most this number of seconds, 0 means not set
min-delay:              0
max-delay:              604800

# the amqpdelayer has a small internal webserver with a REST API for monitoring purposes
www-ip:                 0.0.0.0
www-port:               8080
