The English version of quarkus.io is the official project site. Translated sites are community supported on a best-effort basis.

Servicios de desarrollo para RabbitMQ

Dev Services for RabbitMQ automatically starts a RabbitMQ broker in dev mode and when running tests. So, you don’t have to start a broker manually. The application is configured automatically.

Activación/desactivación de los servicios de desarrollo para RabbitMQ

Los servicios de desarrollo para RabbitMQ se activan automáticamente a menos que:

  • quarkus.rabbitmq.devservices.enabled se ajusta a false

  • el rabbitmq-host o rabbitmq-port está configurado

  • todos los canales de Reactive Messaging RabbitMQ tienen los atributos host o port establecidos

Dev Services for RabbitMQ relies on Docker to start the broker. If your environment does not support Docker, you will need to start the broker manually, or connect to an already running broker. You can configure the broker access using the rabbitmq-host, rabbitmq-port, rabbitmq-username and rabbitmq-password properties.

Broker compartido

Most of the time you need to share the broker between applications. Dev Services for RabbitMQ implements a service discovery mechanism for your multiple Quarkus applications running in dev mode to share a single broker.

Dev Services for RabbitMQ inicia el contenedor con la etiqueta quarkus-dev-service-rabbitmq que se utiliza para identificar el contenedor.

If you need multiple (shared) brokers, you can configure the quarkus.rabbitmq.devservices.service-name attribute and indicate the broker name. It looks for a container with the same value, or starts a new one if none can be found. The default service name is rabbitmq.

Sharing is enabled by default in dev mode, but disabled in test mode. You can disable the sharing with quarkus.rabbitmq.devservices.shared=false.

Ajuste del puerto

By default, Dev Services for RabbitMQ picks a random port and configures the application. You can set the port by configuring the quarkus.rabbitmq.devservices.port property.

Configuración de la imagen

Dev Services for RabbitMQ uses official images available at https://hub.docker.com/_/rabbitmq. You can configure the image and version using the quarkus.rabbitmq.devservices.image-name property:

quarkus.rabbitmq.devservices.image-name=rabbitmq:latest

Access the management UI

By default, Dev Services for RabbitMQ use the official image with the management tag. This means you have the management plugin available. You can use the Dev UI to find the HTTP port randomly affected or configure a static one via quarkus.rabbitmq.devservices.http-port.

Topología predefinida

Dev Services for RabbitMQ supports defining topology upon broker start. You can define Exchanges, Queues, and Bindings using standard Quarkus configuration.

Definición de los intercambios

To define a RabbitMQ exchange you provide the exchange’s name after the quarkus.rabbitmq.devservices.exchanges key, followed by one (or more) of the exchange’s properties:

quarkus.rabbitmq.devservices.exchanges.my-exchange.type=topic            # defaults to 'direct'
quarkus.rabbitmq.devservices.exchanges.my-exchange.auto-delete=false     # defaults to 'false'
quarkus.rabbitmq.devservices.exchanges.my-exchange.durable=true          # defaults to 'false'

Además, se puede proporcionar cualquier argumento adicional a la definición del intercambio utilizando la clave arguments:

quarkus.rabbitmq.devservices.exchanges.my-exchange.arguments.alternate-exchange=another-exchange

Definición de colas

To define a RabbitMQ queue you provide the queue’s name after the quarkus.rabbitmq.devservices.queues key, followed by one (or more) of the queue’s properties:

quarkus.rabbitmq.devservices.queues.my-queue.auto-delete=false          # defaults to 'false'
quarkus.rabbitmq.devservices.queues.my-queue.durable=true               # defaults to 'false'

Además, se puede proporcionar cualquier argumento adicional a la definición de la cola utilizando la tecla arguments:

quarkus.rabbitmq.devservices.queues.my-queue.arguments.x-dead-letter-exchange=another-exchange

Definición de enlaces

To define a RabbitMQ binding you provide the binding’s name after the quarkus.rabbitmq.devservices.bindings key, followed by one (or more) of the binding’s properties:

quarkus.rabbitmq.devservices.bindings.a-binding.source=my-exchange      # defaults to name of binding
quarkus.rabbitmq.devservices.bindings.a-binding.routing-key=some-key    # defaults to '#'
quarkus.rabbitmq.devservices.bindings.a-binding.destination=my-queue    # defaults to name of binding
quarkus.rabbitmq.devservices.bindings.a-binding.destination-type=queue  # defaults to 'queue'
The name of the binding is only used for the purposes of the Dev Services configuration and is not part of the binding defined in RabbitMQ.

Además, se puede proporcionar cualquier argumento adicional a la definición del enlace utilizando la tecla arguments:

quarkus.rabbitmq.devservices.bindings.a-binding.arguments.non-std-option=value