Files
awesome-kubernetes/docs/java_frameworks.md
2024-06-02 21:29:15 +05:30

51 KiB
Raw Blame History

Java and Java Programming Models. Open Source Microservices Frameworks

  1. Introduction
    1. How to migrate Java workloads to containers
    2. Existing Java Implementations
      1. Which Version of JDK Should I Use?
      2. Amazon Corretto OpenJDK distribution
    3. Use Java 11
    4. Java 17
    5. Java 18
    6. Java 19
  2. Java Programming Models (Frameworks)
  3. Jakarta EE
  4. Eclipse MicroProfile
    1. Server Vendors providing MicroProfile runtimes
  5. Hibernate
  6. Spring
    1. SpringBoot
      1. SpringBoot with Docker
      2. SpringBoot Tools
      3. Endpoints for k8s probes exposed by SpringBoot
        1. Demos
      4. Spring Cloud
        1. Spring Cloud Kubernetes
        2. Spring Cloud Config and Spring Cloud Config Server
        3. Secure Secrets with Spring Cloud Vault and alternatives
  7. Quarkus
  8. Kogito cloud-native business automation framework
  9. Thorntail (aka WildFly Swarm)
  10. Spring Boot VS MicroProfile
  11. Quarkus vs Spring Boot
  12. More Java Frameworks or Libraries
  13. Logging in Java
  14. Java Logger Implementations
  15. Java Testing Frameworks
  16. Debugging Java Threads
  17. Lombok
  18. Project Helidon
  19. Videos
  20. Images
  21. Tweets

Introduction

How to migrate Java workloads to containers

Existing Java Implementations

Which Version of JDK Should I Use?

Amazon Corretto OpenJDK distribution

  • Amazon Corretto No-cost, multiplatform, production-ready distribution of OpenJDK. Corretto comes with long-term support that will include performance enhancements and security fixes. Amazon runs Corretto internally on thousands of production services and Corretto is certified as compatible with the Java SE standard. With Corretto, you can develop and run Java applications on popular operating systems, including Linux, Windows, and macOS.
  • Amazon has been putting a lot of effort into Java. One of the central themes has been the reduction of latency. - youtube: Amazon Corretto, A Journey into Latency Reduction Corretto is a multi-platform, production-ready distribution of OpenJDK, supported by Amazon. We will talk about the Corretto project, its principals, and walk through examples that drove performance gains, latency reduction, and cost reduction in some of the biggest services in AWS.

Use Java 11

Java 17

Java 18

Java 19

Java Programming Models (Frameworks)

  • Best Java Frameworks Solutions The best Java Frameworks vendors are Apache Spark, Spring Boot, Oracle Application Development Framework (Oracle ADF), Jakarta EE, and Open Liberty. Apache is the top solution according to IT Central Station reviews and rankings. One reviewer writes: "Fast performance and has an easy initial setup", and another reviewer writes: "Easy to use and is capable of processing large amounts of data". The 2nd best product is Spring Boot. A user writes: "Very smooth implementation; excellent features for monitoring and tracking network calls ", and another reviewer writes: "Makes it difficult to support a specific functionality in a user-friendly manner, but simplifies application deployment".
  • Open Source Microservices Frameworks (frameworks for microservices development):
Java Programming Model Technology Cloud Native (microservices) Platform
Java EE
Java EE at a Glance
Frontend + Backend
Java EE Monoliths
No Java EE Middleware Servers (WAS, WebLogic, JBoss EAP, etc)
Jakarta EE (Java EE renamed) Frontend + Backend Yes OpenShift, Kubernetes, etc
MicroProfile Backend (RESTful) Yes OpenShift, Kubernetes, etc
SpringBoot (Spring) Backend (RESTful) Yes OpenShift, Kubernetes, etc
Spring Cloud (Spring) Backend (RESTful) Yes OpenShift, Kubernetes, etc
Quarkus Backend (RESTful) Yes OpenShift, Kubernetes, etc
Thorntail Backend (RESTful) Yes OpenShift, Kubernetes, etc
etc

Jakarta EE

Eclipse MicroProfile

Server Vendors providing MicroProfile runtimes

Hibernate

Spring

SpringBoot

SpringBoot with Docker

SpringBoot Tools

  • High-level abstractions/tools to run SpringBoot application on kubernetes without having to write 10,000 lines YAML. Tools that can automate the generation of Kubernetes manifests, so you concentrate only on building your business logic. Dekorate even supports annotations spring-like @KubernetesApplication(name="my-app") in your code, that generates your deployment manifest yml:
  • odo CLI tool
  • Dekorate Java library, has a Spring Boot support
  • JKube Maven plugin
  • Skaffold --generate-manifests
  • Spring Cloud Kubernetes
  • testcontainers-spring-boot 🌟 Container auto-configurations for spring-boot based integration tests. If you use Testcontainers with Spring Boot Hoja balanceándose en el viento you may be interested in the Playtika_Ltd Testcontainers library that provides auto-configurations for springboot based integration tests. It contains modules e.g. for kafka rabbitmq mongodb
  • github.com/piomin/spring-boot-logging A library for logging HTTP request/response for Spring Boot application and integration with Elastic Stack

Endpoints for k8s probes exposed by SpringBoot

Spring Boot🍃 provides the built-in Actuator feature to generate and expose endpoints for Kubernetes liveness/readiness probes.

1⃣ We need to enable it in config
2⃣ We can select components to analyze
3⃣ We can expose a probe on the app main port even if mgmt port is configured pic.twitter.com/h7mA5W0zUH

— Piotr Mińkowski (@piotr_minkowski) February 24, 2023
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Demos

Spring Cloud

Spring Cloud Kubernetes
Spring Cloud Config and Spring Cloud Config Server
Secure Secrets with Spring Cloud Vault and alternatives
[![microservice arch](images/microservice_arch.png)](https://medium.com/javarevisited/10-free-spring-boot-tutorials-and-courses-for-java-developers-53dfe084587e)

Quarkus

Kogito cloud-native business automation framework

Thorntail (aka WildFly Swarm)

  • Red Hat Thorntail is a framework based on the popular WildFly Java application server to enable the creation of small, stand-alone microservice-based applications. Thorntail is capable of producing so-called just enough app-server to support each component of your system.

Spring Boot VS MicroProfile

Quarkus vs Spring Boot

More Java Frameworks or Libraries

  • JPA streamer 🌟 JPAstreamer is a library for expressing JPA/Hibernate queries as Java streams. It can be also integrated with Spring.
  • logbook An extensible Java library for HTTP request and response logging

Logging in Java

Java Logger Implementations

Java Testing Frameworks

Debugging Java Threads

Lombok

Project Helidon

Videos

Click to expand!

Images

??? note "Click to expand!"

<center>
![spring annotations cheat sheet](images/spring_annotations_cheat_sheet.jfif)
</center>

Tweets

Click to expand!

Imagine needing to spend less😉
Guess what minimum heap size you need to run a @QuarkusIO 2.0 *on JVM* to run a simple CRUD endpoint? (no toy: including @Hibernate , @resteasy, Jackson, JTA transactions, DB connection pool, caching, @vertx_project ,Netty, CDI via ArC, ...)

— Sanne (@SanneGrinovero) July 2, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

I'm observing @QuarkusIO for a long time. I think it's time to consider migration from Spring Boot into Quarkus especially if you develop on the Kubernetes-native platform. You may expect some tips in the near future - smth similar to #SpringBootTip series some months ago.

— Piotr Mińkowski (@piotr_minkowski) September 2, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Quarkus Tip 💡

You can deploy the @QuarkusIO application to #Kubernetes without creating any #YAMLs manually. To do that you should include the Quarkus Kubernetes module, use dedicated application properties, and enable deployment during your Maven build. 👇👇👇

🏷️ #QuarkusTips pic.twitter.com/pju8vVYBz7

— Piotr Mińkowski (@piotr_minkowski) September 8, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Quarkus Tip 💡

You can easily build and run a native Quarkus @graalvm image on OpenShift using a single `oc` command and `ubi-quarkus-native-s2i` image builder. Such a build is performed fully on the cluster side. 👇

🏷️ #QuarkusTips pic.twitter.com/98fCXNUWv6

— Piotr Mińkowski (@piotr_minkowski) September 9, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Java 8 best practices cheat sheet: pic.twitter.com/jbyzbxJs28

— Java Guides (@GuidesJava) December 12, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

5+ excellent GitHub repositories for every Java developer #github #Java
Thread 👇

— Java Guides (@GuidesJava) January 7, 2022
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Best Java blog websites for Java developers
Thread 👇

— Java Guides (@GuidesJava) January 9, 2022
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Java programmer roadmap pic.twitter.com/KKdK0hdBB2

— javinpaul (@javinpaul) July 1, 2022
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Spring and spring boot annotations: pic.twitter.com/CwPxJabliI

— Java Guides (@GuidesJava) October 15, 2022
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

The best ways to waste time in discussions in the Java world:

- Lombok VS. non-Lombok
- ORMs VS. JDBC
- Spring VS. JakartaEE

PSA: All of them are pointless. Save your time. Go ahead and work on stuff you consider important instead.

— Oliver Drotbohm 🥁 & 👨‍💻 (@odrotbohm) November 23, 2022
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Java Collections cheat sheet: pic.twitter.com/X06xq0pCbL

— Java Guides (@GuidesJava) December 17, 2022
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Spring Annotations cheat sheet:
Reference: linkedin pic.twitter.com/GoEKSuyVrZ

— Java Guides (@GuidesJava) December 27, 2022
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Spring Boot Tip🍃💡

Make your app logs more colorful 😉
Config in the `application.yml` file👇

logging:
pattern:
console: "%clr(%d{HH:mm:ss.SSS}){blue} %clr(---){cyan} %clr([%15.15t]){yellow} %clr(:){red} %clr(%m){magenta}%n" pic.twitter.com/y5wQcDyN4K

— Piotr Mińkowski (@piotr_minkowski) February 24, 2023
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Spring Boot🍃 provides the built-in Actuator feature to generate and expose endpoints for Kubernetes liveness/readiness probes.

1⃣ We need to enable it in config
2⃣ We can select components to analyze
3⃣ We can expose a probe on the app main port even if mgmt port is configured pic.twitter.com/h7mA5W0zUH

— Piotr Mińkowski (@piotr_minkowski) February 24, 2023
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

2k followers on GitHub :) If you are looking for examples related to Java, Kubernetes, Spring Boot etc. for sure you will find smth for yourself amongst my repos: https://t.co/8ORKKxSYAW pic.twitter.com/r6VyDorq5g

— Piotr Mińkowski (@piotr_minkowski) May 5, 2023
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>