-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Getting started guide for smallrye-reactive-messaging-kafka #17830
Getting started guide for smallrye-reactive-messaging-kafka #17830
Conversation
8b0c3ba
to
c69eeea
Compare
With Dev Services, I'm wondering if we should not split the app in two different processes. That would be way more realistic. |
c69eeea
to
e4251f8
Compare
e4251f8
to
34afbda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does <> cross page boundary? I always used xref in that case.
|
||
== Architecture | ||
|
||
In this guide, we are going to develop two microservices for an application that will ask for some price and receive quotes from providers in real-time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this guide, we are going to develop two microservices for an application that will ask for some price and receive quotes from providers in real-time. | |
In this guide, we are going to develop two applications communicating with Kafka. | |
The first application sends a _quote request_ to Kafka and consumes Kafka messages from the _quote_ topic. | |
The second application receives the _quote request_ and sends a _quote_ back. |
- add picture
|
||
In this guide, we are going to develop two microservices for an application that will ask for some price and receive quotes from providers in real-time. | ||
|
||
The first component, the `producer`, will let the user request some quotes over a JAX-RS endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first component, the `producer`, will let the user request some quotes over a JAX-RS endpoint. | |
The first component, the `producer`, will let the user request some quotes over an HTTP endpoint. |
For each quote request a random identifier is generated and returned to the user, to put the quote request on _pending_. | ||
At the same time the generated request id is sent over a Kafka topic `quote-requests`. | ||
|
||
The second component, the `processor`, in turn will read from the `quote-requests` topic put a magic random price to the quote and send it to a Kafka topic named `quotes`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second component, the `processor`, in turn will read from the `quote-requests` topic put a magic random price to the quote and send it to a Kafka topic named `quotes`. | |
The second component, the `processor`, in turn, will read from the `quote-requests` topic put a random price to the quote, and send it to a Kafka topic named `quotes`. |
import io.smallrye.mutiny.Multi; | ||
[...] | ||
|
||
@Inject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Inject can be ommited.
---- | ||
|
||
Nothing spectacular here. | ||
On each received price, it updates the page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On each received price, it updates the page. | |
On each received quote, it updates the page. |
Quarkus starts a Kafka broker automatically, configures the application and shares the Kafka broker instance between different applications. | ||
See xref:kafka-dev-services.adoc[Dev Services for Kafka] for more details. | ||
|
||
Open `http://localhost:8080/quotes.html` in your browser. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open `http://localhost:8080/quotes.html` in your browser. | |
Open `http://localhost:8080/quotes.html` in your browser and click the button to request quotes. |
This guide has shown how you can interact with Kafka using Quarkus. | ||
It utilizes SmallRye Reactive Messaging to build data streaming applications. | ||
|
||
If you want to go further check the documentation of https://smallrye.io/smallrye-reactive-messaging[SmallRye Reactive Messaging], the implementation used in Quarkus. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to go further check the documentation of https://smallrye.io/smallrye-reactive-messaging[SmallRye Reactive Messaging], the implementation used in Quarkus. | |
If you want to go further check the documentation of https://smallrye.io/smallrye-reactive-messaging[SmallRye Reactive Messaging]. |
Small fixes
The kafka.adoc will be renamed to Kafka reference guide