Principles of Vertx (2nd edition)
Principles of Vertx (2nd edition)
How to build reactive applications and be happy
About the Book
This is the second edition of the popular “Principles of Vertx” book. The work was completely rewritten in order to promote new programming paradigms, that we introduced by the fourth release (Vertx 4.x). Unlike other existing publications about the Vertx platform, this book took as its priority to introduce readers to established software architecture practices and their implementations using Vertx. The book uses a project driven approach and it covers Eclipse Vertx 4.x features.
Table of Contents
Chapter 1. Futures
The concept of Futures in Vertx 4
How to create Future instances
Using Java asynchronous types
With a hardcoded value
From Vertx Promises
The difference between a status and a value
Sequential composition patterns
How to handle a recovery
Concurrent composition patterns
Any
All
Join
Chapter summary
Chapter 2. Verticles
Why verticles are actors
Why verticles are not actors
A lifecycle of a verticle
The difference between standard and worker verticles
How to execute blocking code inside standard verticles
Chapter summary
Chapter 3. An application configuration and a dependency injection
A configuration management
Using custom configuration sources
The dependency injection pattern in Vertx applications
Chapter summary
Chapter 4. Testing
Test context instances and their lifecycles
Unit tests
Checkpoints
Integration tests
API endpoints tests
Code coverage
Chapter summary
Chapter 5. Working with PostgreSQL databases in Vertx applications
Building blocks of the Vertx reactive client for PostgreSQL
Prepared queries
Row sets
Row mapping patterns
Notes about the usage of query builder libraries
CRUD operations with the Vertx reactive client for PostgreSQL
Save a new entity
Retrieve a single entity
Retrieve many entities
Delete an entity
Update an entity
How to handle schema creations and to manage migrations from Vertx applications
Execute queries in batches
The Pagination pattern
The Sorting pattern
How to handle aggregation operations
Aggregate data from two tables
Aggregate data from three tables
Chapter summary
Chapter 6. Working with MongoDB databases in Vertx applications
Make use of the MongoDB data model (documents instead of rows)
Document mapping patterns
CRUD operations with the Vertx reactive client for MongoDB
Save a new entity
Retrieve a single entity
Delete an entity
Retrieve many entities
Update an entity
Update using the save() method
Update using the updateCollection() method
How to manage bulk operations
Working with aggregation pipelines in Vertx applications
Chapter summary
Chapter 7. Making HTTP calls with the Vertx WebClient
How to execute requests without a body payload
How to execute requests with a body payload
Response predicates
Chapter summary
Chapter 8. Building REST APIs with Vertx
Make use of the Vertx web stack
The implementation of a CRUD REST service
An endpoint to create a new account
An endpoint to retrieve a single account
An endpoint to update an account
An endpoint to remove an account
An endpoint to retrieve a list of accounts
How to build a pagination for REST API in Vertx
Cross Origin Resource Sharing
Types of CORS requests
How to configure CORS with Vertx
A good error handling design
Chapter summary
Chapter 9. Dealing with file uploads in Vertx applications
An implementation of a file upload service component
Option A: store files in a local file system
Option B: store files on a FTP server
Option C: store files using a S3 compatible storage
An implementation of a file upload endpoint
Chapter summary
Chapter 10. Communication between application components in Vertx
An architecture of the io.vertx.core.eventbus.Eventbus
The Publisher component
The Bus component
The Message component
The Subscriber component
Implementations of standard communication paradigms in Vertx
The Broadcasting (Publish-subscribe) pattern
The Point to Point pattern
The Request-response pattern
Error handling mechanisms
The Dead Message pattern
The Invalid Message pattern
Chapter summary
Chapter 11. Authentication in Vertx applications
A concept of a token based authentication
Session tokens
Implementations of authentication features
Signup (Service)
Signup (Endpoint)
Login (Service)
Login (Endpoint)
Authenticate (Service)
Using the token based authentication with REST API
Testing
Chapter summary
Chapter 12. Architectural patterns for Vertx applications
Defining the application’s structure
How to use verticles?
Pattern 1. Using verticles as “applications”
Pattern 2. Using verticles as “proto” layers
Pattern 3. Using verticles as “proto” domains
Chapter summary
Chapter 13. Running single page apps on Vertx
On the frontend part (Vue + Vite)
Initialize a Vue 3 application
Set up a client side routing
Proxying API requests
On the backend part (Vertx)
Modify a build script
Serve the frontend from the WebVerticle component
Run the project
Chapter summary
Chapter 14. Deploying Vertx applications
Create fat jar applications
Use Docker with Vertx
Use Docker Compose with Vertx
Chapter summary
(Updated 12 July 2022)
Other books by this author
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them