cat <<EOF | vault policy write vault-rabbitmq-policy -
path "secret/data/myapps/vault-rabbitmq-test/*" {
capabilities = ["read"]
path "rabbitmq/creds/my-role" {
capabilities = [ "read" ]
Now that Vault knows how to create users in RabbitMQ, we need to configure Quarkus to use a credentials-provider for RabbitMQ.
First we tell Quarkus to request dynamic credentials using a credentials-provider named rabbitmq
.
quarkus.rabbitmq.credentials-provider = rabbitmq
Next we configure the rabbitmq
credentials provider. The credentials-role
option must be set to the name of the role we created in Vault, in our case my-role
. The credentials-mount
option must be set to rabbitmq
.
quarkus.vault.credentials-provider.rabbitmq.credentials-role=my-role
quarkus.vault.credentials-provider.rabbitmq.credentials-mount=rabbitmq
credentials-provider-name
(rabbitmq-credentials-provider-name)
The name of the RabbitMQ Credentials Provider bean used to provide dynamic credentials to the RabbitMQ client
Type: string
false
connection-timeout
The TCP connection timeout (ms); 0 is interpreted as no timeout
Type: int
false
60000
handshake-timeout
The AMQP 0-9-1 protocol handshake timeout (ms)
Type: int
false
10000
automatic-recovery-enabled
Whether automatic connection recovery is enabled
Type: boolean
false
false
automatic-recovery-on-initial-connection
Whether automatic recovery on initial connections is enabled
Type: boolean
false
reconnect-attempts
(rabbitmq-reconnect-attempts)
The number of reconnection attempts
Type: int
false
reconnect-interval
(rabbitmq-reconnect-interval)
The interval (in seconds) between two reconnection attempts
Type: int
false
network-recovery-interval
How long (ms) will automatic recovery wait before attempting to reconnect
Type: int
false
The AMQP username to use when connecting to the broker
Type: string
false
guest
include-properties
Whether to include properties when a broker message is passed on the event bus
Type: boolean
false
false
requested-channel-max
The initially requested maximum channel number
Type: int
false
requested-heartbeat
The initially requested heartbeat interval (seconds), zero for none
Type: int
false
use-nio
Whether usage of NIO Sockets is enabled
Type: boolean
false
false
virtual-host
(rabbitmq-virtual-host)
The virtual host to use when connecting to the broker
Type: string
false
exchange.name
The exchange that messages are published to or consumed from. If not set, the channel name is used. If set to ""
, the default exchange is used
Type: string
false
exchange.durable
Whether the exchange is durable
Type: boolean
false
exchange.auto-delete
Whether the exchange should be deleted after use
Type: boolean
false
false
exchange.type
The exchange type: direct, fanout, headers or topic (default)
Type: string
false
topic
exchange.declare
Whether to declare the exchange; set to false if the exchange is expected to be set up independently
Type: boolean
false
tracing.enabled
Whether tracing is enabled (default) or disabled
Type: boolean
false
tracing.attribute-headers
A comma-separated list of headers that should be recorded as span attributes. Relevant only if tracing.enabled=true
Type: string
false
queue.name
The queue from which messages are consumed.
Type: string
queue.durable
Whether the queue is durable
Type: boolean
false
queue.exclusive
Whether the queue is for exclusive use
Type: boolean
false
false
queue.auto-delete
Whether the queue should be deleted after use
Type: boolean
false
false
queue.declare
Whether to declare the queue and binding; set to false if these are expected to be set up independently
Type: boolean
false
queue.ttl
If specified, the time (ms) for which a message can remain in the queue undelivered before it is dead
Type: long
false
queue.single-active-consumer
If set to true, only one consumer can actively consume messages
Type: boolean
false
false
queue.x-queue-type
If automatically declare queue, we can choose different types of queue [quorum, classic, stream]
Type: string
false
classic
queue.x-queue-mode
If automatically declare queue, we can choose different modes of queue [lazy, default]
Type: string
false
default
max-incoming-internal-queue-size
The maximum size of the incoming internal queue
Type: int
false
connection-count
The number of RabbitMQ connections to create for consuming from this queue. This might be necessary to consume from a sharded queue with a single client.
Type: int
false
auto-bind-dlq
Whether to automatically declare the DLQ and bind it to the binder DLX
Type: boolean
false
false
dead-letter-queue-name
The name of the DLQ; if not supplied will default to the queue name with '.dlq' appended
Type: string
false
dead-letter-exchange
A DLX to assign to the queue. Relevant only if auto-bind-dlq is true
Type: string
false
dead-letter-exchange-type
The type of the DLX to assign to the queue. Relevant only if auto-bind-dlq is true
Type: string
false
direct
dead-letter-routing-key
A dead letter routing key to assign to the queue; if not supplied will default to the queue name
Type: string
false
dlx.declare
Whether to declare the dead letter exchange binding. Relevant only if auto-bind-dlq is true; set to false if these are expected to be set up independently
Type: boolean
false
false
dead-letter-queue-type
If automatically declare DLQ, we can choose different types of DLQ [quorum, classic, stream]
Type: string
false
classic
dead-letter-queue-mode
If automatically declare DLQ, we can choose different modes of DLQ [lazy, default]
Type: string
false
default
failure-strategy
The failure strategy to apply when a RabbitMQ message is nacked. Accepted values are fail
, accept
, reject
(default)
Type: string
false
reject
broadcast
Whether the received RabbitMQ messages must be dispatched to multiple subscribers
Type: boolean
false
false
auto-acknowledgement
Whether the received RabbitMQ messages must be acknowledged when received; if true then delivery constitutes acknowledgement
Type: boolean
false
false
keep-most-recent
Whether to discard old messages instead of recent ones
Type: boolean
false
false
routing-keys
A comma-separated list of routing keys to bind the queue to the exchange
Type: string
false
content-type-override
Override the content_type attribute of the incoming message, should be a valid MINE type
Type: string
false
max-outstanding-messages
The maximum number of outstanding/unacknowledged messages being processed by the connector at a time; must be a positive number
Type: int
false
automatic-recovery-on-initial-connection
Whether automatic recovery on initial connections is enabled
Type: boolean
false
connection-timeout
The TCP connection timeout (ms); 0 is interpreted as no timeout
Type: int
false
60000
default-routing-key
The default routing key to use when sending messages to the exchange
Type: string
false
default-ttl
If specified, the time (ms) sent messages can remain in queues undelivered before they are dead
Type: long
false
exchange.auto-delete
Whether the exchange should be deleted after use
Type: boolean
false
false
exchange.declare
Whether to declare the exchange; set to false if the exchange is expected to be set up independently
Type: boolean
false
exchange.durable
Whether the exchange is durable
Type: boolean
false
exchange.name
The exchange that messages are published to or consumed from. If not set, the channel name is used. If set to ""
, the default exchange is used
Type: string
false
exchange.type
The exchange type: direct, fanout, headers or topic (default)
Type: string
false
topic
handshake-timeout
The AMQP 0-9-1 protocol handshake timeout (ms)
Type: int
false
10000
(rabbitmq-host)
The broker hostname
Type: string
false
localhost
include-properties
Whether to include properties when a broker message is passed on the event bus
Type: boolean
false
false
max-inflight-messages
The maximum number of messages to be written to RabbitMQ concurrently; must be a positive number
Type: long
false
max-outgoing-internal-queue-size
The maximum size of the outgoing internal queue
Type: int
false
network-recovery-interval
How long (ms) will automatic recovery wait before attempting to reconnect
Type: int
false
password
(rabbitmq-password)
The password used to authenticate to the broker
Type: string
false
(rabbitmq-port)
The broker port
Type: int
false
reconnect-attempts
(rabbitmq-reconnect-attempts)
The number of reconnection attempts
Type: int
false
reconnect-interval
(rabbitmq-reconnect-interval)
The interval (in seconds) between two reconnection attempts
Type: int
false
requested-channel-max
The initially requested maximum channel number
Type: int
false
requested-heartbeat
The initially requested heartbeat interval (seconds), zero for none
Type: int
false
(rabbitmq-ssl)
Whether the connection should use SSL
Type: boolean
false
false
tracing.attribute-headers
A comma-separated list of headers that should be recorded as span attributes. Relevant only if tracing.enabled=true
Type: string
false
tracing.enabled
Whether tracing is enabled (default) or disabled
Type: boolean
false
trust-all
(rabbitmq-trust-all)
Whether to skip trust certificate verification
Type: boolean
false
false
trust-store-password
(rabbitmq-trust-store-password)
The password of the JKS trust store
Type: string
false
trust-store-path
(rabbitmq-trust-store-path)
The path to a JKS trust store
Type: string
false
credentials-provider-name
(rabbitmq-credentials-provider-name)
The name of the RabbitMQ Credentials Provider bean used to provide dynamic credentials to the RabbitMQ client
Type: string
false
use-nio
Whether usage of NIO Sockets is enabled
Type: boolean
false
false
The AMQP username to use when connecting to the broker
Type: string
false
guest
username
(rabbitmq-username)
The username used to authenticate to the broker
Type: string
false
virtual-host
(rabbitmq-virtual-host)
The virtual host to use when connecting to the broker
Type: string
false