Tag: Quarkus
How to run tasks in parallel with timeout in Java?
- Natan Ferreira
- 0
- 59
The use of Threads is essential to improving the performance and responsiveness of modern applications. With threads, it is possible to execute multiple tasks simultaneously, maximizing processor resources. They allow intensive operations, such as calculations or accessing external resources (e.g., databases, APIs), to be performed in parallel without blocking the main execution. Imagine the following…
Read MoreWhat is Richardson Maturity Model?
- Natan Ferreira
- 0
- 93
It is a model (developed by Leonard Richardson) to improve API maturity. To achieve the glory of REST, the API must have maturity levels. There are 4 levels, and next we will see how each of them works. Level 0: The Swamp of POX This level defines that the use of the HTTP protocol is…
Read MoreWhat is Garbage Collection in Java?
- Natan Ferreira
- 0
- 41
It is a process that manages memory in software written in Java. When running programs on the JVM (Java Virtual Machine), objects are created in the Heap memory. When these objects are no longer needed, the Garbage Collector will find unused objects and remove them from memory, helping to prevent memory leaks. We need to…
Read MoreHow to improve the performance of primitive types in Java’s Stream Api?
- Natan Ferreira
- 0
- 61
Java’s Stream API facilitates code maintenance, is used with lambda expressions and functional paradigm. It offers many features such as filtering a list, among others. Let’s see an example. For this, I created a class called Product. I populated a list of products and created the following stream. My goal is to map the quantity,…
Read MoreHow to use Qualifier in Quarkus?
- Natan Ferreira
- 0
- 433
Imagine the following scenario where there are multiple implementations for the same interface, and when using dependency injection, the software needs to understand which implementation to use. Let’s illustrate with an example to understand what the problem is and how to solve it. Website Diagram: https://refactoring.guru/ In the example, we will have a delivery system that…
Read MoreHow to create a Custom Annotation in Quarkus Framework?
- Natan Ferreira
- 0
- 494
It’s important to perform validations in the system. There are dependencies available for this with a lot of ready-made solutions. For example, in the case of Quarkus, we can use Hibernate Validator, which provides us with some annotations to solve common problems. However, if it’s necessary to perform a validation for which there is no…
Read MoreHow to do a Parameterized Unit Test in Quarkus?
- Natan Ferreira
- 0
- 323
Parameterized unit tests are beneficial for applications as they simplify the process of writing tests, allowing us to run a single test multiple times with different parameters. Requirements I’m using JDK 17, Intellij and Quarkus Version 3.4 on the project. Practice I created this class: These notations represent validations applied to the fields. For instance,…
Read MoreHow does unit test work ? How to do unit test on Quarkus ?
- Natan Ferreira
- 2
- 219
Testing a system is very important to maintain quality. There are some types of tests. Closer to the base of the pyramid, less cost and time are required.Let’s focus on the base of the pyramid. Unit test serves to validate the smallest code units. Generally a system accesses some external service such as a database,…
Read More