Add support for AMQP Connector in MicroProfile Reactive Messaging

In  microprofile

Overview

The scope of this RFE is to enhance the MicroProfile Reactive Messaging integration to include the AMQP connector in order to be able to send and receive data from AMQP message brokers.

This is similar to the work already done to integrate with Kafka, and to be able to connect to an SSL secured AMQP broker we will leverage the same concepts to be able to use an SSLContext provided by the Elytron subsystem (see WFLY-14987).

Issue Metadata

Issue

Dev Contacts

QE Contacts

Testing By

  • Engineering

  • QE

Affected Projects or Components

The changes will be made in the MicroProfile Reactive Messaging subsystem modules in the WildFLy codebase. SmallRye Reactive Messaging provides an AMQP Connector which will be included, and in turn relies on clients from Vert.x.

The AMQPConnector uses the Vert.x clients, which in turn are based on Netty. This is designed on the concept of configuring an SSLContext by specifying paramters for protocols, truststore parameters etc. On inspection, there was no way to pass in a pre-defined SSLContext to this stack. After discussion with the relevant team leads, PRs have been opened to the following projects to allow for this:

Other Interested Projects

Relevant Installation Types

  • Traditional standalone server (unzipped or provisioned by Galleon)

  • Managed domain

  • OpenShift s2i

  • Bootable jar

Requirements

Hard Requirements

  • A separate Galleon layer will be provided for the AMQP connector. It is called microprofile-reactive-messaging-amqp and depends on the microprofile-reactive-messaging providing the core Reactive Messaging functionality.

  • It must be possible to send and receive messages from an AMQP message broker by using the standard MicroProfile Reactive Messaging constructs (@Incoming/@Outgoing annotated methods, as well as @Channel annotated Emitter and Publisher)

  • Version 1.0 of the AMQP protocol will be supported

  • MicroProfile Config using the properties documented by the SmallRye Reactive Messaging AMQP Connector (note the docs are spread over a few pages) are used to map the MicroProfile Reactive Messaging channels to an AMQP broker

  • If an SSLContext is needed (for example to configure truststores to connect to a secured broker which does not have a signed certificate), that is configured in a MicroProfile Config property referencing an SSLContext set up in the Elytron subsystem.

    • The format of the property is <prefix>.wildfly.elytron.ssl.context=<Elytron SSLContext name>. For example, to have an @Outgoing annotated method sending to the source channel secured via the amqp-ssl-test SSLContext from Elytron the property entry would look like mp.messaging.outgoing.source.wildfly.elytron.ssl.context=amqp-ssl-test.

Nice-to-Have Requirements

Non-Requirements

  • Other AMQP protocol versions than 1.0 will not be supported at this time

  • SmallRye Reactive Messaging’s AMQP Connector has a CDI mechanism to do additional configuration of secured connections. This will not be supported. After discussions with the SmallRye team, it seems this mechanism was added in order to have something in this area, but the main polished work has been for their Kafka connector.

    • Although we won’t support this, no steps will be taken to stop people from using this mechanism apart from the fact that the classes needed to implement this mechanism are in private modules. Also, we will not, at present, expose the involved jars in our BOMs

      • Whether this mechanism works or not is unknown, untested. We should document this.

    • Rather than using this mechanism we should encourage users to use an SSLContext from the Elytron subsystem

Backwards Compatibility

No backwards compatibility issues. This is an addition to the existing functionality, and does not replace or modify what is already there in any way. The feature as a whole, assuming that the MicroProfile Reactive Messaging subsystem is enabled, is driven by the presence of the modules provided by the microprofile-reactive-messaging-amqp Galleon layer.

Security Considerations

Configuration of connections to a secure AMQP broker is done via an SSLContext set up in the Elytron subsystem.

Test Plan

Tests will be added to the microprofile module in the WildFly testsuite. It will check that messages can be sent to and from an AMQP broker (provided by an embedded Artemis instance).

The tests will also check that both secured and unsecured AMQP brokers can be used.

For the secure case we will reuse the keys generated in WFLY-14987, which also contains instructions on how to set up an SSLContext in the Elytron subsystem.

Community Documentation

The WildFly documentation will be updated to cover this use case.

Release Note Content

The MicroProfile Reactive subsystem now allows exchanging of messages with an AMQP broker via version 1.0 of the AMQP protocol.