I have a few feature requests to inprove our MicroProfile Reactive
Messaging integration. I've included the ones which now have a pull request
in WildFly Proposals.
Upgrade to MicroProfile Reactive Messaging 2.0
This RFE upgrades fron MicroProfile Reactive Messaging 1.0 to 2.0, which
provides better ways for user-initiated code to interact with the streams
of data nanaged by MicroProfile Reactive Messaging. This is done via a new
@Channel annotation which can be used in place of the current (and still
supported) @Incoming and @Outgoing annotations.
Configuration of Reactive Messaging Kafka messages
With the current offering there is no way to set or read the key of
messages sent to Kafka. As these methods become records stored in Kafka,
this information is key (excuse the pun) to be able to query Kafka later.
In addition, you will be able to choose which topic to send data to (in
some cases you might want to make dynamic choices rather than rely on
static configuration). Additionally, you will be able to write/read headers
(they can be thought of as attachments which mean nothing to Kafka but can
have meaning in your application), as well as read information about which
partition a message was received on and so on.
The MP Reactive Messaging Kafka connector should be able to use an
SSLContext configured in the Elytron subsystem
Currently you can connect to an unsecured Kafka instance, and you can also
connect to one secured via SSL, as long as you are using a WildFly version
that contains https://issues.redhat.com/browse/WFLY-14626. Connecting to a
secure Kafka instance with a certificate properly signed by a CA should
work fine out of the box.
If instead want to use a truststore and non-signed certificates, the
SmallRye Reactive Messaging implementation we use under the hood will
understand a set of MicroProfile Config properties to configure this for
you. However, in this case the Apache Kafka client takes over creation of
the SSLContext used to set up the SSL communication.
We have a standard mechanism in WildFly to set up SSLContexts, which is to
configure them in the Elytron subsystem. This feature allows you to specify
the name of such an SSLContext via a single MicroProfile Config property,
and to use that when your application connects to Kafka.
Please take a look, I'd be happy to hear your feedback!