Book Image

Cloud-Native Development and Migration to Jakarta EE

By : Ron Veen, David Vlijmincx
Book Image

Cloud-Native Development and Migration to Jakarta EE

By: Ron Veen, David Vlijmincx

Overview of this book

Cloud-Native Development and Migration to Jakarta EE will help you unlock the secrets of Jakarta EE's evolution as you explore the migration and modernization of your applications. You’ll discover how to make your code compatible with the latest Jakarta EE version and how to leverage its modern features effectively. First, you’ll navigate the realm of cloud-native development as you demystify containers and get introduced to the Eclipse MicroProfile, a powerful tool in your toolkit. Next, you’ll take the bold step of transitioning your applications from local hardware to the limitless possibilities of the cloud. By following the author’s expert guidance to deploy your Jakarta EE applications on Microsoft Azure, you’ll gain hands-on experience in managing cloud resources. In the final leg of your journey, you’ll explore the world of serverless architecture. You’ll learn to design and run services that are truly serverless, harnessing the potential of the event-driven paradigm for scalability and cost-efficiency. By the end of this book, you’ll have mastered Jakarta EE and become a proficient cloud-native developer. Join us on this exciting journey of transformation and innovation as you pave the way for the future of Jakarta EE and cloud-native development.
Table of Contents (18 chapters)
1
Part 1: History of Java EE and Jakarta EE
4
Part 2: Modern Jakarta EE
8
Part 3: Embracing the Cloud
Appendix A: Java EE to Jakarta EE names
Appendix B: As a Service

MicroProfile Fault Tolerance

So, we have our service configured and we can check its health. The next step for a microservice to become cloud-native is adding some resilience. The service should be able to self-heal within certain limits.

There are six annotations available within MicroProfile Fault Tolerance that can help make your service more robust:

  • @Asynchronous
  • @Retry
  • @Timeout
  • @Bulkhead
  • @CircuitBreaker
  • @Fallback

It is good to know that these annotations can be added to both CDI beans and public methods within those beans. Under the hood, they are implemented via interceptors.

@Asynchronous

@Asynchronous adds, well, asynchronous behavior to the method it annotates. It wraps them into a method that returns CompletableStage on which the other fault tolerance annotation can be applied.

@Asynchronous allows your code to run concurrently. Let’s have a look at an example:

@Inject
// is annoted with @Asynchronous
private CustomerDetailsService...