Skip to content

autoconfigure-rabbitmq

This module uses commons-rabbitmq under the hood.

How to use in client project ?

repositories {
	maven {
		url 'https://gitlab.com/api/v4/projects/39953646/packages/maven'
	}
	mavenCentral()
}

dependencies {
	// import BOM
	implementation(platform("uiowa.ais.springboot:autoconfigure:0.6.8"))
	implementation ("uiowa.ais.springboot:autoconfigure-rabbitmq")
}

This library transitively pulls spring-boot-starter-amqp, so you should be able to use any method provided by spring-boot-starter-amqp.

  1. Configure Queue, Exchange and Binding.

Below is the sample configuration for RabbitMQ that creates and configures 2 queues, 2 exchanges and 2 bindings.

declarables is optional attribute. If not provided then you will have to create queue,exhange and binding manually.

yaml

uiowa:
  ais:
    rabbitmq:
      username: 'required'
      password: 'required'
      vhost: 'required'
      declarables:
        - queue-name: prospect-import
          durable: true
          auto-delete: false
          routing-key: prospect-import-rk-01
          exchange-name: prospector.direct
          exchange-type: topic
          queue-arguments:
            'x-dead-letter-exchange' : 'prospector-dlq-exchange'
            'x-dead-letter-routing-key' : 'prosepct-api-rk-dlq-01'
        - queue-name: prospect-api
          durable: true
          auto-delete: false
          routing-key: prospect-api-rk
          exchange-name: prospector.direct
          exchange-type: topic
  1. properties
keytypedefault valuedescription
uiowa.ais.rabbitmq.vhostStringrabbit vhost
uiowa.ais.rabbitmq.usernameStringrabbit username
uiowa.ais.rabbitmq.passwordStringrabbit password
uiowa.ais.rabbitmq.declarablesListCreated queues,exchange and binding

For any concern/issue: tools-ais-springboot slack channel