Micronaut 3.0.2 with io.micronaut.rabbitmq:micronaut-rabbitmq
dependency.
I would like to use multiple connections and then use the proposed ChannelPoolListener
based on io.micronaut.rabbitmq.connect.ChannelInitializer
to create queues/exchanges using a specific connection named configbus
.
micronaut:
application:
name: micronautRabbitmq
rabbitmq:
servers:
configbus:
uri: amqp://localhost:5672
username: micronautRabbitmq
password: micronautRabbitmq
eventbus:
uri: amqp://localhost:5671
username: micronautRabbitmq
password: micronautRabbitmq
How do I do this?
As of
micronaut-rabbitmq:3.1.0
the ChannelInitializer gets the name of the connection. So, whenever the initialize method is called for the desired connection, you can use the channel to create queues, exchanges, bindings, etc.https://micronaut-projects.github.io/micronaut-rabbitmq/latest/guide/#initialization