Java Weekly, Issue 376
1. Spring and Java >> FizzBuzz – SIMD Style! [morling.dev] Java 16's Vector API for mere mortals – taking advantage of the single instruction, multiple data (SIMD) capabilities with a new Java...
View ArticleSpring Security OAuth Authorization Server
1. Introduction OAuth is an open standard that describes a process of authorization. It can be used to authorize user access to an API. For example, a REST API can restrict access only for registered...
View ArticleHow Many Threads Can a Java VM Support?
1. Overview Throughout the years, the performance of the systems that we use has increased exponentially. Hence, the number of threads that the Java VM supports has increased as well. But, how many are...
View ArticleThe Java final Keyword – Impact on Performance
1. Overview The performance benefit of using the final keyword is a very popular debate topic among Java developers. Depending on where we apply it, the final keyword can have a different purpose and...
View ArticleClearing the Maven Cache
1. Overview In this short tutorial, we'll explore ways to clear our local Maven cache. We may want to do this in order to save disk space or clear up artifacts that we no longer reference. We'll first...
View ArticleDecode a JWT Token in Java
1. Overview A JSON Web Token (JWT) is often used in REST API security. Though the token can be parsed by frameworks such as Spring Security OAuth, we may wish to process the token in our own code. In...
View ArticleGet All Endpoints in Spring Boot
1. Overview When working with a REST API, it's common to retrieve all of the REST endpoints. For example, we might need to save all request mapping endpoints in a database. In this tutorial, we'll look...
View ArticleCreating a Read-Only Repository with Spring Data
1. Overview In this short tutorial, we'll discuss how to create a read-only Spring Data Repository. It's sometimes necessary to read data out of a database without having to modify it. In this case,...
View ArticleJava Weekly, Issue 377
1. Spring and Java >> The Arrival of Java 16! [inside.java] Java 16 is released – pattern matching, records, Unix-domain sockets, packaging tool, Vector API, and many more! >> Announcing...
View ArticlePaging and Async Calls with the Kubernetes API
1. Introduction In this tutorial, we continue to explore the Kubernetes API for Java. This time, we'll focus on two of its features: paging and asynchronous calls. 2. Paging In a nutshell, paging...
View ArticleSpring Reactive Guide
Getting Started with Spring WebFlux Guide to Spring 5 WebFlux Spring WebFlux Filters Static Content in Spring WebFlux Handling Errors in Spring WebFlux How to Return 404 with Spring WebFlux Spring MVC...
View ArticleReturning Stream vs. Collection
1. Overview The Java 8 Stream API offers an efficient alternative over Java Collections to render or process a result set. However, it's a common dilemma to decide which one to use when. In this...
View ArticleMocking Static Methods With Mockito
1. Overview More often than not, when writing unit tests, we'll encounter a situation where we need to mock a static method. Previous to version 3.4.0 of Mockito, it wasn't possible to mock static...
View ArticleJava Weekly, Issue 378
1. Spring and Java >> JEP 401: Primitive Objects (Preview) [openjdk.java.net] Efficiency or abstraction? Pick two! – the proposal for user-defined primitive objects for Java and JVM. Good stuff...
View ArticleHow to Check if a Database Table Exists with JDBC
1. Introduction In this tutorial, we'll look at how we can check if a table exists in the database using JDBC and pure SQL. 2. Using DatabaseMetaData JDBC gives us tools to read and write data to the...
View ArticleCount Query In jOOQ
1. Overview In this tutorial, we'll demonstrate how to perform a count query using jOOQ Object-Oriented Querying, also known as just jOOQ. jOOQ is a popular Java database library that helps you to...
View ArticleJava Class File Naming Conventions
1. Overview When a Java class is compiled, a class file with the same name is created. However, in the case of nested classes or nested interfaces, it creates a class file with a name combining the...
View ArticleSolving Spring’s “not eligible for auto-proxying” Warning
1. Overview In this short tutorial, we'll see how to track down the cause of Spring's “not eligible for auto-proxying” message and how to fix it. First, we'll create a simple real-life code example...
View ArticleOpen API Server Implementation Using OpenAPI Generator
1. Overview As the name suggests, the OpenAPI Generator generates code from an OpenAPI specification. It can create code for client libraries, server stubs, documentation and configuration. It supports...
View ArticleJava Weekly, Issue 379
1. Spring and Java >> JEP 406: Pattern Matching for switch (Preview) [openjdk.java.net] Patterns meet switch expressions – the proposal to use pattern matching on switching cases! >> A...
View Article