Skip to content

Latest commit

 

History

History
55 lines (33 loc) · 1.41 KB

File metadata and controls

55 lines (33 loc) · 1.41 KB

Vert.x virtual threads examples

Here you will find examples demonstrating the usage of the virtual threads with Vert.x.

This requires to use Java 21.

HTTP client

This example shows the how to use the Vert.x HTTP client with Vert.x virtual threads

Web client

This example shows the how to use the Vert.x Web client with Vert.x virtual threads

SQL client

This example shows the how to use the Vert.x SQL client with Vert.x virtual threads

Movie rating application

A movie rating REST application demonstrating the use of Vert.x virtual threads.

The application exposes a REST API for rating your favorite movies:

You can know more about a movie

> curl http://localhost:8080/movie/starwars
{"id":"starwars","title":"Star Wars"}

You can get the current rating of a movie:

> curl http://localhost:8080/getRating/indianajones
{"id":"indianajones","rating":5}

Finally, you can rate a movie

> curl -X POST http://localhost:8080/rateMovie/starwars?rating=4