Skip to content

thibaultmeyer/play-rabbitmq-module

Repository files navigation

Play RabbitMQ Module

Latest release JitPack Build GitHub license

RabbitMQ simple module for Play Framework 2


Add play-rabbitmq-module to your project

build.sbt

resolvers += "jitpack" at "https://jitpack.io"

libraryDependencies += "com.github.thibaultmeyer" % "play-rabbitmq-module" % "release~YY.MM"

application.conf

# Play Modules
# ~~~~~
play.modules.enabled += "com.zero_x_baadf00d.play.module.rabbitmq.RabbitMQBinder"


# Play Redis Module
# ~~~~~
rabbitmq {
  conn {
    uri = "amqp://<LOGIN>:<PASSWORD>@<HOST>/<VHOST>"
    heartbeart = 60
    networkRecoveryInterval = 5000
    connectionTimeOut = 30000
    executorService = 50
    automaticRecovery = false
    bypassInitError = false
  }

  channels {
    # Dynamic channel name
    my-queue-name {
      # durable - RabbitMQ will never lose the queue if a crash occurs
      durable = true
      # exclusive - if queue only will be used by one connection
      exclusive = false
      # autoDelete - queue is deleted when last consumer unsubscribes
      autoDelete = false
    }
  }
}

License

This project is released under terms of the MIT license.