-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation of MicroProfile Reactive Messaging and Stream Operators 3.0 #6928
Comments
Hi @abutch3r - please use the following template when you populate this issue. Thanks! Feature epic details
Operating systemsDoes the documentation apply to all operating systems?
SummaryProvide a concise summary of your feature. What is the update, why does it matter, and to whom? What do 80% of target users need to know to be most easily productive using your runtime update? ConfigurationList any new or changed properties, parameters, elements, attributes, etc. Include default values and configuration examples where relevant: Updates to existing topicsTo update existing topics, specify a link to the topics that are affected. Include a copy of the current text and the exact text to which it will change. For example: Change ABC to XYZ Create a new topicTo create a topic, specify a first draft of the topic that you want added and the section in the navigation where the topic should go. |
@dmuelle would you be able to have an initial review of the above material I have put together, it does need some refining in the new year. but having an idea of particular focus areas would be helpful. Is there anything you consider is also missing given the current state of documentation relating to the 1.0 version of this feature, which is very basic. and would currently be considered more in the blogs. The closest blog we have is https://openliberty.io/blog/2019/09/13/microprofile-reactive-messaging.html which does a mixture of overall RM pieces and the liberty-kafka connector We don't focus on RSO, so I don't think anything in particular is needed there. |
Hi Alex- thanks for putting this together- a few points to consider
Ram and I are both out after Friday 12/22 but maybe we can have a quick call when we're all back to sort out what's needed |
@ramkumar-k-9286 more resources and links for reactive n this old issue- #2806 (comment) |
thanks @dmuelle In response to your questions
A call in the New Year would be really helpful |
I missed that we wanted to include an link to the new kafka connector topic in the feature description- in that case I think it's better to add it from the docs side so docs team can maintain the link without needing access to metatype files. So no need to edit those, we'll add an extended description from the docs repo |
6928-Doc-MP-Reactive-Messaging-Stream Operators-3.0-1 #6928
Initial commentsFor We state shared libraries can be used - however if done that way, they need to supply permissions for it. There are two ways this can be done - via permissions.xml
or within Server.xml
We should provide one of these otherwise we would get support quesionts - so server.xml is likely sufficient - given it is smaller. As shared libraries are documented elsewhere, there is no need for an example of it here.
For outgoing, The bootstrap server is missing a value in the example
|
6928 documentation of mp reactive messaging stream operators 3-2 #6928
6928 documentation of mp reactive messaging stream operators 3-3 #6928
Happy with the changes and the page as a whole - just let me know if any other changes are made and require me to re-review Approved |
6928 documentation of mp reactive messaging stream operators 3-4 #6928
@ramkumar-k-9286 based on our discussion earlier a few more changes around the authentication part to simplify and better align with Kafka documentation I caused some confusion with separating SASL_PLAIN and SASL_SSL,, PLAIN sits on top of SASL_PLAIN and you wouldn't use SASL_SSL as the SASL mechanism and I would remove So for the options I would now go with:
As Examples of each of the above. SSL - Client authenticating the server
SASL_PLAIN: Authenticating with Kafka's Plain Login Module
Authenticating with Open Liberty's Kafka Login Module that can use passwords encoded by Open Liberty's securityUtility on a per channel basis
Mutual TLS - each channel uses a separate keystore to authenticate itself with the Kafka boostrap server
|
6928 documentation of mp reactive messaging stream operators 3-5 #6928
Hi Alex @abutch3r Edits for the existing documents: Added Information was added to the MicroProfile Reactive Messaging 1.0 page. Suggested edits made to the table - Please check and confirm if you are happy with the changes. Regards, |
@ramkumar-k-9286 happy with those changes |
6928 documentation of mp reactive messaging stream operators 3-6 #6928
Peer reviewLooks good @ramkumar-k-9286 - a few suggestions The title shouldn't be just a concatenation of product names but should focus on functional benefit- like also- most headings in the topic use Headline Capitalization- per IBM style, convert them to Sentence capitalization IntroReduce wordiness in shortdesc, and make it two sentences
then introduce the sections, but dont use passive voice
make sure to update the anchor list, still has a link to Connector options and channel properties, which is no longer on this page Configure the Liberty-kafka connector
make sure to provide a link to https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/microprofile-config-properties.html#react
What does this example show? Whats the result?
this is a sentence fragment
replace this paragraph with a concise sentence that leads into an ordered anchor list of the steps, link to the step headings. Add the corresponding numbers to each heading.
sentence fragment
list the options here and link to them so that the user only needs to read the option that they want.
stray plus sign Link the first mention of shared libraries to https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/class-loader-library-config.html#_configure_applications_to_use_a_shared_library
avoid passive voice to the Kafka client library specified as a shared ---> to a Kafka client library that is specified as a shared Kafka connector configuration and securityI think we should move this into a separate topic and provide a link to it from the end of the configuration section
what does this mean- do you need to support more than one method? does the user configure all 3 options, or just one? Make sure the list is parallel- text names first, followed by abbreviations in parentheses.
Does the user configure both, or either? securityUtility encode link is broken.
move that sentence to the intro for this section.
this doesn't need to be in a bullet. Sending and receiving messages between applications by using connectorsShould probably be "Sending and receiving messages among applications by using connectors" as there might be more than 2 apps. Between is for two items
this doesn't make sense, seems like two sentences might have been smushed together
add a fmi link to https://openliberty.io/guides/microprofile-reactive-messaging.html#creating-the-consumer-in-the-inventory-microservice TroubleshootingRun acrolinx and revise this section- make sure to reduce wordiness and overlong sentences |
6928 documentation of mp reactive messaging stream operators 3-7 #6928
6928 documentation of mp reactive messaging stream operators 3-8 #6928
feature pagesLink to new topic is broken and title is wrong. Need to check the 3.0 page once it's available, hopefully Monday. MP config table
---> |
Added mp.messaging.message.count{channel=““} info for mpMetrics-5.0 and mpMetrics-4.0 Looks good but confirm there is not a minimum version of Reactive messaging required |
Optimizing asynchronous communication with MicroProfile Reactive MessagingConfigure the Liberty-Kafka connectorlink to https://kafka.apache.org/ on first mention of the "Apache Kafka broker" Looking again at the first part of the "Configure..." section, the examples are exactly the same as those in the following steps. No need to duplicate them. Remove everything from "You can fine-tune your application’s interaction ..." to "...efficently managing messages." then link to the config properties table in step 1 describe the result of the config in step one. You can use some of the text you removed from the intro, but make sure to adaot it for this example. Include Kafka client librarieslist the two options here and link to them so that the user only needs to read the option that they want.
so this doesn't get lost, add a 4th step "Configure security for the Sending and receiving messages among applications by using connectorsremove this sentence:
This is a sentence fragment:
Put this at the end of the sending and receiving section instead of in Troubleshooting
TroubleshootingRun acrolinx and fix errors |
6928 documentation of mp reactive messaging stream operators 3-9 #6928
Hi David @dmuelle Incorporated suggested comments. Draft links: Regards, |
published at https://openliberty.io/docs/latest/liberty-kafka-connector.html, closing as completed |
Feature epic details
Operating systems
Does the documentation apply to all operating systems?
Summary
MicroProfile Reactive Messaging(RM) and Reactive Streams(RSO) 3.0.
Configuration
Updates to existing topics
3.0 pages for
RSO - https://openliberty.io/docs/latest/reference/feature/mpReactiveStreams-1.0.html
RM - https://openliberty.io/docs/latest/reference/feature/mpReactiveMessaging-1.0.html
https://openliberty.io/docs/latest/reference/feature/mpReactiveMessaging-1.0.html ,
This will be applicable to 1.0 and 3.0 as they use the same connector
https://openliberty.io/docs/latest/microprofile-config-properties.html#react
If an attribute is defined on both a Channel and the associated Connector, then the channel attribute takes precedence over the Connector's
attribute
andattributename
-attribute
is my preferenceMetrics List page
Create a new topic
Liberty-kafka connector
This is currently documented only in blogs and is something we should have a formal version of
Open Liberty includes the liberty-kafka connector for sending and receiving messages from an Apache Kafka broker.
To specify the use of the
liberty-kafka
connector for your application you can specify its properties as defined under https://openliberty.io/docs/latest/microprofile-config-properties.html#react and by setting it as the connector for a channel.All configuration for Connectors is defined in microprofile-config.properties
Example of setting attributes on the connector:
mp.messaging.connector.liberty-kafka.bootstrap.servers=localhost:9082
Example of defining the connector on a channel:
mp.messaging.incoming.foo.connector=liberty-kafka
Kafka Client libraries
When using the Kafka connector included in Open Liberty, you must include the the Kafka client API jar in your application or include it using a shared library.
If you’re building your application with Maven, you do this by adding this to the dependencies:
org.apache.kafka kafka-clients 3.5.1Configuration
The connector can be configured either directly or have its attributes defined on a channel that uses the connector. The Kafka options on the channel and connector will passed on to the Kafka client. each channel has its own instance of the connector, therefore if it provides its values it will not conflict with another channels.
For some properties it is recommended they are defined on the channel, for any property that is common across multiple channels, it should be defined on the connector. For example, the Kafka
bootstrap.servers
property is likely to be common across the channels, therefore should be defined on the connector. If the finaloutgoing
channel connected to a different Kafka server to place the result of the interaction, it would provide its ownbootstrap.servers
. However, a Kafka property such astopic
orgroup.id
is best added to the channel they are to be used by.Security
The liberty-kafka connector supports the following authentication methods
To configure any of these methods, review the relevant Kafka documentation to determine the properties that are needed to be defined and append them to either the Connector or associated Channels. As the Channels values take precedence over the Connector values, it is possible to use different sets of credentials to connect to the same Kafka boot server.
liberty-kafka Connector options
The Liberty-kafka connector has some additional properties that can be set that defines certain behaviors during operation
All these options can either be used as attributes on either the connector or a channel that uses the liberty-kafka connector. If the option is specified on both the channel and the connector, then the channel takes precedence
Incoming Channels
incoming
channels in relation to activities with the Kafka topic.If the value of
fast.ack
isfalse
, the acknowledgement is not reported as complete until the partition offset has been committed to the Kafka broker. If an error occurs during this process, then the acknowledgement is reported as failed.If the value of
fast.ack
istrue
, n acknowledgement is reported as complete as soon as the Kafka Connector receives the acknowledgement signal.False
- MicroProfile Reactive Messaging 3.0 -
true
For the
context.service
option to take effect for theliberty-kafka
connector, theconcurrent
feature must be enabled.concurrent-x.y
feature is enabled. the default context service is used.If the concurrent feature is not enabled, the built in Liberty context service is used with a set list of context types to capture and apply around asynchronous tasks.
Outgoing channels
For the
context.service
option to take effect for theliberty-kafka
connector, theconcurrent
feature must be enabled.concurrent-x.y
feature is enabled. the default context service is used.If the concurrent feature is not enabled, the built in Liberty context service is used with a set list of context types to capture and apply around asynchronous tasks.
fast.ack
example:In this example, the fast.ack property is set to false on the connector as the default for any channels in the application. for the Incoming channel
foo
, this is overridden totrue
.microprofile-config.properties
context.service
example:In the server.xml 3 different context services are defined with unique ids. In the application's
microprofile-config.properties
file. the first context service is set on the connector. The application has three channels, The channeldef
does not specify its own context.service, so it uses the one defined on the connector. The second and third channels define their own services and will use those respectively.server.xml:
microprofile-config.properties
Context Services that are defined within the application itself cannot be used with the liberty-kafka connector
Troubleshooting the liberty-kafka connector
Connecting to Kafka
Multiple Server instances
If multiple instances of OpenLiberty with the same application are started. For all incoming channels you must specify a unique
group.id
on the channel in each server instance, otherwise the server will reject any additional connections to a topic above the first connection.Multiple Reactive Messaging Applications using the same Kafka server
If multiple applications that use a Kafka client are deployed to liberty and attempt to connect to the same Kafka server then errors might occur due to conflict identifiers used by both Kafka Producers and Consumers across the two applications. This is due to how kafka generates the client.id for both. Consumers will generate identifiers based on their
group.id
or theirclient.id
.For consumers, it is recommended to create unique
group.id
for eachincoming
channelFor producers, it is recommended to create unique
client.id
for eachoutgoing
channelSpecifying either attribute on the
liberty-kafka
Connector will not resolve the issue and is not best practice.The text was updated successfully, but these errors were encountered: