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.
- 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- properties
| key | type | default value | description |
|---|---|---|---|
| uiowa.ais.rabbitmq.vhost | String | rabbit vhost | |
| uiowa.ais.rabbitmq.username | String | rabbit username | |
| uiowa.ais.rabbitmq.password | String | rabbit password | |
| uiowa.ais.rabbitmq.declarables | List | Created queues,exchange and binding |
For any concern/issue: tools-ais-springboot slack channel