Skip to content
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

Add first version of the guide for writing REST microservices using virtual threads #27840

Merged
merged 1 commit into from Sep 15, 2022

Conversation

anavarr
Copy link
Contributor

@anavarr anavarr commented Sep 9, 2022

This guide contains

  • a brief introduction to virtual threads
  • a trivial example on how to use the @RunOnVirtualThread annotation and with which endpoints ?
  • a complex example to show how it differs from asynchronous reactive programming (declarative style using mutiny)
  • a discussion about why performance might not be as good as asynchronous reactive endpoints (typically RESTeasy reactive + mutiny)
  • a guide to specify the good flags to make everything work + a special attention to dev mode configuration

@quarkus-bot

This comment was marked as resolved.

@quarkus-bot quarkus-bot bot added this to To do in Quarkus Documentation Sep 9, 2022
@anavarr anavarr changed the title wrote the first version of the guide for writing REST microservices using virtual threads First version of the guide for writing REST microservices using virtual threads Sep 9, 2022
@geoand geoand changed the title First version of the guide for writing REST microservices using virtual threads Add first version of the guide for writing REST microservices using virtual threads Sep 12, 2022
Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

I've added some comments

docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
Comment on lines 129 to 134
Virtual threads are still an experimental feature, you need to start your application with the `--enable-preview` flag:

[source, bash]
----
java --enable-preview -jar target/quarkus-app/quarkus-run.jar
----
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The step about building the application has been skipped. Is there anything special users need to do?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a paragraph. Also explain this wonderful preview.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not anymore, they only need to worry about the building step if they use the netty-loom extension, this is detailed in the part about the extension

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what you mean @cescoffier ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dev mode required a -Dloom-open

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't anymore, it does if you use the Netty-loom extension though but there is a part about it in the guide

docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
We will give a brief overview of the topic here, please refer to the link:{vthreadjep}[JEP 425] for more information.

Virtual threads are a feature available since Java 19 aiming at providing a cheap alternative to platform threads for
IO-bound workloads.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to use one sentence per line.

docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/quarkus-virtual-threads.adoc Outdated Show resolved Hide resolved
Quarkus Documentation automation moved this from To do to Review pending Sep 14, 2022
@cescoffier
Copy link
Member

@anavarr except for the name that needs to be fixed, the rest looks good.
Please rebase and squash your commits.

@anavarr
Copy link
Contributor Author

anavarr commented Sep 15, 2022

all good, put Quarkus Virtual Thread support in the title, rebased, squashed

@gsmet
Copy link
Member

gsmet commented Sep 15, 2022

Small nitpick: I would just call the file virtual-threads.adoc. It's going to make for a better URL on the website (given you're already on quarkus.io).

@geoand
Copy link
Contributor

geoand commented Sep 15, 2022

Just a reminder when it's all ready to go, we'll need a squash and rebase onto main

…sing virtual threads

Co-authored-by: Georgios Andrianakis <geoand@gmail.com> and Clément Escoffier <clement.escoffier@redhat.com>
@anavarr
Copy link
Contributor Author

anavarr commented Sep 15, 2022

Yep, I'm rebasing as main grows

Quarkus Documentation automation moved this from Review pending to Reviewer approved Sep 15, 2022
@cescoffier cescoffier merged commit 92fba0a into quarkusio:main Sep 15, 2022
Quarkus Documentation automation moved this from Reviewer approved to Done Sep 15, 2022
@quarkus-bot quarkus-bot bot added this to the 2.14 - main milestone Sep 15, 2022
@cescoffier
Copy link
Member

@gsmet I put the backport label, but as it's a guide, I'm not sure you can backport it. It's not mandatory, it would just be nice to have it in.

@gsmet gsmet modified the milestones: 2.14 - main, 2.13.0.Final Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants