Dev Services para AMQP
Dev Services for AMQP automatically starts an AMQP 1.0 broker in dev mode and when running tests. So, you don’t have to start a broker manually. The application is configured automatically.
Ativação/desativação do Dev Services para AMQP
O Dev Services para AMQP é ativado automaticamente, a menos que:
-
quarkus.amqp.devservices.enabled
é definido comofalse
-
o
amqp-host
ouamqp-port
esteja configurado -
todos os canais AMQP de mensagens reativas tenham os atributos
host
ouport
definidos
Dev Services for AMQP 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 amqp-host
, amqp-port
, amqp-user
and amqp-password
properties.
Broker compartilhado
Most of the time you need to share the broker between applications. Dev Services for AMQP implements a service discovery mechanism for your multiple Quarkus applications running in dev mode to share a single broker.
Dev Services para AMQP inicia o container com a etiqueta quarkus-dev-service-amqp que é utilizada para identificar o container.
|
If you need multiple (shared) brokers, you can configure the quarkus.amqp.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 amqp
.
Sharing is enabled by default in dev mode, but disabled in test mode.
You can disable the sharing with quarkus.amqp.devservices.shared=false
.
Definir a porta
By default, Dev Services for AMQP picks a random port and configures the application.
You can set the port by configuring the quarkus.amqp.devservices.port
property.
Configurando a imagem
Dev Services for AMQP uses activemq-artemis-broker images.
You can configure the image and version using the quarkus.amqp.devservices.image-name
property:
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.
|