Dev Services for AMQP
Los servicios de desarrollo para AMQP inician automáticamente un broker AMQP 1.0 en modo desarrollo y al ejecutar pruebas. Por lo tanto, no tiene que iniciar un broker manualmente. La aplicación se configura automáticamente.
Activación/desactivación de los servicios de desarrollo para AMQP
Los servicios de desarrollo para AMQP se activan automáticamente a menos que:
-
quarkus.amqp.devservices.enabledse ajusta afalse -
el
amqp-hostoamqp-portestá configurado -
todos los canales AMQP de Mensajería Reactiva tienen establecidos los atributos
hostoport
Los servicios de desarrollo para AMQP se basan en Docker para iniciar el broker. Si su entorno no soporta Docker, tendrá que iniciar el broker manualmente, o conectarse a un broker ya en ejecución. Puede configurar el acceso al broker utilizando las propiedades amqp-host , amqp-port , amqp-user y amqp-password.
Broker compartido
La mayoría de las veces necesitará compartir el broker entre aplicaciones. Los servicios de desarrollo para AMQP implementa un mecanismo de descubrimiento de servicios para que sus múltiples aplicaciones Quarkus ejecutadas en modo dev compartan un único broker.
Dev Services for AMQP starts the container with the quarkus-dev-service-amqp label which is used to identify the container.
|
Si necesita varios corredores (compartidos), puede configurar el atributo quarkus.amqp.devservices.service-name e indicar el nombre del corredor. Éste buscará un contenedor con el mismo valor o iniciará uno nuevo si no encuentra ninguno. El nombre de servicio por defecto es amqp.
El uso compartido está activado por defecto en el modo desarrollo, pero desactivado en el modo de prueba. Puede desactivar el uso compartido con quarkus.amqp.devservices.shared=false.
Ajuste del puerto
Por defecto, Dev Services para AMQP elige un puerto aleatorio y configura la aplicación. Puede establecer el puerto configurando la propiedad quarkus.amqp.devservices.port.
Configuración de la imagen
Los servicios de desarrollo para AMQP utiliza las imágenes activemq-artemis-broker. Puede configurar la imagen y la versión utilizando la propiedad quarkus.amqp.devservices.image-name:
quarkus.amqp.devservices.image-name=quay.io/artemiscloud/activemq-artemis-broker:latest
The configured image must be compatible with the activemq-artemis-broker one.
The container is launched with the AMQ_USER, AMQ_PASSWORD and AMQ_EXTRA_ARGS environment variables.
The ports 5672 and 8161 (web console) are exposed.
|
Referencia de configuración
Configuration property fixed at build time - All other configuration properties are overridable at runtime
Configuration property |
Tipo |
Por defecto |
|---|---|---|
If Dev Services for AMQP has been explicitly enabled or disabled. Dev Services are generally enabled by default, unless there is an existing configuration present. For AMQP, Dev Services starts a broker unless Environment variable: Show more |
boolean |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: Show more |
int |
|
The image to use. Note that only ActiveMQ Artemis images are supported. Specifically, the image repository must end with Check the activemq-artemis-broker on Quay page to find the available versions. Environment variable: Show more |
string |
|
The value of the Environment variable: Show more |
string |
|
Indicates if the AMQP broker managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for AMQP starts a new container. The discovery uses the Container sharing is only used in dev mode. Environment variable: Show more |
boolean |
|
The value of the This property is used when you need multiple shared AMQP brokers. Environment variable: Show more |
string |
|
Environment variables that are passed to the container. Environment variable: Show more |
Map<String,String> |