Sign inSign up

iktech/dlq-handler-service

By iktech

Updated 11 days ago

Image
0

5.6K

iktech/dlq-handler-service repository overview

DLQ Handler Service

This service is designed to handle RabbitMQ Dead Letter Queue messages. The idea behind this service is to attempt to re-process messages sent to the DLQ number of times (default 5, but could be configured using rabbitmq.failureThreshold parameter). Each time DLQ Handler attempts to send the message back to the original exchange, it will delay resending. The time delay is calculated using two parameters (both in seconds):

  • rabbitmq.initialDelay
  • rabbitmq.multiplier

Service uses the following formula:

    delay = initialDelay + (initialDelay * multiplier * (attempt - 1))

The attempt in this case is the index of the current attempt to re-send message back to original exchange.

Configuration Parameters

Service supports two types of configuration:

  • via configuration file
  • via environment variables

Environment variables taking precedence over configuration in case of both are used. The configuration file is hierarchical and can be either in YAML or JSON format. Application searches for the job.yaml or job.json files in two locations:

  • /etc/dlq-handler (Linux only)
  • local directory where executable file resides

The following table describes the configuration parameters, with . delimiting levels of hierarchy. I.e. property name rabbitmq.username will be translated into either "rabbitmq": {"username": "value"} in JSON or the following structure in YAML:

    rabbitmq:
      username: value
Property NameEnvironment VariableDefault ValueDescription
debugDEBUGfalseEnable debug logging
rabbitmq.urlRABBITMQ_URLn/aRabbitMQ URL
rabbitmq.usernameRABBITMQ_USERNAMEn/aRabbitMQ username
rabbitmq.passwordRABBITMQ_PASSWORDn/aRabbitMQ user password
rabbitmq.orphanExchangeORPHAN_EXCHANGEn/aName of the orphan exchage. If omitted DLQ Handler won't try to use it as anlternate exchange for DLX
rabbitmq.dlxDLXdlxDead Letter Exchange Name
rabbitmq.dlxTypeDLX_TYPEdirectType of Dead Letter Exchange
rabbitmq.dlqDLQdlqDead Letter Queue Name
rabbitmq.dlqRoutingKeysDLQ_ROUTING_KEYSn/aA comma separated list of the routing keys to bind the DLQ with
rabbitmq.parkingLotPARKING_LOTparking-lotParking lot queue name
rabbitmq.parkingLotRoutingKeyPARKING_LOT_ROUTING_KEYparkParking lot queue routing key
rabbitmq.initialDelayINITIAL_DELAYn/aInitial delay in second which DLQ Handler will use before attempting to send mssage back to the original exchange
rabbitmq.multiplierMULTIPLIER10 (seconds)A maltiplier to use increasy initial delay by with every subsequent attempt
rabbitmq.failureThresholdFAILURE_THRESHOLD5How many time DLQ Handler will attempt to re-process failed message

Tag summary

Content type

Image

Digest

sha256:2117af10c

Size

3.3 MB

Last updated

11 days ago

docker pull iktech/dlq-handler-service