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

Documentación de referencia del conector AMQP 1.0 de mensajería reactiva

This guide is the companion from the Getting Started with AMQP 1.0. It explains in more details the configuration and usage of the AMQP connector for reactive messaging.

This documentation does not cover all the details of the connector. Refer to the SmallRye Reactive Messaging website for further details.

The AMQP connector allows Quarkus applications to send and receive messages using the AMQP 1.0 protocol. More details about the protocol can be found in the AMQP 1.0 specification. It’s important to note that AMQP 1.0 and AMQP 0.9.1 (implemented by RabbitMQ) are incompatible. Check Using RabbitMQ to get more details.

Extensión del conector AMQP

To use the connector, you need to add the quarkus-messaging-amqp extension.

Puede añadir la extensión a su proyecto utilizando:

CLI
quarkus extension add quarkus-messaging-amqp
Maven
./mvnw quarkus:add-extension -Dextensions='quarkus-messaging-amqp'
Gradle
./gradlew addExtension --extensions='quarkus-messaging-amqp'

O simplemente añada la siguiente dependencia a su proyecto:

pom.xml
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-messaging-amqp</artifactId>
</dependency>
build.gradle
implementation("io.quarkus:quarkus-messaging-amqp")

Una vez añadido a tu proyecto, puedes asignar canales a direcciones AMQP configurando el atributo connector:

# Inbound
mp.messaging.incoming.[channel-name].connector=smallrye-amqp

# Outbound
mp.messaging.outgoing.[channel-name].connector=smallrye-amqp
Conexión automática de los conectores

If you have a single connector on your classpath, you can omit the connector attribute configuration. Quarkus automatically associates orphan channels to the (unique) connector found on the classpath. Orphans channels are outgoing channels without a downstream consumer or incoming channels without an upstream producer.

Esta autoadhesión se puede desactivar mediante:

quarkus.messaging.auto-connector-attachment=false

Configuración del acceso al Broker AMQP

The AMQP connector connects to AMQP 1.0 brokers such as Apache ActiveMQ or Artemis. To configure the location and credentials of the broker, add the following properties in the application.properties:

amqp-host=amqp (1)
amqp-port=5672 (2)
amqp-username=my-username (3)
amqp-password=my-password (4)

mp.messaging.incoming.prices.connector=smallrye-amqp (5)
1 Configura el nombre de host del broker/router. Puedes hacerlo por canal (usando el atributo host ) o globalmente usando amqp-host
2 Configura el puerto del broker/router. Puedes hacerlo por canal (usando el atributo port ) o globalmente usando amqp-port. El valor por defecto es 5672.
3 Configura el nombre de usuario del broker/router si es necesario. Puedes hacerlo por canal (usando el atributo username ) o globalmente usando amqp-username.
4 Configura la contraseña del broker/router si es necesario. Puedes hacerlo por canal (usando el atributo password ) o globalmente usando amqp-password.
5 Indica que el canal de precios debe ser gestionado por el conector AMQP

En el modo dev y cuando se ejecutan pruebas, Dev Services for AMQP inicia automáticamente un broker AMQP.

Recepción de mensajes AMQP

Let’s imagine your application receives Message<Double>. You can consume the payload directly:

package inbound;

import org.eclipse.microprofile.reactive.messaging.Incoming;

import jakarta.enterprise.context.ApplicationScoped;

@ApplicationScoped
public class AmqpPriceConsumer {

    @Incoming("prices")
    public void consume(double price) {
        // process your price.
    }

}

O bien, puede recuperar el Message<Double>:

package inbound;

import org.eclipse.microprofile.reactive.messaging.Incoming;
import org.eclipse.microprofile.reactive.messaging.Message;

import jakarta.enterprise.context.ApplicationScoped;
import java.util.concurrent.CompletionStage;

@ApplicationScoped
public class AmqpPriceMessageConsumer {

    @Incoming("prices")
    public CompletionStage<Void> consume(Message<Double> price) {
        // process your price.

        // Acknowledge the incoming message, marking the AMQP message as `accepted`.
        return price.ack();
    }

}

Metadatos de entrada

Los mensajes procedentes de AMQP contienen una instancia de IncomingAmqpMetadata en los metadatos.

Optional<IncomingAmqpMetadata> metadata = incoming.getMetadata(IncomingAmqpMetadata.class);
metadata.ifPresent(meta -> {
    String address = meta.getAddress();
    String subject = meta.getSubject();
    boolean durable = meta.isDurable();
    // Use io.vertx.core.json.JsonObject
    JsonObject properties = meta.getProperties();
    // ...
});

Deserialización

The connector converts incoming AMQP Messages into Reactive Messaging Message<T> instances. T depends on the body of the received AMQP Message.

The AMQP Type System defines the supported types.

Tipo de cuerpo AMQP <T>

AMQP Value containing a AMQP Primitive Type

el tipo Java correspondiente

Valor AMQP utilizando el tipo Binary

byte[]

Secuencia AMQP

List

AMQP Data (con contenido binario) y el content-type está configurado como application/json

JsonObject

Datos AMQP con un content-type

byte[]

If you send objects with this AMQP connector (outbound connector), it gets encoded as JSON and sent as binary. The content-type is set to application/json. So, you can rebuild the object as follows:

import io.vertx.core.json.JsonObject;
//
@ApplicationScoped
public static class Consumer {

    List<Price> prices = new CopyOnWriteArrayList<>();

    @Incoming("from-amqp") (1)
    public void consume(JsonObject p) {   (2)
        Price price = p.mapTo(Price.class);  (3)
        prices.add(price);
    }

    public List<Price> list() {
        return prices;
    }
}
1 Las instancias de Price son codificadas automáticamente en JSON por el conector
2 Puede recibirlo mediante un JsonObject
3 A continuación, puede reconstruir la instancia utilizando el método mapTo
El método mapTo utiliza el mapeador Quarkus Jackson. Consulta esta guía para saber más sobre la configuración del mapeador.

Agradecimiento

When a Reactive Messaging Message associated with an AMQP Message is acknowledged, it informs the broker that the message has been accepted.

Gestión de fallos

If a message produced from an AMQP message is nacked, a failure strategy is applied. The AMQP connector supports six strategies:

  • fail - fail the application; no more AMQP messages will be processed (default). The AMQP message is marked as rejected.

  • accept - this strategy marks the AMQP message as accepted. The processing continues ignoring the failure. Refer to the accepted delivery state documentation.

  • release - this strategy marks the AMQP message as released. The processing continues with the next message. The broker can redeliver the message. Refer to the released delivery state documentation.

  • reject - this strategy marks the AMQP message as rejected. The processing continues with the next message. Refer to the rejected delivery state documentation.

  • modified-failed - this strategy marks the AMQP message as modified and indicates that it failed (with the delivery-failed attribute). The processing continues with the next message, but the broker may attempt to redeliver the message. Refer to the modified delivery state documentation

  • modified-failed-undeliverable-here - this strategy marks the AMQP message as modified and indicates that it failed (with the delivery-failed attribute). It also indicates that the application cannot process the message, meaning that the broker will not attempt to redeliver the message to this node. The processing continues with the next message. Refer to the modified delivery state documentation

Envío de mensajes AMQP

Serialización

When sending a Message<T>, the connector converts the message into an AMQP Message. The payload is converted to the AMQP Message body.

T Cuerpo del mensaje AMQP

tipos primitivos o String

Valor AMQP con la carga útil

Instant o UUID

Valor AMQP utilizando el tipo AMQP correspondiente

JsonObject o JsonArray

Datos AMQP utilizando un contenido binario. El content-type está configurado como application/json

io.vertx.mutiny.core.buffer.Buffer

Datos AMQP utilizando un contenido binario. No se ha establecido content-type

Cualquier otra clase

La carga útil se convierte en JSON (utilizando un mapeador Json). El resultado se envuelve en AMQP Data usando un contenido binario. El content-type se establece en application/json

Si la carga útil del mensaje no puede ser serializada a JSON, el mensaje es nacked.

Metadatos de salida

When sending Messages, you can add an instance of OutgoingAmqpMetadata to influence how the message is going to be sent to AMQP. For example, you can configure the subjects, properties:

 OutgoingAmqpMetadata metadata = OutgoingAmqpMetadata.builder()
    .withDurable(true)
    .withSubject("my-subject")
    .build();

// Create a new message from the `incoming` message
// Add `metadata` to the metadata from the `incoming` message.
return incoming.addMetadata(metadata);

Nombres de direcciones dinámicas

Sometimes it is desirable to select the destination of a message dynamically. In this case, you should not configure the address inside your application configuration file, but instead, use the outbound metadata to set the address.

Por ejemplo, puede enviar a una dirección dinámica en función del mensaje entrante:

String addressName = selectAddressFromIncommingMessage(incoming);
OutgoingAmqpMetadata metadata = OutgoingAmqpMetadata.builder()
    .withAddress(addressName)
    .withDurable(true)
    .build();

// Create a new message from the `incoming` message
// Add `metadata` to the metadata from the `incoming` message.
return incoming.addMetadata(metadata);
Para poder establecer la dirección por mensaje, el conector utiliza un remitente anónimo.

Agradecimiento

By default, the Reactive Messaging Message is acknowledged when the broker acknowledged the message. When using routers, this acknowledgement may not be enabled. In this case, configure the auto-acknowledgement attribute to acknowledge the message as soon as it has been sent to the router.

Si un mensaje AMQP es rechazado/liberado/modificado por el broker (o no puede ser enviado con éxito), el mensaje es nacked.

Presión trasera y créditos

The back-pressure is handled by AMQP credits. The outbound connector only requests the amount of allowed credits. When the amount of credits reaches 0, it waits (in a non-blocking fashion) until the broker grants more credits to the AMQP sender.

Configuración de la dirección AMQP

Puedes configurar la dirección AMQP utilizando el atributo address:

mp.messaging.incoming.prices.connector=smallrye-amqp
mp.messaging.incoming.prices.address=my-queue

mp.messaging.outgoing.orders.connector=smallrye-amqp
mp.messaging.outgoing.orders.address=my-order-queue

Si el atributo address no está establecido, el conector utiliza el nombre del canal.

To use an existing queue, you need to configure the address, container-id and, optionally, the link-name attributes. For example, if you have an Apache Artemis broker configured with:

<queues>
    <queue name="people">
        <address>people</address>
        <durable>true</durable>
        <user>artemis</user>
    </queue>
</queues>

Necesita la siguiente configuración:

mp.messaging.outgoing.people.connector=smallrye-amqp
mp.messaging.outgoing.people.durable=true
mp.messaging.outgoing.people.address=people
mp.messaging.outgoing.people.container-id=people

Es posible que tenga que configurar el atributo link-name, si el nombre de la cola no es el nombre del canal:

mp.messaging.outgoing.people-out.connector=smallrye-amqp
mp.messaging.outgoing.people-out.durable=true
mp.messaging.outgoing.people-out.address=people
mp.messaging.outgoing.people-out.container-id=people
mp.messaging.outgoing.people-out.link-name=people

Para utilizar una cola de MULTICAST, es necesario proporcionar el FQQN (nombre de cola totalmente calificado) en lugar de sólo el nombre de la cola:

mp.messaging.outgoing.people-out.connector=smallrye-amqp
mp.messaging.outgoing.people-out.durable=true
mp.messaging.outgoing.people-out.address=foo
mp.messaging.outgoing.people-out.container-id=foo

mp.messaging.incoming.people-out.connector=smallrye-amqp
mp.messaging.incoming.people-out.durable=true
mp.messaging.incoming.people-out.address=foo::bar # Note the syntax: address-name::queue-name
mp.messaging.incoming.people-out.container-id=bar
mp.messaging.incoming.people-out.link-name=people

Puede encontrar más detalles sobre el modelo de direcciones AMQP en la documentación de Artemis.

Modelo de ejecución y procesamiento por bloqueo

Reactive Messaging invokes your method on an I/O thread. See the Quarkus Reactive Architecture documentation for further details on this topic. But, you often need to combine Reactive Messaging with blocking processing such as database interactions. For this, you need to use the @Blocking annotation indicating that the processing is blocking and should not be run on the caller thread.

Por ejemplo, el siguiente código ilustra cómo puede almacenar las cargas útiles entrantes en una base de datos utilizando Hibernate con Panache:

import io.smallrye.reactive.messaging.annotations.Blocking;
import org.eclipse.microprofile.reactive.messaging.Incoming;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.transaction.Transactional;

@ApplicationScoped
public class PriceStorage {

    @Incoming("prices")
    @Transactional
    public void store(int priceInUsd) {
        Price price = new Price();
        price.value = priceInUsd;
        price.persist();
    }

}

Hay 2 anotaciones en @Blocking:

  1. io.smallrye.reactive.messaging.annotations.Blocking

  2. io.smallrye.common.annotation.Blocking

They have the same effect. Thus, you can use both. The first one provides more fine-grained tuning such as the worker pool to use and whether it preserves the order. The second one, used also with other reactive features of Quarkus, uses the default worker pool and preserves the order.

@RunOnVirtualThread

For running the blocking processing on Java virtual threads, see the Quarkus Virtual Thread support with Reactive Messaging documentation.

@Transactional

Si su método está anotado con @Transactional, se considerará automáticamente bloqueante, incluso si el método no está anotado con @Blocking.

Personalización del cliente AMQP subyacente

The connector uses the Vert.x AMQP client underneath. More details about this client can be found in the Vert.x website.

Puede personalizar la configuración del cliente subyacente produciendo una instancia de AmqpClientOptions de la siguiente manera:

@Produces
@Identifier("my-named-options")
public AmqpClientOptions getNamedOptions() {
  // You can use the produced options to configure the TLS connection
  PemKeyCertOptions keycert = new PemKeyCertOptions()
    .addCertPath("./tls/tls.crt")
    .addKeyPath("./tls/tls.key");
  PemTrustOptions trust = new PemTrustOptions().addCertPath("./tlc/ca.crt");
  return new AmqpClientOptions()
        .setSsl(true)
        .setPemKeyCertOptions(keycert)
        .setPemTrustOptions(trust)
        .addEnabledSaslMechanism("EXTERNAL")
        .setHostnameVerificationAlgorithm("") // Disables the hostname verification. Defaults is "HTTPS"
        .setConnectTimeout(30000)
        .setReconnectInterval(5000)
        .setContainerId("my-container");
}

This instance is retrieved and used to configure the client used by the connector. You need to indicate the name of the client using the client-options-name attribute:

mp.messaging.incoming.prices.client-options-name=my-named-options

Informes de salud

If you use the AMQP connector with the quarkus-smallrye-health extension, it contributes to the readiness and liveness probes. The AMQP connector reports the readiness and liveness of each channel managed by the connector. At the moment, the AMQP connector uses the same logic for the readiness and liveness checks.

To disable health reporting, set the health-enabled attribute for the channel to false. On the inbound side (receiving messages from AMQP), the check verifies that the receiver is attached to the broker. On the outbound side (sending records to AMQP), the check verifies that the sender is attached to the broker.

Note that a message processing failures nacks the message, which is then handled by the failure-strategy. It is the responsibility of the failure-strategy to report the failure and influence the outcome of the checks. The fail failure strategy reports the failure, and so the check will report the fault.

Uso de RabbitMQ

This connector is for AMQP 1.0. RabbitMQ implements AMQP 0.9.1. RabbitMQ does not provide AMQP 1.0 by default, but there is a plugin for it. To use RabbitMQ with this connector, enable and configure the AMQP 1.0 plugin.

Despite the existence of the plugin, a few AMQP 1.0 features won’t work with RabbitMQ. Thus, we recommend the following configurations.

Para recibir mensajes de RabbitMQ:

  • Establecer la durabilidad en falso

mp.messaging.incoming.prices.connector=smallrye-amqp
mp.messaging.incoming.prices.durable=false

Para enviar mensajes a RabbitMQ:

  • establecer la dirección de destino (no se admiten remitentes anónimos)

  • establecer use-anonymous-sender en falso

mp.messaging.outgoing.generated-price.connector=smallrye-amqp
mp.messaging.outgoing.generated-price.address=prices
mp.messaging.outgoing.generated-price.use-anonymous-sender=false

Como consecuencia, no es posible cambiar el destino dinámicamente (utilizando los metadatos del mensaje) cuando se utiliza RabbitMQ.

Recepción de eventos en la nube

The AMQP connector supports Cloud Events. When the connector detects a structured or binary Cloud Events, it adds a IncomingCloudEventMetadata<T> into the metadata of the Message. IncomingCloudEventMetadata contains accessors to the mandatory and optional Cloud Event attributes.

Si el conector no puede extraer los metadatos del evento en la nube, envía el mensaje sin los metadatos.

Para obtener más información sobre la recepción de eventos de la nube, consulte Recepción de eventos de la nube en la documentación de SmallRye Reactive Messaging.

Envío de eventos en la nube

The AMQP connector supports Cloud Events. The connector sends the outbound record as Cloud Events if:

  • los metadatos del mensaje contienen una instancia de io.smallrye.reactive.messaging.ce.OutgoingCloudEventMetadata,

  • la configuración del canal define los atributos cloud-events-type y cloud-events-source.

Para obtener más información sobre el envío de eventos de nube, consulte Envío de eventos de nube en la documentación de SmallRye Reactive Messaging.

Referencia de la configuración del conector AMQP

Configuración específica de Quarkus

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 amqp-host or amqp-port are set or if all the Reactive Messaging AMQP channel are configured with host or port.

Environment variable: QUARKUS_AMQP_DEVSERVICES_ENABLED

Show more

boolean

Optional fixed port the dev service will listen to.

If not defined, the port will be chosen randomly.

Environment variable: QUARKUS_AMQP_DEVSERVICES_PORT

Show more

int

The image to use. Note that only ActiveMQ Artemis images are supported. Specifically, the image repository must end with artemiscloud/activemq-artemis-broker.

Check the activemq-artemis-broker on Quay page to find the available versions.

Environment variable: QUARKUS_AMQP_DEVSERVICES_IMAGE_NAME

Show more

string

quay.io/artemiscloud/activemq-artemis-broker:1.0.25

The value of the AMQ_EXTRA_ARGS environment variable to pass to the container. For ActiveMQ Artemis Broker ⇐ 1.0.21, set this property to --no-autotune --mapped --no-fsync --relax-jolokia --http-host 0.0.0.0

Environment variable: QUARKUS_AMQP_DEVSERVICES_EXTRA_ARGS

Show more

string

--no-autotune --mapped --no-fsync --relax-jolokia

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 quarkus-dev-service-amqp label. The value is configured using the service-name property.

Container sharing is only used in dev mode.

Environment variable: QUARKUS_AMQP_DEVSERVICES_SHARED

Show more

boolean

true

The value of the quarkus-dev-service-aqmp label attached to the started container. This property is used when shared is set to true. In this case, before starting a container, Dev Services for AMQP looks for a container with the quarkus-dev-service-amqp label set to the configured value. If found, it will use this container instead of starting a new one. Otherwise, it starts a new container with the quarkus-dev-service-amqp label set to the specified value.

This property is used when you need multiple shared AMQP brokers.

Environment variable: QUARKUS_AMQP_DEVSERVICES_SERVICE_NAME

Show more

string

amqp

Environment variables that are passed to the container.

Environment variable: QUARKUS_AMQP_DEVSERVICES_CONTAINER_ENV

Show more

Map<String,String>

Configuración del canal de entrada

Atributo (alias) Descripción Obligatorio Por defecto

address

La dirección AMQP. Si no se establece, se utiliza el nombre del canal

Type: string

falso

auto-acknowledgement

Si los mensajes AMQP recibidos deben ser acusados de recibo

Type: boolean

falso

false

broadcast

Si los mensajes AMQP recibidos deben ser enviados a múltiples suscriptores

Type: boolean

falso

false

capabilities

A comma-separated list of capabilities proposed by the sender or receiver client.

Type: string

falso

client-options-name

(amqp-client-options-name)

El nombre del grano de opción del cliente AMQP utilizado para personalizar la configuración del cliente AMQP

Type: string

falso

cloud-events

Activa (por defecto) o desactiva el soporte de Cloud Event. Si se habilita en un canal de entrada, el conector analiza los registros entrantes e intenta crear metadatos de Cloud Event. Si se habilita en un canal saliente, el conector envía los mensajes salientes como Cloud Event si el mensaje incluye metadatos Cloud Event.

Type: boolean

falso

true

connect-timeout

(amqp-connect-timeout)

El tiempo de espera de la conexión en milisegundos

Type: int

falso

1000

container-id

El id del contenedor AMQP

Type: string

falso

durable

Si la suscripción AMQP es duradera

Type: boolean

falso

false

failure-strategy

Especifica la estrategia de fallo a aplicar cuando un mensaje producido a partir de un mensaje AMQP es nacked. Los valores aceptados son fail (por defecto), accept, release, reject, modified-failed, modified-failed-undeliverable-here

Type: string

falso

fail

health-timeout

El número máximo de segundos que hay que esperar para determinar si la conexión con el corredor sigue establecida para la comprobación de disponibilidad. Después de ese umbral, la comprobación se considera fallida.

Type: int

falso

3

host

(amqp-host)

El nombre de host del broker

Type: string

falso

localhost

link-name

El nombre del enlace. Si no se establece, se utiliza el nombre del canal.

Type: string

falso

password

(amqp-password)

La contraseña utilizada para autenticarse en el broker

Type: string

falso

port

(amqp-port)

El puerto del corredor

Type: int

falso

5672

reconnect-attempts

(amqp-reconnect-attempts)

El número de intentos de reconexión

Type: int

falso

100

reconnect-interval

(amqp-reconnect-interval)

El intervalo en segundos entre dos intentos de reconexión

Type: int

falso

10

sni-server-name

(amqp-sni-server-name)

Si se establece, anula explícitamente el nombre de host que se utilizará para el nombre del servidor TLS SNI

Type: string

falso

selector

Sets a message selector. This attribute is used to define an apache.org:selector-filter:string filter on the source terminus, using SQL-based syntax to request the server filters which messages are delivered to the receiver (if supported by the server in question). Precise functionality supported and syntax needed can vary depending on the server.

Type: string

falso

tracing-enabled

Si el rastreo está activado (por defecto) o desactivado

Type: boolean

falso

true

use-ssl

(amqp-use-ssl)

Si la conexión AMQP utiliza SSL/TLS

Type: boolean

falso

false

username

(amqp-username)

El nombre de usuario utilizado para autenticarse en el broker

Type: string

falso

virtual-host

(amqp-virtual-host)

Si se establece, configure el valor del nombre de host utilizado para la trama abierta AMQP de la conexión y el nombre del servidor SNI TLS (si se utiliza TLS)

Type: string

falso

Configuración del canal de salida

Atributo (alias) Descripción Obligatorio Por defecto

address

La dirección AMQP. Si no se establece, se utiliza el nombre del canal

Type: string

falso

capabilities

A comma-separated list of capabilities proposed by the sender or receiver client.

Type: string

falso

client-options-name

(amqp-client-options-name)

El nombre del grano de opción del cliente AMQP utilizado para personalizar la configuración del cliente AMQP

Type: string

falso

cloud-events

Activa (por defecto) o desactiva el soporte de Cloud Event. Si se habilita en un canal de entrada, el conector analiza los registros entrantes e intenta crear metadatos de Cloud Event. Si se habilita en un canal saliente, el conector envía los mensajes salientes como Cloud Event si el mensaje incluye metadatos Cloud Event.

Type: boolean

falso

true

cloud-events-data-content-type

(cloud-events-default-data-content-type)

Configura el atributo datacontenttype por defecto del Evento de Nube saliente. Requiere que cloud-events esté configurado como true. Este valor se utiliza si el mensaje no configura el atributo datacontenttype por sí mismo

Type: string

falso

cloud-events-data-schema

(cloud-events-default-data-schema)

Configura el atributo dataschema por defecto del Evento de Nube saliente. Requiere que cloud-events esté configurado como true. Este valor se utiliza si el mensaje no configura el atributo dataschema por sí mismo

Type: string

falso

cloud-events-insert-timestamp

(cloud-events-default-timestamp)

Whether the connector should insert automatically the time attribute into the outgoing Cloud Event. Requires cloud-events to be set to true. This value is used if the message does not configure the time attribute itself

Type: boolean

falso

true

cloud-events-mode

El modo de eventos en la nube ( structured o binary (por defecto)). Indica cómo se escriben los eventos de la nube en el registro de salida

Type: string

falso

binary

cloud-events-source

(cloud-events-default-source)

Configura el atributo source por defecto del Evento de Nube saliente. Requiere que cloud-events esté configurado como true. Este valor se utiliza si el mensaje no configura el atributo source por sí mismo

Type: string

falso

cloud-events-subject

(cloud-events-default-subject)

Configura el atributo subject por defecto del Evento de Nube saliente. Requiere que cloud-events esté configurado como true. Este valor se utiliza si el mensaje no configura el atributo subject por sí mismo

Type: string

falso

cloud-events-type

(cloud-events-default-type)

Configura el atributo type por defecto del Evento de Nube saliente. Requiere que cloud-events esté configurado como true. Este valor se utiliza si el mensaje no configura el atributo type por sí mismo

Type: string

falso

connect-timeout

(amqp-connect-timeout)

El tiempo de espera de la conexión en milisegundos

Type: int

falso

1000

container-id

El id del contenedor AMQP

Type: string

falso

credit-retrieval-period

El período (en milisegundos) entre dos intentos de recuperar los créditos concedidos por el corredor. Este tiempo se utiliza cuando el emisor se queda sin créditos.

Type: int

falso

2000

durable

Si los mensajes AMQP enviados se marcan como duraderos

Type: boolean

falso

false

health-timeout

El número máximo de segundos que hay que esperar para determinar si la conexión con el corredor sigue establecida para la comprobación de disponibilidad. Después de ese umbral, la comprobación se considera fallida.

Type: int

falso

3

host

(amqp-host)

El nombre de host del broker

Type: string

falso

localhost

link-name

El nombre del enlace. Si no se establece, se utiliza el nombre del canal.

Type: string

falso

merge

Si el conector debe permitir múltiples flujos ascendentes

Type: boolean

falso

false

password

(amqp-password)

La contraseña utilizada para autenticarse en el broker

Type: string

falso

port

(amqp-port)

El puerto del corredor

Type: int

falso

5672

reconnect-attempts

(amqp-reconnect-attempts)

El número de intentos de reconexión

Type: int

falso

100

reconnect-interval

(amqp-reconnect-interval)

El intervalo en segundos entre dos intentos de reconexión

Type: int

falso

10

sni-server-name

(amqp-sni-server-name)

Si se establece, anula explícitamente el nombre de host que se utilizará para el nombre del servidor TLS SNI

Type: string

falso

tracing-enabled

Si el rastreo está activado (por defecto) o desactivado

Type: boolean

falso

true

ttl

The time-to-live of the sent AMQP messages. 0 to disable the TTL

Type: long

falso

0

use-anonymous-sender

Whether the connector should use an anonymous sender. Default value is true if the broker supports it, false otherwise. If not supported, it is not possible to dynamically change the destination address.

Type: boolean

falso

use-ssl

(amqp-use-ssl)

Si la conexión AMQP utiliza SSL/TLS

Type: boolean

falso

false

username

(amqp-username)

El nombre de usuario utilizado para autenticarse en el broker

Type: string

falso

virtual-host

(amqp-virtual-host)

Si se establece, configure el valor del nombre de host utilizado para la trama abierta AMQP de la conexión y el nombre del servidor SNI TLS (si se utiliza TLS)

Type: string

falso

Conditionally configure channels

You can configure the channels using a specific profile. Thus, the channels are only configured (and added to the application) when the specified profile is enabled.

To achieve this, you need:

  1. Prefix the mp.messaging.[incoming|outgoing].$channel entries with %my-profile such as %my-profile.mp.messaging.[incoming|outgoing].$channel.key=value

  2. Use the @IfBuildProfile("my-profile") on the CDI beans containing @Incoming(channel) and @Outgoing(channel) annotations that need only to be enabled when the profile is enabled.

Note that reactive messaging verifies that the graph is complete. So, when using such a conditional configuration, ensure the application works with and without the profile enabled.

Note that this approach can also be used to change the channel configuration based on a profile.