In this edition of the Engineering With Java newsletter, we have hand-picked some interesting, must-read Java and Spring articles that will make us better Java developer and empower us to build better software. Hope you will like the work. Consider sharing your love by liking and sharing your feedback in the comment section.
"We are striving and committed to making this the best Java newsletter."
1. IntelliJ and Java Spring Microservices: Productivity Tips With GitHub Copilot
The author discusses the vital role played by Github Copilot in enhancing code speed, reducing error, and improving productivity when used with IntelliJ IDEA. The author tried to use it for exception handling, mocking for unit tests, logging and debugging statements along code commenting. Copilot gets better over time and shows improvement as we keep using it for our development work.
2. Introduction to gRPC with Spring Boot
This tutorial explains how to implement gRPC service providers and consumers with Spring Boot. The author discusses the challenges in implementing gRPC in Spring Boot along with hands-on solutions to overcome them.
3. API Versioning Approaches and Best Practices
Software evolves due to business or regulatory changes. Users can be clients or other software. Changes are either backward compatible (resulting in minor version updates) or breaking changes (requiring a major version update). Major version updates allow clients to remain on older versions temporarily and plan for the transition to the new version. In this must-read blog, The author discusses three options for API versioning.
4. Fetching recursive associations with JPA and Hibernate
The author discusses fetching recursive associations using JPA and Hibernate, which are built using self-referencing foreign key columns. Fetching recursive associations with JPQL can be done using the JOIN FETCH clause in a JPQL query or using the Recursive CTE directive with a native SQL query.
5. Transactional Outbox Pattern
The author discusses the Dual Write problem and how the Transactional Outbox pattern can be a potential solution for it. The Transactional Outbox pattern is a solution to the Dual Write Problem, which is the difficulty in keeping different data sources working together when writing or saving. It adds a middle step to keep writing actions separate, ensuring that all writes are done correctly and the same in all places.
6. How to implement a soft delete with Hibernate
The author discusses the soft delete feature hibernate which just marks record deleted instead of actual deletion of the record. The soft delete can be implemented using a different SoftDeleteType or column type and can be used to update the state property in the current session or exclude soft deleted entities in queries.
7. Benchmark JDBC Connectors and Java 21 Virtual Threads
The author discusses the usage of a virtual thread that was introduced as part of the project loom for writing synchronous code but avoiding IO limitations. Additionally, the benchmark for the same is also shared and compared with the reactive programming paradigm which mainly uses asynchronous code.
8. Getting Started With Spring AI and PostgreSQL PGVector
The Spring AI project, part of the Spring ecosystem, simplifies the creation of AI applications in Java by using Spring AI and PostgreSQL pgvector. This allows developers to build generative AI applications that draw insights from their data.
9. What if Java had no for?
This blog discusses the versatility of for statements in Java, focusing on object-oriented (OO) programming languages. It discusses the use of lazy versions of numeric range-based for loops in the form of IntStream and LongStream. The blog also introduces a new lazy abstraction for an int range-based for loop.
10. Keycloak Integration with Spring Security 6
Keycloak is an open-source identity management solution designed to centrally manage user identities and access to applications. It is easy to integrate it with many applications, including just Spring Boot projects. This article discusses and demonstrates the integration of Keycloak with Spring Security.
11. An alternative of SQLite for Java Programmer
SQLite is a lightweight and lightweight framework for small and micro applications that require data processing and computing capabilities. However, it has limitations such as weak support for external data files and other data sources, lack of stored procedures, frequent data exchanges, inefficient code, and low development efficiency. The author discusses an alternative that is more efficient and feature-rich.
12. Quarkus and the MicroProfile Fault Tolerance API
The author discusses about Fault Tolerance and its implementation using Quarkus and MicroProfile Fault Tolerance API to enhance the resiliency of microservices by incorporating features like circuit breakers, timeouts, retries, and fallbacks.
13. When to Use RestTemplate | FeignClient | WebClient in Spring Boot?
Choosing the right tool for making HTTP requests between microservices is a challenging task, with options like RestTemplate, FeignClient, and WebClient available. The author discusses and compares various HTTP clients and explains when to use which option.
Interview Prep ( Affiliated )
If you are looking to improve your interview skills check below contents:
That’s a wrap for this week. If you have any feedback, requests, or improvements for this newsletter consider commenting so that we can work on improvements for the next one.