Unnamed patterns, Spring boot 3.2, generational ZGC, custom JFR events, index selectively, and chopping a monolith
This is the standard author on the site. Most articles are published by individual authors, with their own profiles, but when multiple people have a strong contribution, we publish collectively here.
Here's what I've written (so far):
Baeldung on Java
- Java (658)
- Weekly Review (366)
- Spring (231)
- Testing (173)
- Spring Boot (157)
- Persistence (128)
- Java String (125)
- REST (117)
- Spring MVC (100)
- DevOps (97)
- Data (96)
- Programming (92)
- Spring Security (90)
- Java Collections (90)
- Spring Data (82)
- Jakarta EE (80)
- NoSQL (76)
- Java Concurrency (68)
- Algorithms (63)
- Security (61)
- Java Map (59)
- Java IO (59)
- Reactive (58)
- JSON (58)
- Maven (52)
- HTTP Client-Side (51)
- JPA (50)
- Java Dates (45)
- Java Streams (44)
- Spring Web (43)
- Java Array (43)
- Spring Cloud (42)
- Series (41)
- Spring Persistence (37)
- Guava (33)
- Jackson (30)
- Gradle (29)
- JVM (26)
- Cloud (26)
- XML (24)
- Architecture (24)
- Logging (23)
- IDE (17)
- Networking (10)
- Docker (10)
- Web Services (9)
- Java Numbers (6)
- News (1)
- Java Web (1)
Learn how to use custom fonts in Java applications to еnhancе visual appеal and crеatе distinctivе usеr intеrfacеs.
Learn how to convert a Long timеstamp to a LocalDatеTimе objеct in Java.
Explore different ways to pass JVM options to the bootRun command.
Learn how to use a UUID to generate a unique numeric value.
Learn how to modify an HTTP request before it reaches the controller in a Spring Boot application.
Learn to implement an asynchronous execution with automatic retry in a Spring application.
In this tutorial, we learn how to configure Gradle to work behind a proxy server.
Last few days of Black Friday. Cascading deletes with Hibernate, Spring 6.1, String Templates, Ktor, error handling, and test data generation. A good week 🙂
Learn the different ways of asserting the presence of a nested map with JUnit.
Learn different ways to parse XML into a HashMap, a data structure that allows for efficient data retrieval and manipulation.
Explore thе Collеctions.sort() timе complеxity using Java Microbеnchmark Harnеss (JMH).
Learn how to represent the furthest possible date using the java.util.Date and java.lang.Long classes.
Learn how to use the Java standard API and a third-party API to create a table using ASCII characters in Java.
Table partitioning with Spring, pattern matching, project loom, generational GC, log4shell retro, and Open Telemetry collector!
Learn to convert a ResultSet in to a HashMap in Java.
Learn how to convert a HashSet into an array using the toArray() method of the HashSet class.
Explore a few distinct methods to switch between frames with Selenium WebDriver.
Explore various approaches to converting a Hex String into an int in Java.
Learn to implement the Bill Pugh Singleton pattern.
In-memory HTTP server, SSL hot reloading, Kotlin multi-platform, new reactor features, and API versioning!
Explore ways of transforming a stream into a Map or Multimap in Java using various approaches and libraries.
Discover the common mistakes made while modifying the elements in a Java Stream and the correct way to do it.
Explore different ways to add a list as a query parameter when making requests using the Jersey client.
Learn how to round the date using the java.util.Date, as well as LocalDateTime and ZonedDateTime.
Explore three methods for writing to and reading from a file with HashMap data.
Learn how to check if a Java string contains only Unicode letters.
Explore best practices for using the @param tag to document generic type parameters.
In this tutorial, we learn how to iterate over the characters of a String in Java.
Spring 6.1 is getting closer, and we still have lots of things to explore in Java 21 🙂
Learn how to convert a string with XML-based content into Org.w3c.dom.Document in Java.
Learn how to convert an XML Document object to a string in Java.
Learn about the JdbcClient interface, the latest addition to Spring Framework 6.1.
Learned the basic usage of FileWriter and PrintWriter with example code and understand their differences.
Starting to look forward towards Java 22. Good stuff is acoming.
Explore different ways to manage timeouts with Java CompletableFuture.
Learn how to remove elements from a queue using a while loop in Java.
Explore and discover the differences between HttpSecurity and WebSecurity.
Learn about the ConnectionDetails interface in Spring Boot 3.1.
Explore various techniques for converting an object to its string representation in Java.
Learn multiple ways to center text output in Java: String formatting, StringBuilder, and StringUtils from the Apache Commons Lang libraries.
Learn how to write HashMap to a CSV file.
Markdown coming to Java comments? Oh, and lots of Kafka 🙂
A quick and practical guide to splitting Java String into key-value pairs.
Learn step-by-step how to setup a GlassFish server within the Eclipse IDE.
Learn to compare objects using Apache Commons Lang 3.
This tutorial teaches various ways to validate a boolean in Spring Boot.
Understand the key differences between encapsulation and information hiding.
A quick and practical guide to converting HashMap.toString() to HashMap in Java.
Explore double and float in Java and learn how to convert them into each other.
Concurrent undo cycle, virtual thread pinning, Kafka worker on virtual threads, Java in Netflix, and no silver bullet in databases. A good week.
Learn about SpringRunner and SpringBootTest.
Unused variables, pinned threads, class-file API, concurrent undo cycle, strategy pattern, and managerial skills!
Learn how to create an ArrayList with multiple object types in Java.
Learn about an exciting preview feature in Java 21: unnamed patterns and variables.
Learn how to build a Docker image for a GraalVM native executable.
Explore several ways of writing JUnit tests to validate interface contracts in Java.
Learn how to use Java to determine file extensions for IANA media types.
Learn how to generate a sequence of characters from ‘A’ to ‘Z’ in Java.
Virtual threads, Java 21, more switch enhancements, GraalOS, JVM stack size, and updating events in EDA!
Explore how to add code snippets into documentation using the @snippet tag.
Learn how the kubectl object management works with kubectl create and kubectl apply.
Learn about the methods permitAll() and anonymous() of the class HttpSecurity from Spring Security Framework.
Explore various methods of merging the contents of two arrays and eliminating the duplicates.
Learn about the usage of several libraries, such as Apache POI, Poiji, FastExcel, and JExcelApi, to read and convert data from Excel files into Java objects.
Compare Java’s Double to BigDecimal and learn about their differences.
Explore several methods for detecting the end-of-file character in Java.
Laern about the deprecated queryForObject() and query() methods of JdbcTemplate and their preferred counterparts.
Java 21, monkey patching with Java, high-performant records, 12-factor apps, OpenJDK migrations, and real-time applications!
Learn how to configure the lint plugin and generate lint reports.
Learn how to add minutes to a time in the string format using the legacy Date API and the Date Time API.
A quick and practical guide to replacing single quote with \’ in Java strings.
Learn how to implement the IN query clause using Spring Data Cassandra.
A collection of tutorials on Thymeleaf
Learn different ways to mock constructors through Mockito and PowerMock.
Explore the process of creating Java objects using their class names.
Learn the differences between heap dump, thread dump, and core dump and understand their use cases.
Spring Boot with Graal and virtual threads, sealed pattern matching, Oracle JSON, Java 21, and Problem Details in HTTP APIs.
Explore the necessary steps to send JSON format data to the topic using a Kafka producer and consumer.
Spring AI, no more N+1 problem, statement caching, streams with virtual threads, service mesh, and good by EC2 classic!
Learn about different ways to handle exceptions in Java stream pipelines using aggregation.
Learn how to convert from Java’s LocalDate to Epoch and vice versa.
A quick and practical guide to XSLT processing in Java.
Learn three different methods to implement the clamp function in Java.
Hiding numerical identifiers in JPA, continuation, Spring Boot file storage, Java 21 migration, and people support strategies!
Learn how to determine the Cartesian product of an arbitrary number of sets in Java.
Explore different ways to resolve the “Error in Opening Zip File” issue.
Learn how to generate a model with Lombok annotations using the OpenAPI code generator.
JPA associations, event-driven Java, Valhalla under the hood, OpenJDK compatibility, and millions of connections with Zuul!
Learn how to create JSON Schemas programmatically using the Java JSON Schema Generator library.
Learn about the database utilities provided by MyBatis and Spring JDBC to execute SQL files.
Learn how to calculate the sum of two arrays element by element in Java.
Find out the differences between two seemingly similar Git operations – fork and clone.
A quick and practical guide to sorting Java Map in descending order.
Explore the utility of the List variant of the annotations available under the package jakarta.validations.constraints.
Learn two different ways to convert time from the 12-hour time format to the 24-hour time format in Java.
The semantic kernel in Java, GC improvements in Java 21, sealed classes, project Leyden, async-profiler, and GenAI code assistance!
A quick and practical guide to converting List to Long Array in Java.
A quick and practical guide to HashMap with multiple values per key.
JVM computed constants, safepoints, Maven vs Gradle battle, GC improvements, bulk SQL, and effective technology strategies. A good week.
A quick and practical guide to Avaje Inject.
A quick and practical guide to converting String or String Array to Map in Java.
Pulsar is a high-throughput pub/sub system which aims to overcome Kafka’s limitations. We look at how to use it with Spring.
Testcontainers, VisualVM profiling, project Leyden, virtual threads, magnificent S3, and GenAI!
Learn about the Java “java.net.SocketException: “Broken pipe” error, understand the leading cause of the exception, and see how to fix it.
Learn how to get the start and end dates of a year using the modern Date Time API and the old Calendar and Date classes.
Soft delete in JPA, Kotlin 1.9, platform teams, sliced onion architecture, and stream processing!
Explore various methods for removing extra whitespaces from a JSON string in Java.
Learn about the Law of Demeter and understand how to adhere to it in object-oriented code.
A quick and practical guide to checking if a String has all unique characters in Java.
A quick and practical guide to converting JsonNode to Map in Java.
A quick and practical comparison between Gson @Expose and @SerializedName
A quick and practical comparison between Map.clear() and creating a new Map.
Learn how to determine the maximum depth of the Java call stack.
Azure Spring, Spring Rest Client, Micronaut 4, Reactive database connectivity, virtual threads, and Gen-AI.
Explore various methods for achieving pretty printing of JSON in Java.
Understand the specifics of how Java reads integers and whether it follows the Little or Big Endian approach.
Generational ZGC, reactive database access, health check, Kotlin 1.9, and billions of messages over TCP/IP!
A quick and practical guide to deep-copying an ArrayList in Java.
A quick and practical guide to accessing session attributes in Thymeleaf.
Explore the differences between Integer.class, Integer.TYPE, and int.class. Understand their significance in Java programming.
A quick and practical guide to checking if a String contains non-alphanumeric characters.
Learn how to document event-driven Spring Boot services using Springwolf.
Spring Cloud OpenFeign makes it easy to write a client to REST APIs. We can use this for PATCH requests. We look at how this works and how to set it up to avoid common pitfalls.
Learn how to solve the 403 error in a Spring Boot POST request.
Learn the difference between @JoinColumn and @PrimaryKeyJoinColumn in Java Persistence API (JPA).
Intermediate stream, intelligent Spring with OpenAI, pattern matching, p99 of GC, and moving out of the Cloud.
Let’s compare Swagger’s @Parameter and @Schema annotations, and identify the correct usage for each.
Explore the difference between .properties and .yml files and learn how to convert the application.properties file to application.yml and vice-versa using various tools and plugins.
Learn how the @RequiredArgsConstructor annotation of Lombok can help auto-generate constructors for classes.
Learn the differences between JAXP and JAXB in Java and understand when to use which.
Explore how to remove JSON elements using Jackson and understand the process through practical examples.
Lots and lots of new releases this week. And some Java Records goodness 🙂
Explore the differences between Boolean.TRUE and true in Java to properly use these representations of true boolean values.
Explore several approaches to convert a Java array to an Iterable collection.
Learn three different ways to generate the hex representation of a SHA-1 digest of a string in Java.
Learn how to convert a Java List to a JSON array.
Simplified SSL in Spring Boot, structured concurrency in Java 21, nulls in Collectors, XSS in Java, and WASM on Docker.
A quick and practical guide to conditionally adding a checked attribute to input in Thymeleaf.
Learn how to generate WSDL stubs with Gradle and use the generated stub classes.
Explore multiple ways to concatenate two or more byte arrays.
Generational Shenandoah, nullability of value types, class loaders in Java, DDL validation, and rolling out features at scale!
Explore various approaches such as reflection, Jackson, and Gson to convert Java Objects into Java Maps.
Learn how to return a value from a thread that has its job terminated
Learn how to display on the console the full HTTP response body with Gatling.
Exhaustiveness in Pattern Matching, dynamic threads for JVM compilers, JFR events in shell, association attributes in JPA, and zero downtime migrations at scale!
Learn how to replace a pattern in various locations of a Word document.
Learn about the differences between unidirectional and bidirectional associations in JPA/Hibernate.
Learn how to avoid Spring Boot configuration properties errors by using canonical kebab-casing formats.
Learn the differences between the readObject() and readResolve() methods of the Java Serialization API.
A quick and practical guide to solving the “Command Line is Too Long” issue in IntelliJ IDEA.
A quick and practical guide to configuring Gradle tasks in Spring Boot 3.
Learn how to convert a Map to JSON in Java.
Explore the performance of arrays and lists in Java.
Simplified main entries, CDC for cache, cloud-native Graal, key encapsulation, and event sourcing and audit logs!
Learn how to generate Javadoc using the Gradle build system.
Discover the differences between the String.valueOf() and Object.toString() methods.
Explore the distinction between the modulepath and classpath in Java.
Java performance is the theme this week, with a lot of interesting pieces.
Private microservices may use a shared secret to protect their APIs from illegal access. We look at how to implement a simple token based security pattern based on a shared secret using Spring Security.
Learn about hashing and salting techniques and understand how to hash with Argon2 in Java.
Explore two approaches to opening a new tab with Selenium.
Explore the practical implications of creating an interface for a single implementation in Java and understand the pros and cons of this approach.
Explore the differences between \z and \Z anchors, how they work, and when to use them.
Learn the difference between “implementation” and “compile” in Gradle and provide best practices for effective dependency management
Learn about the implementation differences between ArrayBlockingQueue and LinkedBlockingQueue.
Learn how “null” and empty strings behave in different scenarios.
Learn how to work with Gradle, the build tool for Java-based applications
Unnamed methods in Java, Hibernate 6 migration, async-profiler, generative AI and jobs, and monoliths are not dinosaurs!
Learn how to read multiple inputs on the same line using the Scanner class.
Learn the steps to convert an AAR file to a JAR file.
Learn how to use FileReader and BufferedReader and the differences between them.
Learn about Lombok’s @EqualsAndHashCode annotation, which generates the equals() and hashCode() methods for a class based on its fields.
Learn how to upload files using Selenium WebDriver.
Learn why we shouldn’t send HTTP GET requests with a body and understand the consequences of doing it.
Learn how to avoid exposing passwords by encoding them with the help of Spring Boot CLI.
Pattern matching and records patterns for Java 21, generational ZGC, Spring transactions, JSON views, low latency queues, and naming!
Learn various methods for finding the index of an array element using both Java’s built-in APIs and a third-party library.
Explore what kind of possibilities there are in JPA to store a list of strings of an entity.
Learn how to get a two-dimensional array that contains the combined RGB values for every pixel in an image in Java.
Learn how to set up a Selenium project and retrieve the value of an HTML input field from a web page.
Learn how to map boolean properties in the domain model using boolean converters added in Hibernate 6.
Java 20, adaptive GC for Quarkus, JFR event streaming, Java threading primitives, maintainable software, and HTTP stats codes!
Explore the differences between using the JAVA_HOME and PATH environment variables.
Learn learn how to use FlexyPool with Spring Boot and H2 using the HikariCP connection pool.
Explore different NLP libraries in Java and see how to implement some NLP tasks using Apache OpenNLP and Stanford CoreNLP.
Learn how to execute tests based on the active Spring profile using JUnit 5.
Another preview of Foreign Functions, Jakarta REST, Scala 3 annotations, Postgres power features, and Scalable Slack!
Learn how to configure a custom source directory for protobuf files.
Discover what Buffer Overflow is and the threats it poses to our system.
Learn how to check if a specified key exists in an Amazon S3 bucket using Java.
A quick and practical guide to getting all cached keys in the Caffeine Cache when used with Spring’s Cache.
Explore strategies for parsing multiple date formats at once.
Learn how to convert an integer value to hexadecimal in Java.
Explore the advantages of reusing a StringBuilder and explore a concrete example of how to do it.
Learn the difference between the classpath and the build path in Java.
Virtual threads in Java 21, Java profilers, a new build system for Java, auto-explain for Postgres, and Generative AI!
AWS Secrets Manager is a good place to store credentials for databases or other services. We look at how to provide our Spring Boot application with secrets from Secrets Manager at runtime.
Explore the difference between Java helper and utility classes
This article explains how to use Hibernate annotations @CreationTimestamp and @UpdateTimestamp to track the creation and update timestamps of an entity in a Java application using the Hibernate framework.
Learn how to estimate the value of pi using the Monte Carlo algorithm in Java.
Explore the fundamental principles of cloud-native development and the benefits of using Spring Cloud Azure Key Vault.
Increased GC throughput, writing a profiler from scratch, faster JVM startup, Java 20, and large language models!
Migrating to Hibernate 6, lots of new releases and sending billions of messages per minute, over TCP/IP. A good week 🙂
Learn how simple and complex SQL views differ from materialized views.
Explore the ways we can create parallel Streams from a Collection data source.
Learn about asText() and toString() methods for working with JSON data in Java.
Learn how to sett up SAML2 with Spring Boot.
Java 20 is out! Nuff said 🙂
AWS has released a library to help convert a Spring Boot application into an AWS Lambda. We look at how to use this library and how to deal with long cold start times.
Learn how to change the Swagger-UI URL prefix when using Springfox and how to set up the REST API documentation using OpenAPI 3.0 with redirections.
Java is evolving and growing up. We’re getting close to Java 20 🙂
Learn different ways of setting up a URL using Spring Cloud FeignClient.
Explore various approaches to setting Redis TTL via Spring Data Redis.
A comparison between the Java compiler and the Eclipse compiler.
A quick and practical guide to getting desktop path in Java.
String Interpolation in Java. Finally. And some profiler limitations.
Explore the advantages of IDD and an example of how to use it.
Learn how to use Feign to make POST API requests with form-url-encoded data in the request body.
Learn how to migrate a Spring Boot application to Spring Boot 3.
Java security API, Kotlin 2.0 compiler, testcontainers, web apps with Loom, safer refactorings, and write stuff down!
Project Panama aims to ease the interaction between Java and foreign (non-Java) APIs, i.e., native code written in C, C++, etc.
A quick and practical guide to excluding a transitive dependency from a Maven plugin.
Learn how to download a webpage in Java using Jsoup and HttpURLConnection.
Explore ways to copy the entries from one HashMap to another while preserving the existing entries of the target HashMap.
Spring 3 Native support, TSID with Hibernate, window functions in Hibernate, placing features in systems, and Human OS!
Learn different ways of extracting duplicate elements from a List in Java.
Learn about the roaring bitmap data structure, understand some of its operations, and see how it performs compared to BitSet.
Learn how to avoid cryptic Hibernate exceptions by properly escaping database keywords in column names.
A quick and practical comparison between varargs and arrays as input parameters.
Explore some extremely useful features available in the newer versions of Java. These features aren’t only easy to learn but can also be implemented quickly without much effort when planning to migrate from Java 8 to Java 17.
Looking for a Java Team Lead with integration experience to join the Baeldung team.
Explore examples of both java and javax packages and understand the key differences between them.
A quick and practical comparison between Class.forName() and Class.forName().newInstance()
Learn about Quarkus Funqy as a great addition that helps to run Java functions on the Serverless infrastructure.
Faster Image IO in Java 21, enhanced escape analysis, type-safe stream API queries, scalable media ML, and efficient one-on-ones!
Explore the differences between records and final classes in Java.
Learn how to convert a hex color code to an equivalent RGB value in Java.
Records in Hibernate, pattern matching, flexible Gradle, Java GC, and Stream Processing with Hazelcas.
A quick and practical guide to callback functions in Java.
Deploying microservices can lead to challenges in tracing requests across those services. With OpenTelemetry we’re able to capture logs from independent services and use them to observe traces of entire requests. We look at how to achieve this in Spring.
Looking for a Java Lead with Spring experience to join the Baeldung team.
Learn how to install and use the HTTPie CLI tool.
Learn about generating JMeter dashboard reports which are a more useful, efficient, and easy way to analyze data than mere text
Learn two different ways of reading PDF files in Java using the popular Apache PDFBox and iText libraries.
Fast Java 21, compact strings, static mocks, native GC for Quarkus, async stack trace, and non-vulnerable microservices!
Learn several ways to determine if an object or a class implements a specific interface.
Learn different ways for using a Stream as an Iterable.
Learn how to eliminate manual data setup in tests by auto-generating the data using Instancio.
Learn four ways to map JSON responses to a POJO class when using Java HttpClient.
Learn about structured concurrency capabilities in Java 19.
Safe native memory management with Java, scaling DAO layer in Spring apps, releasing to maven central, REST glory, and window functions in MySQL!
What’s the concept of AOT and how is applied in Spring 6 looking at pros and cons.
How to convert a byte array into a class which implements the Spring MultiPartFile interface.
Learn how to convert numbers from one base to another in Java.
Learn about the findFirst() and findTop() methods from Spring Data JPA.
Discover strategies to normalize lists of objects to strings in Java.
Explore how to accomplish batch processing of Stream data in Java using both native features and some third-party libraries.
A quick and practical comparison between lambda expressions and anonymous inner classes.
Kotlin 1.8, infinite memory with Java 20, DTO projections with Blaze persistence, API design patterns, and functional classes.
Project Panama update, Spring Boot CLI, GraalVM, Jakarta MVC, YugabyteDB pooling, and software maintenance!
Learn how to implement retry logic on a Kafka topic, including blocking and non-blocking approaches.
A brief comparison between class and instance methods in Java.
Learn the fundamental logging methods and configuration parameters of the tinylog 2 logging framework and understand how to issue log entries.
Learn how record patterns allow us to extract the values of a record into variables using pattern matching.
Learn how Spring Data JPA and JPA both work with some high-level overviews and code snippets.
MongoDB, Spring Modulith, liveness and startup probes for Spring Boot, Kafka on K8S, JVM debugging internals, and BigTable pagination in Java. Happy New Year 🙂
Learn how to use libraries from multiple repositories when working on a Gradle project and how to use GitHub Package Registry for authenticated repositories.
A quick and practical guide to comparing JAR files.
Learn about the NonUniqueResultException in Spring Data JPA and discover strategies to avoid it.
Learn how to add watermarks to generated PDF and to an existing PDF using iText.
Pattern matching, GraalVM into OpenJDK, transactional MDC, event sourcing, and Postgres as a Message Queue!
GraalVM in OpenJDK, entity listeners, MicroProfile 6.0, RabbitMQ vs Kafka, and data pipelines at scale!
A quick and practical guide to getting a value from JSONObject.
A quick and practical guide to reading and writing from a hash table data structure in a thread-safe way using the ConcurrentHashMap class.
Learn the differences between Callable and Supplier interfaces and understand when to use them.
Learn multiple techniques to sort the elements of a HashSet.
Learn two ways to extract an object’s value to be asserted on.
JMS enhancements, JakartaEE Serverless, revisiting DTO, Golang impressions, and new a K8S release!
Learn how characters are internally represented in Java and how we can convert an int to a char and back.
Learn alternatives to the traditional instanceof approach to improve code design and readability.
A Thread Group allows us to simulate a specific type of workflow. We can run Thread Groups in parallel, or sequentially. We look at how to achieve this in JMeter.
A quick and practical guide to reversing a Stack in Java.
A quick and practical guide to configuring date format with Apache Poi.
Learn what is a Java Functor.
Learn how we handle browser tabs with Selenium.
Panama improvements, fast Java startup in AWS lambda, Spring Boot error handling, TSID vs UUID, and dependency inversion!
Learn how to integrate CredHub with Spring Boot using the Spring CredHub library.
Explore the differences between errors and exceptions in the Java ecosystem.
Spring Boot 3, from 1RPS to 26RPS, caching effect, K8S secrets, and unusual stack traces!
Explore the topic of String interpolation in Java.
Take a closer look at these two static factory methods for immutable maps and explain which one is suitable for which purpose.
Explore all collection interfaces and collection classes in the Java library.
Learn how to create a serializable singleton class in Java.
Learn how to convert an instance of LocalDateTime to ZonedDateTime and vice versa.
Understand the purpose of the Optional class and learn how to use it efficiently to design clear and robust APIs.
Explore different approaches to finding the first non-repeating character in a string.
Spring 6, Quarkus Jakarta EE migration, Kotlin on RaspberryPi, REST API over database schema, and logical replication.
A quick and practical guide to BuildScripts Blocks in Gradle.
Looking for a Java Lead with Spring experience to join the Baeldung team.
Learn the different expression types available in Thymeleaf with examples.
Learn how to consume a REST service secured with HTTPS using Spring’s RestTemplate.
Learn different approaches for sorting collections by comparing multiple fields.
Spring 6 is finally out. Boot 3 is coming as well. Definitely a good week 🙂
A quick and practical guide to retrying with delay in RxJava.
Java does not provide an explicit way to iterate over two lists at the same time. We look at some techniques and libraries that can help us correlate data between two collections according to index.
Learn how to add a new element at a specific position to an ArrayList.
Explore the factory design pattern.
Learn the difference between a thread and an executor service having a single worker thread.
Learn the main features of @EnableMethodSecurity and how it replaces @EnableGlobalMethodSecurity.
Explore four approaches for removing all non-numeric characters from a Java String while keeping the decimal separator.
Explore the use of the Kong Ingress Controller to manage access to a Spring Boot application deployed on a K8s cluster.
Java thread deprecations, JPA locking, JVM logging, pattern matching, consistent caching at scale, and event sourcing!
Understand what causes the Selenium error “The path to the driver executable must be set by the webdriver.chrome.driver system property” and learn how to fix it.
A quick and practical guide to generating unique ObjectId in MongoDB.
Learn how to check if runnable objects are done.
Learn how to convert String to Instant with Java.
Explore the differences between Map and MultivaluedMap.
Java serialization, better VSCode for Java, JFR event streaming, functional programming issues, and standard errors for HTTP APIs.
Explore the LinkedHashSet data structure from the Java Collections library.
Explore the Spring framework’s extensive support for Groovy and learn how to create bean definitions using different approaches.
Normally a single assertion failure will stop a unit test. However, we can group assertions together, and report on their combined success or failure, using assertAll() within JUnit 5.
Java 19 improvements for collections and a new incarnation of switch in Java. Also, Spring Boot 3 and Spring 6 are even closer.
Learn how to enable a secure connection on a MySQL server.
Learn how to implement and use the factory pattern in Java.
Less footprint with Project Leyden, observability in Spring Boot 3, Hibernate 6 migration, high-performance java serialization, and logical replication!
Explore coupling in Java.
Kotlin Topic Developer
Explore what DataBufferLimitException is and how to fix it on both the server and client sides.
Learn how to upload files and JSON data when using Postman.
Sequenced collections, loom and spring, better Criteria API, Apache InLong, Zally, and API standardization.
Learn how to edit the content of an existing PDF file in Java.
Learn how to set TTL caching for Spring-based caching.
A quick and practical guide to port scanning in Java.
On using Spring MVC well, an interesting tool to migrate a Spring project to Boot and some testing goodness. A busy week, overall.
Learn the difference between Flux and Mono of the Reactor Core library.
Learn how to use HAProxy as an API Gateway for routing and rate limiting.
A quick and practical guide to writing a List of Strings into a text file.
Learn about variables in Postman.
Explore the difference between a List and a Set in Java.
A quick and practical guide to getting a URL attribute value in Thymeleaf.
Paving the on-ramp – definitely going to help people get started with Java
Learn how to validate a UUID string by using regular expressions or the static method of the UUID class.
Learn about the similarities and differences between the methods Paths.get() and Path.of().
Learn how to take char input using the Java Scanner.
Java 19 is here. Nuff said.
Learn how create your own BMI Calculator in Java.
Learn how to concatenate strings in Java.
Find out how TriFunction interface works for functional programming in Java.
Learn what fixed-size queues Java has to offer and how to create a new implementation.
Loomified Helidon, no object allocations, extent-local vars, Java 19/20, Postgres-compatible distributed database, and request waiting list.
Learn how to convert JSON to protobuf and vice versa.
JIT internals, project Loom, DTO/entity mapping, micro-batching, monolith to microservices, and object storage in K8S!
Learn how to find the Java release version for .class and jar files.
Learn how to find the solutions of a quadratic equation in Java.
Learn how to create multiple connections with Spring Data MongoDB.
Collections performance, null key/values, CORS, state of JVM languages, tornadoVM, and key-range partitioning!
Learn how to rebuild a container independently from the others with docker-compose.
We’ll demonstrate how to handle exceptions in Feign in a Spring Boot project.
All about the G1 collector this week. Oh, and Java 19 is close – less than a month away. Good summer 🙂
Learn how to write an API specification that returns two different objects for the same response code using Java and Swagger.
Java provides some helper functions for us to build List objects from arrays. We look at how they work and the capabilities and limitations of the resulting List objects.
How batch operation can increased insert performance.
Learn different configuration options we can use to debug a dockerized application in IntelliJ
Java bytecode, extent-local variables, CDC and transactional outbox pattern, test containers, and clock-bound wait in distributed systems!
Learn about the Integer.toString() and String.valueOf() methods.
Let’s look at a few strategies for handling errors received during OpenFeign requests.
Discover how to set up and call SOAP services through Postman.
Serial GC, MySQL batching, GraalVM update, sequenced collections, services in K8S, open APIs, and K8S 1.25!
Learn how to configure conditional dependencies in a Gradle project.
Learn a few techniques for getting the number of messages in a Kafka topic.
A quick and practical guide to replacing elements at a specific index in a Java ArrayList.
A quick and practical guide to dockerizing a Java application.
Parallel GC, DB sequences for Spring Data JDBC, multitenancy with Hibernate, feature flags, and durability in message queues!
A quick and practical guide to uploading images with Spring and Thymeleaf.
Learn how to get a stack trace using the Thread and Throwable classes
Learn about new features that come with Spring Boot 3 and Spring 6.
A quick and practical guide how to import Swagger APIs to Postman.
Learn how to use environment variables in Spring Boot’s application.properties.
Learn about scanning Java annotations at runtime.
Learn how to create a Spring Security configuration without using WebSecurityConfigureAdapter
A short article explaining the differences between static and instance instantiation.
Learn two methods from Collectors to retrieve the unique element which matches a certain predicate in a given stream of elements.
Storing monetary values, GraalVM enhancements, project Amber, backend for frontends, and predicting OOMs!
Learn methods of finding the differences between Git branches on Linux.
Learn how to use springdoc-openapi to define a default global security scheme and apply it as the default security requirement of the API.
A practical guide to solving Maven test running issues.
Hibernate UUIDs, Kotlin coroutines, max database connections, K8S native Java, and advocate vs educator!
Learn how the -source and -target options work in Java 8 and how they’ve evolved from Java 9 onwards
A quick and practical guide to modifying a git commit.
Learn how to validate an XML file against an XSD file.
A step by step guide to test the authentication of a Spring Boot app using Keycloak
Type inference in Java, JShell, GraalVM on build pipelines, tracing Spring apps, secure API gateway, and cloud-native GitOps!
Learn the advantages and disadvantages of using wildcard import statements in Java.
Learn how to clear a StringBuilder or StringBuffer in Java.
Learn how to package a Java program into a Jar and make them executable in Windows.
Learn three different approaches for instantiating multiple beans of the same class using Spring annotations.
The cost of logging, becoming an open-source committer, and a quick piece about why HTTP3 is fast. A quick and to-the-point week 🙂
Learn to use a UUID as an entity ID in MongoDB.
Learn the difference between form-data, raw and x-www-form-urlencoded request body types in Postman.
Learn how to use Java Streaming IO functions and the built-in Base64 class to load binary data as an InputStream and then convert it to a String.
Stateless sessions in Hibernate, calling native variadic functions, fetching collections in JPA, project Leyden, and hard stuff in computer science!
G1GC, data-oriented programming with project amber, Spring transactions, automated testing, and diversity of browser engines!
Learn how to create and add files to a JAR programatically.
Learn how to modify Git commit messages.
Understand the generate() and create() methods of the Flux API.
Learn to handle Spring Security Exceptions with @ExceptionHandler.
Learn about the default values of various heap and stack memory configuration options available for Java applications.
Learn how to set up a private Docker registry, and push/pull images.
JFR improvements, less footprint for Java, hibernate additions to Criteria API, the Flexcoin race condition, and product backlog.
Learn about the possibility of object destruction in Java.
Learn the differences between the parseInt() and valueOf() methods of the java.lang.Integer class in Java.
Why it’s not a good idea to test a private method and how to do it if it’s extremely necessary.
Java GCs, Project Panama, Spring Data JDBC, multiset vs joins, structured concurrency, and HTTP/3.
Learn how to disable the configuration put in place by the Spring Keycloak starter.
Learn multiple ways to mock a HttpServletRequest object when unit testing Servlet code in Java.
Take a closer look at the Java error “int cannot be dereferenced”, learn the leading cause of the exception, and see how to fix it.
Learn how a GraphQL field can be exposed with a different name.
Java 9 cleaners, structured concurrency in Java 19, definitely non-nullable types in Kotlin, native Java, and maxUnavailable for StatefulSets.
Learn how to sort a Java Collection by Date object in both ascending and descending modes.
Explore the difference in the behavior of current and thread class loaders in Java.
Learn how to play sound two ways using the Java Sound API
OpenFeign is a library that helps us build clients to web services by expressing the contract in a Java interface. We look at how to include header values in our requests through the interface, with fixed and dynamic values, and how to handle cross-cutting concerns like authorization by using interceptors.
Static images for Java, C2 visualization, gazillion threads, Spring Boot 3.0, Java 9 cleaners, and oversized data in Postgres.
Learn how to configure a timeout using the new Java HTTP Client to handle requests when timeouts overflow.
Explore the basic difference between git merge and git rebase which every developer should know while working with git VCS.
Learn how to use @RequestLine annotation in Feign client.
Learn different ways to get a domain name from a given URL in Java.
Structured Concurrency, destructing patterns for Records, a JVM crash story, gRPC probes, and index scans in Postgres!
Learn how to search for files using wildcard patterns in Java
A comparison between Apache ActiveMQ and Kafka.
Learn how to use the useDelimiter method of the Scanner class.
Learn three different ways to convert a JDBC ResultSet to a JSON object.
Learn how to reverse a number using a mathematical approach in Java.
Hunting down a JVM crash, loom first-take, reactive architectures, more of Hibernate 6, new Transaction API in Quarkus and public-key cryptography.
Explore the usage of Iterable and Iterator interfaces in Java and understand the differences between them.
Learn how to use the Java HttpClient to connect to HTTPS URLs and also find out how to bypass certificate verification in non-production environments.
A comparison between Criteria Query, JPQL, and HQL Query.
Learn the differences between set() and lazySet() methods of atomic classes in Java and understand when to use which method.
Project loom in Java 19, ZGC in Java 18, empty finalize, cloud-native Micronaut, symmetric cryptography, and K8S 1.24.
Learn how to swap two variables in Java, depending on the type of the variables.
We can use the javac tool to compile source files in Java. We look at how to use it for multiple source files and how to control which libraries are included and where the compiled code will be written.
A quick and practical guide to finding all custom-annotated beans in Spring.
A practical guide to GraphQL error handling with Spring Boot.
A quick and practical guide to Java Scanner’s skip() method.
Pattern matching 3rd preview, list in Hibernate 6, custom JFR events, splitting tests in Gradle, and chopping the monolith!
Local and remote Gradle build cache and how to clear them.
Learn about the Illegal Character Compilation Error and how to avoid it.
Looking for a Java Dev with integration experience to join the Baeldung team.
A collection of tutorials on Spring
Learn various methods to retrieve the local and public IP addresses of the current machine using Java.
Learn three different techniques to return a Map object from a GraphQL query.
Native Java on K8S, switch expressions, cloud-native with Quarkus, Hibernate SQM, and ML pipelines at scale!
Learn about storing HashMaps inside a List in Java.
Learn to look for patterns in a string of text in Java.
Learn how to check the connection of the MongoDB server with different real-time cases.
Learn how to configure the Java HttpClient for basic authentication and how it works.
Explore a support system provided by Spring to facilitate Spring Boot upgrades
When using collections in Java it’s conventional to use the interface types for our variables and fields, rather than the concrete types. We look at the difference between these two approaches.
A quick and practical comparison between the implements and extends keywords in Java.
While Spring’s service discovery mechanisms can be very helpful we may wish to turn them off in certain environments. We look at how to achieve this with both properties files and Spring profiles.
Testcontainers, Project Panama, zoned date-times in Hibernate 6, Spring RCE, CRDTs, and changes in K8S 1.24!
Comparison between Liquibase and Flyway.
Learn how to use projections in Spring Data MongoDB to restrict the fields that are returned from a query
A quick and practical guide to hiding a request field in Swagger UI.
Learn the different types of BootstrapMode for JPA repositories.
Explore JPA Buddy and its main features and see how we can use them during the application development cycle.
Learn about some common command-line compile errors in Java.
Spring RCE, JavaDoc Snippets, native Java, update on Project Loom, value classes, and automated tests!
We can use JMeter to load test endpoints with Basic Authentication in a few different ways. We look at the simplest method of adding credentials directly to a header, along with how to provide a set of credentials from a data source.
How to solve “variable might not have been initialized” in Java.
Learn how to retrieve the value by key name in MongoDB.
Spring with Java 17 baseline, simple web server, test containers, AOT in Spring 6, ZGC, and the age of APIs!
Learn how to perform bulk operations in MongoDB using different kinds of write operations.
Learn how to perform upsert operations with various update methods of MongoDB.
Learn how to enable a debug logging level for Spring Data MongoDB
Learn all about the the for-each loop in Java – its syntax, benefits and drawbacks, and examples.
Java 18 is here, composite ids in JPA, Java language evolution, security features in Java 18, error handling, and a better hiring process!
Learn how to import data to MongoDB from JSON files
Learn the different ways of counting the number of rows of a JDBC ResultSet.
Learn how to configure SSO with Apache Tomcat.
Learn how to use Spring Data MongoDB’s @DBRef annotation to connect related documents.
Java 18 GC improvements, cooperative thread interruptions, best practices for Java projects, feature flags, and scaling bottleneck.
Learn how to insert documents into an array in MongoDB.
Learn what Data Transfer Object (DTO), Value Object (VO), Plain Old Java Object (POJO), and JavaBeans are. Understand the differences between them and when to use each type.
Understand what an automorphic number is and learn a couple of approaches in Java to determine if a number is automorphic.
A quick and practical guide to long to int conversion in Java.
Learn how to use Nginx as a forward proxy for any requested location.
Learn how to apply multiple operations together in a single MongoDB query.
Learn how to modify the Swagger API response to deliver a list of objects.
Learn how we can get a lock on a specific key to prevent concurrent actions on that key without impeding actions on other keys
Learn how to authenticate a user using Spring Security and MongoDB
Reconsidering DTOs, Spring Shell, Cloud CVEs, technical debts, and how we found dirty pipe vulnerability!
Explore various ways to check the existence of a collection using the MongoDatabase and DB class methods.
Learn to retrieve the original message from Feign ErrorDecoder.
Explore various ways to update the documents in MongoDB.
Learn how Java Garbage Collection works.
It’s all about the future: Java 18 & 19, Hibernate 6 features, Groovy 4, Kotlin 1.6.2, permitted sealed classes, and API evolution.
Explore various ways to update multiple fields of a document in MongoDB.
Learn what a Maven artifact is and get an understanding of coordinates, dependency management, and repositories.
Learn the differences between the —assume-unchanged and —skip-worktree options of Git’s update-index command.
Learn how to use Java’s built-in classes, third-party libraries, and a custom implementation to create an Entry object in a Map.
Learn about artifact classifiers in Maven and understand the various scenarios where they are useful.
Spring Data 3.0, avoiding stringly typed Kotlin, ID generation in JPA, dockershim removal, and quantum computing.
Learn how to use Servlets and JSPs to ensure a user is authenticated and has started a valid session before accessing any resources.
Explore some examples of missing return statements in Java.
Leran how to modify the Spring Security logging level
A quick and practical guide to Producer-Consumer problem in Java.
Learn different options to invert a Map in Java.
GraphQL and REST can be used to enable the same integrations between different parts of our systems. We compare the two approaches to see how they have benefits in different situations.
Looking for a Java Dev with Spring experience to join the Baeldung team.
Learn how to create empty maps in Java
Learn how to configure URL security access.
Learn how to document enum in Swagger using the Maven plugin and verify the generated JSON document in the Swagger editor.
Learn about an error that would cause a NullPointerException when we unintentionally mix Spring injection with objects we create by calling their constructors.
Configurable card tables in Java GCs, Meet System Logger, configuring Spring Boot apps, serializability in practice, and 12-factor apps!
Understand the difference between sourceCompatiblity and targetCompatibility Gradle parameters.
Learn the reasons for the error: “java.security.InvalidAlgorithmParameterException: trustAnchors parameter must be non-empty” and how to fix it
Learn how to configure multiple data sources with Spring Boot.
ForkJoinPool and parallelism, Embeddable in Hibernate 6, Java annotations, AWS in IntelliJ, free K8S cluster, and ML meet BigQuery!
Learn what causes ArrayIndexOutOfBoundsException in Java and common techniques to avoid it.
An example of Zuul filter creation.
Learn how to use Swagger annotations to make documentation more descriptive and readable.
When using the Java constraints library, it’s easy to make a mistake with an annotation and only find out about it at runtime. We look at the available annotation processor and how it can give us early feedback.
Learn how to print thread info using Log4j2
Learn how to get current trace and span ID in Spring Cloud Sleuth.
From the next version of Maven, through measuring parallelism and all the way to core Agile principles. An interesting week.
Learn how to use the Domain Graph Service (DGS) Framework from Netflix to build a simple Spring Boot GraphQL service in Java.
Learn about MongoDB document IDs and how to retrieve the ID of a document we just inserted in a collection via a Java program.
A comparison between the @see and @link Javadoc annotations.
GraalVM release, composition vs inheritance in JPA, Gradle plugins, finding performance regressions at scale, and beautiful technical debt.
Learn how to modify the font style of cells in a Microsoft Excel document
Learn how to add a handler event to a button for a JavaFX interface.
Understand Java IO functionalities and how they changed throughout different Java versions.
Learn how to test an LDAP server using a Java client
Learn how to access the EntityManager directly when working on a Spring Data application.
Learn how to use IdentityHashMap in Java
A quick and practical guide to generating a secure AES key in Java.
Revisiting transactional, dynamic, and partial updates, JPA flush modes, Kafka vs Chronicle, and the real cost of attrition!
Learn about the Cassandra batch query and how to apply it in Cqlsh and Java using BatchStatement.
Sometimes we need our unit tests to be able to access the name JUnit has allocated to them. This is especially useful when using name generators or parameterized tests. We look at how to solve this problem in both JUnit 4 and 5.
Learn how to convert a Maven build to a Gradle build.
In this article, we’ll learn to find all the jars containing a particular class.
A quick and practical guide to Java 15’s Hidden Classes.
Learn all about the InstantSource interface introduced in Java 17. Understand what problems it addresses, and how to use it.
All about distributed systems: fault tolerant JVM, circuit breaker for RestTemplate, tracing in Spring Boot and replicated log. Also, catching errors in Java and risk of micro-dependencies!
TestNG is a unit testing library which can be run via the IDE and build tooling. We look at how to run TestNG tests directly with the command line.
Producing a string out of repeating a character or sequence can be done a variety of ways. We look at a few methods, and compare them for readability and efficiency.
A quick and practical guide to Java SequenceInputStream class.
Learn how to test a REST service that uses Keycloak for authentication and authorization with Swagger UI
Happy New Year 🙂 An interesting set of articles this week, from HTTP to persistence optimization and some Dilbert.
Learn the differences between the equals() and the contentEquals() methods of the String class in Java using practical examples.
Learn why we see an unknown source in our Java exception stack trace and how can we fix it.
Learn about the history of Java.
A quick and practical tutorial to embedding code samples in JavaDoc comments.
Learn why declaring a shared variable as volatile does not always guarantee thread-safety.
A quick and practical overview of replication strategies in Cassandra.
Learn why Maven might use a different version of Java than the default one set in the system
State of Valhalla, Quarkus 2.6, Native Spring, new coroutine release, Qodana code quality, and the holy grail of keyboard layouts! A good way to end the year 🙂
Learn to set a Thread name in Java.
Learn how to remove large files from the commit history of a git repository using various tools.
Learn how to format numeric cells in Excel using Apache POI
Learn how Cassandra stores data in a partitioned row store and how this differs from a column-oriented data store.
Kotlin extension and delegations, Spring Boot 2.6, custom JPA repositories, open-source dilemma, and microservices vs monoliths!
Learn how to create, edit and run self-contained source-only or binary Java programs with ease using JBang.
Learn how to detect duplicate dependencies in Maven using the mvn dependency:tree and mvn dependency:analyze-duplicate commands.
Learn different configurations and setups that can help decrease Spring Boot startup time.
Learn how to use HTTPS Client Certificate Authentication in Java
All about log4j RCE exploit, Spring Boot remedies for log4j, building native images in Quarkus, and a new AWS region in Jakarta.
Learn various ways to search enums in Java.
Learn about Java’s “implicit super constructor is undefined” error and how to resolve it
Learn how to make copies of immutable objects with changes to only a single property using Lombok.
Learn how to generate a PDF document from an OpenAPI Swagger definition using Maven plugins and the online Swagger To PDF tool.
Migrating to Java 17, i18n in Spring Boot, naming strategies in Hibernate 5, simple web server, and fully-managed load testing on Azure. Good stuff as we’re getting closer to 2022.
Learn how to access different cell values using Apache POI.
We may need to test whether the binary digits of a number are set. We explore how to do this for any digit in an integer, using some optimised binary maths as well as some simpler alternatives.
Apache POI allows us to build Excel spreadsheets from Java code. In this tutorial we look at the steps for adding images to our spreadsheets.
A quick and practical guide to ByteBuffer -> String conversion in Java.
Learn which ports are opened by JMX on startup
Modeling relations in Mongo, Java performance tips, new features in Java, warming caches at Netflix’s scale and reimagining software architecures!
Learn various approaches to avoid null String objects while concatenating Strings in Java.
In this tutorial, we’re going to showcase the causes and resolutions of the HTTP response code 415 Unsupported MediaType for POST requests in a Spring Application.
In this article, we’ll learn the difference between bean discovery in Quarkus and classic Jakarta EE environments.
Java bridger, GC improvements in Java, Kotlin 1.6, native images, hashing in Java, full-stack Spring Boot, and K8S operators!
Learn how to test a Cassandra database slice of a Spring Boot application using the Spring @DataCassandraTest annotation.
Learn how to import a Maven project into Eclipse.
Learn different ways to read key names from JSON content.
Explore how to generate a variety of cell borders using CellRangeAddress, RegionUtil, BorderStyles, and IndexedColors classes.
Learn how to use Lombok’s val and var to define local variables without specifying the type.
Learn how to skip the generation of individual getters and setters when using Lombok annotations.
Learn how to work with the HMAC algorithm in Java.
Large objects and GC in Java 18, new API in project loom, native images for Spring Boot, AWS MemoryDB, and building an startup!
Learn how to change the cell background color in Excel using Apache POI.
A quick and practical guide to using constructors in abstract classes.
Learn various approaches for ignoring commas in quotes when splitting a comma-separated String.
In this tutorial, we’ll take a look at common issues we might encounter when issuing SSL requests.
In this article, we’ll explain how Spring WebFlux interacts with @Cacheable annotation
We may need to write assertions on Optional values. We explore a few ways to do this, both with JUnit assertions and with the AssertJ library.
Learn how to use the Spring OncePerRequestFilter to ensure your filter code is executed only once for each request.
Bulk updates in Spring Data JPA, Java HTTP Clients, Hibernate Reactive, feature flags in Spring Boot, and non-root containers in K8S!
Learn about the job of a snitch and how Cassandra uses it to efficiently route requests.
Explore different solutions for checking if the first letter is uppercase.
Learn how to create, compare, update and flatten a nested HashMap.
Learn different techniques to list all classes loaded in the JVM
Learn how to use an Initialization Vector (IV) with encryption algorithms and the best practices while using the IV
Learn two approaches to split a String only on the first occurrence of a delimiter in Java.
Learn about validating serializable objects in Java.
In this article, we’ll talk about the news related to the new version of the Java ecosystem, Java SE 17 – the new features and the changes in its release process, LTS support, and licenses.
Learn what GC roots are and their usage in the garbage collection process
Learn how easy it is to convert between bytes and hexadecimal strings with the updated HexFormat class in Java 17.
Finalizer deprecation, string improvements in Java 17, Kotlin support in protocol buffers, cache libraries on JVM, and software engineering principles.
Learn different options for splitting an input string by multiple delimiters using regular expressions, Google Guava, and Apache Commons
Learn about Java 9’s new command-line compiler option –release, what it does and how to use it.
Learn different approaches for removing the beginning and ending double quotes from a String in Java.
Hibernate Reactive goes GA, caching, Record serialization, no more Dockerfiles with Paketo, and embracing mob programming!
Learn how to add multiline text to a cell using Apache POI.
Learn how to use the keySet(), entrySet() and values() methods of the Map interface in Java.
Learn how to get the character at a given position of a String in Java.
Serialization filters, cold starts in JVM, faster charset encoding, simple web server, JDBC caching, and specialized kube-proxies!
In this article, we’ll cover how to execute parallel unit tests using JUnit 5.
This article explains what Unicode text normalization is, how to remove accents and diacritical marks in text, and the pitfalls to watch out for.
A quick and practical guide to formatting Swagger descriptions.
Learn different ways to remove an entry from a Java HashMap.
Explore different approaches to convert a byte array to a numeric value and vice versa in Java.
Learn how to use a prefix for environment variables with Spring Boot.
Faster Maven builds (always good), how SREs scale in an org, and a cool Datadog feature. A solid week overall.
Explore practical use cases for the fail assertion in JUnit.
Learn how to get a field’s annotations and how the retention meta-annotation works
Learn several methods for updating the value associated with a HashMap key using core Java.
Learn how to create an OkHttpClient and configure it to trust all certificates — not the best practice in production, but you may need it from time to time during development or testing.
Learn about the frozen keyword in Apache Cassandra and how to create frozen collections and user-defined types.
A practical comparison between Spring Boot and Quarkus, with a focus on performance.
In this tutorial, we’re going to consider the usage of the Maven WAR plugin with a Java EE application.
Learn how to define a proper CascadeType to solve the “org.hibernate.TransientObjectException: object references an unsaved transient instance” error
ZGC is even better in Java 17, faster Maven builds, BGP and Facebook, pattern matching future, and economy of code ownership!
Learn how to implement error handling in gRPC for unary and stream-based RPC calls.
Learn how to use custom classes as keys in Maps in Java.
A quick and practical overview of getting the last word of a String in Java.
A quick and practical overview of converting Long to String in Java.
Explore Spring Security’s protection against malicious URLs that may cause the Path Traversal/Directory Traversal attacks.
Spring configurations, Java 18 snippets, Spring 6, Micronaut 3.0, Netflix’s media packaging, and atomic habits for software engineers!
Learn how to create references to method parameters in Javadoc.
Learn possible solutions to skip running tests from base test classes in JUnit 4
Learn how to validate email addresses in Java using regular expressions.
A quick and practical guide to deriving a submap from a HashMap in Java.
Learn about consistency levels in Cassandra.
GC improvements in Java 17, better Foreign Memory API, Spring Boot scheduling, javac Trees, A/B testing at Netflix, and more from K8S 1.22.
A quick and practical guide to gRPC streaming in Java.
Learn the safest way to undo or revert commits in a Git repository.
Learn how to capture microphone input and save it to a file.
Learn the similarities and differences of Maven’s dependencyManagement and dependencies tags
If the package name of a java file does not match its location on the file system, we’ll get an error. We look at a few common causes for this and how to fix it.
Learn how to convert HTML to PDF in Java using OpenPDF and Flying Saucer or using the Open HTML to PDF library, with a little help from Jsoup.
Learn how to collect Stream elements into a List in different versions of Java, and the pros and cons of the approaches.
A quick and practical guide to listing all JVM threads.
A quick and practical guide to configuring different Log4j2 configs per Spring profile.
Java 17 is released, more LTS versions for Java, Java modules, Spring without annotation, Netflix’s API Gateway, and exotic timezones!
Learn about Thread priority values in Java, how to set them, and how the Java scheduler uses them to prioritize threads to execute.
Learn about the implementation and performance of System.arraycopy() and Arrays.copyOf()
A quick and practical guide to the new Stream.mapMulti method in Java.
Learn how to create a Java class from a JSON object using the jsonschema2pojo library
Ready for Java 17? Spring baselining on Java 17, migration tips, and IntelliJ support. Also, more efficient gRPC, 10 years of Kotlin, and simplifying hard tasks!
Learn why and how to enable unlimited strength cryptography in different versions of Java.
Learn about the Parent POM resolution of Maven.
In this article, we’ll cover the basics of database schemas, why we need them, and how they are useful. After that, we’ll focus on practical examples of setting schema in JDBC with PostgreSQL as a database.
We can find the address of a client connected to our application by using the APIs within the java.net package. We look at establishing a TCP socket and understanding its properties.
Explore what a detached HEAD in Git is and how it works.
In this tutorial, we’ll focus on the @version and @since tags in Javadoc.
In this article, we’ll create an application with WebSocket and test it using Postman.
Plans for Spring 6.0, structured logging, subtleties of soft-deletion in Hibernate, event-sourcing at Netflix, GCToolkit from Microsoft, and beautiful Powershell!
Learn how to use Java’s Duration, TimeUnit, and third-party libraries to format a duration to a specific format
Explore the definition of the DTO Pattern and its reason for existing, and how to implement it.
Micronaut 3 is released, Spring IoC, source code snippets in Java 18, panache repository pattern, filtering out syscalls in K8S, and climate change!
Learn how to use Gradle in offline mode, whether you’re working from the command line, IntelliJ IDEA, or Eclipse.
In this tutorial, we’ll see how to implement Kafka default format converters and custom serializers for specific use cases.
Learn how a partition key, composite key, and clustering key form a primary key and also how they differ
Learn how to run JUnit 5 tests directly from the command line with and without Maven
Explore a way to show custom items in JavaFX ListView.
Learn how to deploy a Java WAR file in a Docker container using the official Tomcat Docker image
Learn different ways to change the default location of the Log4j2 configuration file in Spring Boot.
A cool interview with Java architects, Vector API, getting the most out of Hibernate, K8S with more windows, and continuous configuration with AWS!
A quick and practical guide to comparing the contents of two files in Java.
To simulate user activity, we often need to add timing to our JMeter configuration. We explore how to build a test plan with gaps between actions.
Java 16 new features, reflection meets method handles, active record panache, gateway pattern, and swapping in K8S.
Learn about throwing exceptions in a constructor.
A quick and practical guide to hosting Maven repositories on GitHub.
Learn some reasons for this limitation and look under the hood of the JVM to explain it better
Project Loom vs Reactive Programming, GraalVM improvements, Spring Data Projections, feature parity pattern, and a new K8S release!
Learn about the differences between the MVC and MVP Patterns.
A quick and practical guide to working with password-protected ZIP files in Java.
Explore situations when EntityNotFoundException occurs and solutions to handle it.
In this short article, we’ll go through how to configure Maven properties default values, and how to use them.
A quick and practical guide to calling SOAP WebServices from the command line.
Learn how to use Javadoc to link to external urls.
Java’s 6-month cadence dilemma, Panache versatility, retrying with Resilience4j, testing in Spring Boot, and a new major Cassandra version.
Learn about some of the different data types of the Apache Cassandra database.
Learn how to check if an IP address is in a given range in Java.
Tunneling to Rust from Java, RabbitMQ streams, fewer releases for K8S, and why agile transformation fails!
Explore the pros and cons of using getters and setters in Java.
A quick and practical guide to @SuprressWarnings and its parameters.
Camel case text conversion can be achieved by using regular expressions, or via some library functions. We look at a couple of implementations we can add to our own code, and a couple of examples from libraries.
Learn about Guava’s support in async programming: Futures and ListenableFuture
A quick and practical guide to creating self-signed certificates with OpenSSL.
Quarkus and Hibernate, Kotlin internal, the road to K8S 1.22, Elasticsearch meets Amsterdam, and the messy IoT world!
Learn to write log data to Syslog using Log4j2 and Spring Boot.
Learn about the implementation details of the BigInteger class in Java.
Learn how to configure additional source directories in Maven.
Learn to convert a String to a BigInteger in Java.
Quarkus 2.0, GraphQL meets Spring, experimenting with GitHub’s copilot, read-only hints for Hibernate, and uncovering better ways for working!
Learn how to use Collector.groupingBy() to group the equal objects.
In this article, we’ll understand why the java.lang.NoClassDefFoundError occurs in JUnit and how to fix it.
A quick and practical explanation of how to send large messages with Kafka.
Learn what causes the compiler error “code too large”, along with situations where we might encounter it and what we can do to fix it.
Learn several approaches for serializing Java objects using third-party libraries or core Java’s built-in serialization API.
Learn when and why to use the Serializable interface in JPA entities according to the JPA specification.
Learn alternatives to the deprecated description attribute with Swagger 2 and OpenAPI 3.
Busy week for Spring projects, Hibernate physical naming strategy, Spring-ified ElastiCache, clocks in distributed systems, and Istio to the rescue!
Learn how to enable logging for the Apache HttpClient.
A practical comparison of various UUID generation methods in Java.
Learn about private constructors in Java.
Learn how to run a Selenium script using JMeter.
Explore the basic components of Cassandra’s architecture.
Java supports two variations of OR with different operator precedence and runtime behaviour. We explore how logical OR short-circuits and how bitwise OR applies to numbers and boolean values.
Learn how to check the number of threads created by a Java process.
Going from imperative to the reactive paradigm, web standards, and the future of the internet. Good stuff.
Learn about the differences between JPA and JDBC.
Learn how to use Java DocLint to analyze your Javadoc.
Learn about Monod.defer() and how it is related to lazy and eager evaluation.
Learn about the timeout exceptions of Java socket programming
In this short tutorial, we’ll look at how we can pass arguments to Maven using the command line.
New Boot and Java goodness – things are certainly moving fast. And our last COVID launch started yesterday.
A guide to the
Wire Tap Enterprise Integration Pattern (EIP)
Learn how to set and use the max-http-header-size property in a Spring Boot 2.x application.
Learn to reference a method in Javadoc comments.
Learn how to use the PatternLayout feature to mask sensitive data in application logs with Logback
Learn about the differences between the File and Path classes in Java.
An overview of the JPA plugins available for IntelliJ and Eclipse
Explore how to use non-capturing groups in Java Regular Expressions
JFR mirror events, testing RSocket, deep dive in SQL execution plans, eBPF at Netflix, and space exploration with AWS!
Learn how we can add local JAR files to our Gradle dependencies.
Learn how to store null values in a database using plain JDBC.
When using regular expressions in Java, sometimes we need to match regex patterns in their literal form – without processing any metacharacters. Let’s find out how we can do that.
A quick and practical introduction to service layer validation in Spring.
Learn why the Log4j warning, “No appenders could be found for logger” occurs and how to resolve it, both in configuration and in Java code.
Safe natives in Java, secure microservices with Spring Security, continuous testing in Quarkus, AWS timeseries, and different test levels!
Learn how Kafka Streams simplify the processing operations when retrieving messages from Kafka topics.
Learn how to define unique constraints on entity classes in JPA and Hibernate.
Learn how to find all classes in a Java package at runtime.
A quick and practical introduction to secret key and string conversion in Java.
Spring Boot 2.5 is released, large pages on JVM, hacking JVM, mapMulti for streams, project loom, and a service-oriented language!
Learn how we can download email attachments using the JavaMail API
Learn about the maximum size of Java arrays.
Learn about the java.lang.IllegalAccessError.
Learn about the @AliasFor annotation in the Spring Framework.
Learn how to use Google Guava, the popular Java open-source library of common utilities
Kafka without ZooKeeper in action, type patterns in Java 17, JFR streaming, JPA entity graph, and applying ML to DevOps issues!
Learn how to print messages to the console or to a file during a Maven build using various plugins.
Physically deleting data from a table is usual when interacting with databases. But sometimes there are business requirements to not permanently delete data from the database. In this tutorial, we’ll learn about soft delete and how to implement this technique with Spring JPA.
Explore multiple methods to convert String to BigDecimal values.
Learn how to create a strategy interacting with a crypto exchange and test it against historical data.
Learn how to use @AttributeOverride to change a column mapping
Learn how to split a string in such a way that the delimiters are part of the result
Compare the Java servlet Filter and the Spring MVC HandlerInterceptor and learn when one might be preferable over the other
A guide to measuring code coverage using SonarQube and JaCoCo.
In this tutorial, we’ll discuss how we can handle auto-generated ids with JPA.
Learn how to copy a source file to a destination using three different Maven plugins.
Learn the differences between HTTP POST and PUT methods and when to use each in a RESTful API.
Non-blocking networking with Project Loom, teeing collector, Spring and AWS SQS, Kotlin 1.5, and strong consistency in AWS S3!
Learn when to use an interface and when to use an abstract class in Java.
Learn to find the Java version at runtime.
Learn how to fix the NoSuchMethodError and NoClassDefFoundError JUnit errors
Learn to convert a Mono of a collection to Flux of the collection’s items.
Superior Java records, Kotlin 1.5, code examples in Javadoc, stream collector, Spring Cloud Gateway meets K8S, indexing JSON columns, and COIVD predictions!
Learn how to convert certificates and private keys from a Java KeyStore into PEM format using keytool and openssl.
Backward compatibility and Javac, Micronaut hipster, faster Graal, life after SecurityManager, API gateway in K8S, and Bitcoin’s energy problem!
Learn about CDC using Debezium and Java.
Learn to convert an array of primitives to an array of objects.
Learn how to write trace logging output when calling methods of configured classes using AspectJ.
Learn how to configure timeout settings for our WebClient using Spring Webflux.
Spring Data improvements, more from project Panama, delegation in Kotlin, deprecating security manager, clustered indices, and indexed jobs in K8S!
Learn about Java’s InterruptedException, what causes it, and how to handle it.
Learn different ways to split a Java String by newline characters
Learn about the package-info.java file, what its purpose is, and how we can use it to specify package-level Javadocs and annotations.
Learn how to build a simple Spring application to demonstrate how to display various types of errors in Thymeleaf.
Learn about different Spring bean naming strategies.
In this short tutorial, we’re going to implement a utility method for converting Enumeration objects to the Java Stream API
A busy week for the Spring team, new JMC version, Microsoft loves OpenJDK, CronJobs on K8S, and introducing weakness-oriented hiring!
Learn about the two main design patterns for fetching and how they relate to the @LazyCollection annotation in Hibernate
Microsoft’s OpenJDK, serializing records, rate-limiting with Spring, vector API, PodSecurityPolicy deprecation in K8S, and capturing two dimensions of time!
Learn how to set up TLS in Spring.
In this tutorial, we’ll explain what it is and how to apply backpressure mechanism in Spring WebFlux to mitigate it.
Join the Baeldung editorial team.
Learn how to build a web application with Spring Boot and JSP.
Pattern matching meets switch expressions, working with lazy relationships, Spring Boot for serverless, the road to Kotlin 1.5 and Java 17, and tips for working from home!
Learn how to generate a Spring-based server stub from a YAML specification using the OpenAPI generator’s Maven plugin.
Understand autogenerated class naming conventions in Java.
Learn different ways to perform a record count with jOOQ.
Primitive objects, more performant ZGC, trying Spring native, more secure Java 16, concurrency control approaches, and 15 years of S3.
A series of tutorials on reactive programming support in Spring
Java 16 is released, official native images for Spring, backpressure, Jetty HTTP load generator, GitHub actions, and say no to SOLID!
Learn to find all endpoints for a Spring Boot REST application.
In this short tutorial, we’ll explore ways to clear our local Maven cache.
Learn how to use the Spring Security OAuth Authorization Server.
On Java 16 and beyond: Records, Vector API, Unix domain sockets, UTF-8 everything, and Project Valhalla. Also, slow queries with Hibernate, and Kind over minikube!
Explore a few strategies to purge data from an Apache Kafka topic
Deserialization events in JFR, more efficient G1, native images, Scala 3, pattern matching for primitives, merge join algorithm, and effective communication.
We sometimes need to access private methods from our code, especially our test code. In this tutorial we cover a couple of ways to make private methods accessible.
Learn how to inser a new row between two rows in an Excel file using the Apache POI library
Let’s see how we can convert java.util.Properties into a HashMap
Streaming options, initializing testcontainers, faster charset decoding, DDD in Java, GraphQL microservices, and recipes for being an enabler manager!
Learn about the storage area for String constant pool.
While we want to modularise our maven file to avoid repetition, sometimes it’s necessary to provide specific variations for child modules. Here we explain how the various tiers of a maven file can be combined.
Learn how to configure time-based message retention properties for Kafka topics
Maven central security, breaking a monolith, quarkus testing, more efficient Md5, introducing latency in SQL queries, and chaos engineering!
Learn how to implement a Multipart File upload using OpenFeign.
When writing a web service in Spring we need to create a custom filter in order to protect our services from cross-site scripting attacks. We explore how to achieve this using ESAPI and Jsoup.
Java 16 goes RC1, Unix-domain sockets, native images, jOOQ internals, metrics meets open tracing, joining tables with a hash-join algorithm, and having more effective meetings!
In this article, we’ll see the significance of the load factor in Java’s HashMap and how it affects the map’s performance.
Experimenting with Unix-domain sockets, more randomness, Java on Java, vectorization, the benefits of pull requests, and the story of Netflix’s homepage!
Learn how to add another button to the same form in a Spring MVC application that maps to the same RequestMapping on the controller.
We often use maps to store a collection of key-value pairs. We explore the Entry objects inside a map and how to make the most of them.
Java turns 25, interview with Brian Goetz, scalable batching processing, more pattern matching, foreign memory access, idempotent consumers, and latency numbers for teams!
Learn about the constant pool in JVM.
Learn how some core libraries in Java have adopted the seven core structural design patterns
Run Java on Java, reactive JAX-RS, inline and primitive objects, Java 17 new additions, state watch pattern, and guidelines for pair programming!
Learn how to analyze thread dumps to efficiently diagnose performance issues. Also, we’ll learn to detect bottlenecks or even simple bugs.
In this tutorial, we’ll learn how to convert a Hibernate proxy to a real entity object
Learn how to evaluate math expressions expressed in String format in Java using exp4j, Javaluator, and the Java Scripting API.
Pattern matching and guards, fat JARs, Reactive Hibernate, HTTP clients and Project Reactor, timed leasing for distributed systems, and when to say No!
Finding if an integer’s square root is also an integer is an interesting subject. Let’s look at some techniques we can use.
To make our code portable between operating systems, we need to handle the directory and path separator characters correctly. We look at a few ways that Java can help use the correct characters for the host operating system.
An OpenJDK with JWarmup and coroutines, pattern matching for arrays, JVM performance rabbit hole, distributed metadata management, and a more effective developer experience!
Explore the purpose of each technology, its lifecycle, and prominent features.
A series of tutorials on the core features of JPA and Hibernate.
Explore the new features implemented in Java 12.
Learn how to use a Docker environment to cover the fundamentals of data modeling for a system that uses Apache Kafka for message processing.
Millions of virtual threads, virtual thread pools, GraalVM meets COBOL, Intellij on M1, Telemetry and Protobuf, and Spec updates for Java 16!
Understand the difference between the isAlphabetic() and isLetter() methods of the Java Character class.
Virtual threads in Helidon, Out of native memory, circuit breakers, testing HTTP clients, container security, and all benchmarks are wrong!
Learn the differences between Collections.synchronizedMap and ConcurrentHashMap.
Learn how to configure the serialization and deserialization options for Jackson using Spring Boot.
Explore various JEPs of Java 14.
The one with performance: HotSpot JVM intrinsics, AppCDS with jLink, gRPC meets Kotlin, Maven’s speed daemon, JDBC’s statement caching, and Apple’s M1!
In this tutorial, we’ll see how to send scheduled messages from a server to the browser using WebSockets.
For some analyses, SonarQube needs some exclusions added to avoid false positives. We investigate a few ways to configure it.
In this tutorial, we’ll describe how to avoid InvalidAlgorithmParameterException when we generate the IV and use it in a cipher algorithm.
Lots of innovation happening: HTTP/3 in Netty, Reactive Hibernate, Static images for JVM, Maven 4, Docker deprecation on K8S, and also, the value of 1-on-1 sessions!
In this tutorial, we’ll talk about the different ways of comparing double values in Java.
Learn about the MultipleBagFetchException in detail.
Say hello to Java 16: one small step towards value types and a more efficient Metaspace. Also, buildpacks with layered Jars, and becoming an effective team lead!
Learn the concepts around servlets, their containers, and a few essential objects they revolve around.
Learn how to implement AES encryption and decryption using the Java Cryptography Architecture.
Let’s understand the cause behind NoSuchFieldError and how to resolve it.
Learn how to define and use variables in Thymeleaf
A quick overview of basic terms associated with the security context.
Learn about a few tools that we can use to import certificates in .cer format into the client’s truststore
New release of GraalVM, Speculating over the fate of Loom and Valhalla, Building a server framework, Cloud computing and climate change, and in praise of humility!
The capacity of an ArrayList functions differently to the size of an Array. We explore the differences and when it’s a good idea to set an ArrayList’s size.
A quick and practical performance comparison between save() and saveAll() in Spring Data.
The loose types of Java generics are hard to coerce into the strong types of Java arrays. We explore the problem and some common solutions.
In this tutorial, we’ll see how to exploit the new capabilities of Spring Boot to reuse Docker layers.
Meet Spring Boot 2.4, Embracing subatomic Java, Catching up with the new Java features, and a set of practical guides on distributed systems.
Learn how to implement and use indexes using JPA.
In this article, we explore the different packaging types available in Maven.
Learn how to migrate code from a web.xml file to DispatcherServlet in a Spring Boot application.
All things Reactive: R2DBC joins Reactive Foundation, Reactive Manifesto II, and The Reactive Principles. NUMA meets G1, GraphQL at scale, and write angry!
Learn about the difference between JPA CascadeType.REMOVE and orphanRemoval for deleting entities.
Learn how to ignore fields using the JPA @Transient annotation in Java.
Learn how to use the getLocalizedMessage() method to provide localized exception messages
Learn about the IndexOutOfBoundsException: “Source does not fit in dest” in Java.
Learn how a Java program can detect whether it’s running in a 64-bit or 32-bit JVM.
Learn about the differences between String casting and executing the toString() method in Java.
2 million virtual threads with Loom, reactive to coroutines, cloud-native Spring Boot, working effectively with databases and context matters!
Learn about the transient keyword and see its behavior through examples
Learn how to use the 0xff value with the bitwise AND operator in Java.
Explore the functionality offered by Apache Commons and Google Guava, specifically in the area of the collections framework.
Revisiting project Jigsaw and first-level cache in Hibernate, a little competition for SDKMAN!, moving data at petabyte scale, and fallacies about time and timezones!
Learn how to create a dynamic URL in Retrofit2
Learn about the Keycloak REST APIs and how to call them in Postman
Tale of legendary duos: Shenandoah and Java 11, Unix sockets and Java 16, TestContainers and JPA, and finally Distributed Tracing and Netflix!
Learn how to obtain the database URL from a JDBC Connection object.
Project Panama delivers, Dockerizing Java applications, EFK stack for logging, a little about queuing theory, and COBOL ain’t gonna go anytime soon.
Everything revolves around JVM: Talking with the Shenandoah team, JIT and Graal internals, current trends in the Java ecosystem, and learning a new programming language!
Learn different ways to end a long-running execution after a certain time in Java.
Look into distributed background job scheduling and processing in Java using JobRunr and have it integrate with Spring.
Learn how to check whether a Java class is abstract using the Reflection API.
Explore the functionality offered by libphonenumber to format and validate phone numbers using code samples.
Back to the basics: one step closer to inline classes, benchmarking GC latencies, Java after 8, and why it’s not a good idea to rely on averages!
Learn how to configure and create a simple CRUD application using the jOOQ framework.
Learn how to retrieve and set cookies from Apache’s HttpClient response
Explore several options for reading an HTTP response body as a string in Java
While unit testing, we may occasionally want to use @BeforeAll and @AfterAll in non-static setup and tear-down methods. Let’s see how we can do it.
Learn how to set the TLS version in Apache HTTPClient
In this tutorial, we’ll learn about Gradle Wrapper, an accompanying utility that makes it easier to distribute projects.
More resilient Java with Bulkheads, a new ML library for Java, GraalVM native images, Spring Boot performance, reinventing VMs, and talent isn’t everything! Oh, and the Baeldung “sale”. Good stuff this week.
Let’s take a look at how we can list the available cipher algorithms.
Learn about the CharacterEncodingFilter and its usage in a Spring Boot application.
In this tutorial, we’ll discuss how to get the first key-value pair from a HashMap without knowing the key.
Learn how we can check if a method is static or not.
Learn how to send emails with single and multiple attachments in Java.
Learn how to remove the prefix from a string using Groovy.
Java 15 goes GA, A collection of Spring/JPA topics, creating highly scalable distributed systems, and good looking GitHub profiles!
Explore the key differences between the @Valid and @Validated annotations.
They may look very similar but they aren’t. Let’s explore why.
Look at the challenges of using any RDBMS within a Lambda, and how and when Hibernate can be useful
GC enhancements in Java 15, JPA lifecycle events, Docker and Spring Boot, Distributed tracing, and perks of hiring junior engineers: packed in a diverse weekly!
Learn how to enable user self-registration in Keycloak.
Learn how to safely roll back migrations using Flyway.
Let’s see how to declare dates in an OpenAPI file, in this case, implemented with Swagger.
If you want to learn why your code keeps throwing this exception, this article is for you.
Learn how to add extra attributes to a user in Keycloak.
Faster startup for JVM, mind-boggling Java puzzlers, customizing JPA repositories, Slicing Boot tests, and professional video calls: All in a very diverse weekly!
Let’s have a look at how we can hide endpoints from Swagger API documentation.
Learn how to make order agnostic comparison of lists when writing unit tests.
Learn the cause of ArrayStoreException, how to handle it, and best practices for avoiding it
Learn how to write clean and powerful unit and integration tests for Quarkus applications.
Learn how to find the largest power of 2 that is less than an input number.
Learn how to generate certificates with keytool.
Kotlin 1.4 is out with lots of small yet useful features! Intriguing topics on GraalVM, Spring, Hibernate, and SQL. Also, more patterns to design distributed systems.
Learn about Spring Async and Spring WebFlux both theoretically and practically with a basic load test
Spring Boot supports both .properties and YAML. We explore the differences between injecting properties, and how to provide multiple configurations.
Let’s see how Leadership Election with Consul helps to ensure data stability.
Efficient docker images for Spring Boot, lots of small upgrades for Spring, more patterns for distributed systems, and a historical take on date and time!
Let’s look at the java.lang.NoSuchMethodError and some ways to handle it.
Learn how to the use Hi/Lo algorithm as a database identifier generation strategy.
Learn how to interact with Azure Cosmos DB using Spring Data.
Learn about the differences between the Java Virtual Machine (JVM) and the Dalvik Virtual Machine (DVM).
List all the classes loaded by a specific class loader in Java
Learn how to retrieve database metadata using a JDBC connection and the DatabaseMetaData interface.
A very diverse anthology: Project Amber’s design documents are already on GitHub, cloud functions in Micronaut, patterns for distributed systems, and advice for effective blogging.
Take a close look at how to disable logout redirects in Spring Security.
Learn about the several options when opening files in Java.
A quick and practical guide to Spring Data JDBC.
Learn how to set values of private fields in Java using the Reflection API.
Understand the difference between calling HttpServletRequest#getSession() and HttpServletRequest#getSession(boolean).
Learn how to work with Apache Maven, the popular Java build automation tool
When we need to extract values from the request URI, @PathVariable is the way to go. Let’s look how to use it.
Learn how to determine if an object is of primitive type using Java.
Microsoft continues to contribute to the Java ecosystem with new the OpenJDK for ARM and JMS over AMQP. Also, Patterns to manage distributed systems and finally, working effectively from home!
Learn how to recover from a failed Flyway migration using Spring Boot.
Learn about XML defined beans in Spring Boot.
In this short tutorial, we’ll see how to skip tests when using the Gradle build tool.
Learn how to build and train a convolutional neural network model using the Deeplearning4j library in Java.
Learn about the static variable initialization in Java.
Have a look at different ways to compare arrays in Java.
Learn how to take screenshots using Java.
Learn different ways of preserving line breaks in HTML using Jsoup.
Learn about the differences between System.console() and System.out.
Learn how to set and evaluate Excel formulas in Java with Apache POI
In this tutorial, we’ll cover a common use case of using Mockito ArgumentCaptor in our unit tests.
Learn how to manage several versions of Java SDKs among other Java Ecosystem tools using SDKMAN!
Java is moving so fast! Java 15 is about to be released and we have two exciting news about Java 16. Also, some interesting topics on Security and Cloud.
The L in SOLID, the Liskov Substitution Principle helps structure object oriented design. We also explore how it supports the Open/Closed Principle.
Learn several ways to convert a List into a Map using Custom Suppliers.
Another step for Project Loom in Java 15 and Deprecating Biased Locking, Cool topics on Cloud, Microservices, and Istio. And finally some OS classics!
Explore the differences between JDBC’s Statement and PreparedStatement interfaces.
Lots of interesting topics in a wide range of topics: JVM internals, JUnit 5 tricks, Spring Profiles, Ktor, Infrastructure Costs, and a lot more.
implement different solutions to the problem of finding the k largest elements in an array with Java
Learn how to access the private fields of another class and read their values using the Java Reflection API.
Learn how to convert an array of primitives to a List of objects of the corresponding type.
Learn some of the basic steps needed to load JDBC drivers
Learn how to map a YAML list into a java List using Spring Boot.
Learn how to add text to images in Java
Learn how to convert a string into a boolean using Java.
Multi module maven projects can experience difficulties at compile time and runtime with multiple library versions. We learn how to control the versions used.
Learn how to resize (scale) an image using Java.
When dividing by zero, integer division always throws an Exception. This is not the case with floating-point numbers, however. Let’s see why.
Lots of interesting writeups on a wide variety of topics: From new Spring improvement and Oracle Coherence to SOLID principles and freelancing.
Regular expressions can help us with text processing. Here we explore how to count the number of matches of a regular expression in some text.
Explore different ways of printing an integer in binary format in Java.
Explore how to map collections using MapStruct.
The Spring ecosystem is moving forward, with several major milestones. The Java language itself is also revisiting some core concepts as well. An interesting week.
A simple SSO implementation using Spring Security OAuth2 and Boot.
Learn how to inject a Map from a YAML file in Spring Boot.
Learn how to get the mac addresses of network card interfaces in Java.
Learn how to use the Gradle Nebula Lint plugin to identify and fix unused dependencies in your project
Learn ways in which DTOs are shared between microservices
Learn how to test a Spring Multipart POST Request using MockMvc with the help of an example.
Explore what the covariance and covariant return types are and how they behave in Java.
Learn how to access memory information of a JVM using the Java Runtime API.
Learn how to write a Java InputStream to a Java OutputStream.
The Spring story on GraalVM is getting polish and Java 14 and even 15 features are getting some well-deserved attention. A solid week in the Java ecosystem.
Learn to format numbers in Java.
Learn to convert a Spring MultipartFile to a File.
Learn about variable scope in Groovy
Learn how to expose the administrator console of WildFly for remote access.
Learn a few different ways to conditionally add CSS classes in Thymeleaf.
Learn how to unit test controller exceptions using Spring MockMvc.
Learn several ways how to redirect logged-in users from the login page using Spring Security.
Understand the differences between Spring’s @RequestParam and @PathVariable annotations.
This week is Spring-heavy, which is always cool 🙂 and, on top of that, a really solid writeup about building resilience. Good stuff.
Learn when and how to avoid the “Too many open files” exception in Java.
Learn about the Reactive Stream Specification and see a practical example of Flow API and RxJava implementations for a live video stream
Learn how to test a mock JNDI datasource using the Spring Framework and the Simple-JNDI library.
Learn how to isolate the caching layer in your Spring Data tests.
Learn how to write your own IntelliJ plugin using Gradle.
Compare the usage of Spring YAML versus the properties file.
Learn about the different strategies JPA uses to generate the primary key for an entity and at which moment each strategy sets the key value during persistence.
Learn about the Circular View Path error in a Spring Boot project.
Distributed caching, Kafka, and Spring Boot – the ecosystem is moving forward.
Learn what [Ljava.lang.Object; is and how to better print array objects.
Review what compilation errors are, and then specifically explain what the “cannot find symbol” error is and how it’s caused.
Learn how to use Kafka’s MockProducer to verify common producer operations
Learn how to handle org.hibernate.LazyInitializationException : could not initialize proxy – no Session in Java
Learn how to send a request to a proxy using Apache’s RestTemplate in Java.
A nice intro to Amazon’s Deep Java Library for machine learning, and Spring Tools 4.6.2 is released.
Learn how to implement the Open Service Broker API using Spring Cloud Open Service Broker.
Learn about what causes the java.lang.OutOfMemoryError: unable to create new native thread error.
Learn techniques and approaches to performing a partial instead of a full update
Learn about Maven’s support for multi-release JAR files
Learn about JSONObject’s support for Readers
Learn how to cast an int to an Enum in Java
An in-depth review of Apache Arrow’s in-memory data format for fast, machine-to-machine transfer of big data, and a migration guide for Spring Data JDBC 2.0.
Learn how to set custom timeouts on the Spring Cloud’s Feign Client.
Explore the MockConsumer, one of Kafka’s Consumer implementations
Learn the difference between LinkedBlockingQueue and ConcurrentLinkedQueue in Java
Explore the Open/Closed Principle (OCP) as one of the SOLID principles of object-oriented programming in Java.
A guide to switch expressions in Java 14, and a great article explains how developers can overcome their aversion to refactoring through deliberate practice.
Learn to format currencies in Spring using Thymeleaf.
A preview of Spring Boot support for GraalVM Native Images, and Spring Security and Boot release several new versions.
Learn how to send and receive information over the wire using Twitter’s RPC Library Finagle.
A quick and practical comparison of various @Transactional annotations.
Learn how to use the Log4j 2 extension mechanism to implement custom plugins
Java 14 brings in a new API to wrap accessing memory managed outside of the JVM. Here we explore the need for the API and how it works.
Learn how to validate different formats of phone numbers using regular expressions.
A practical deep-dive into how to implement logout in a Spring Security OAuth2 application with JWT, using Spring Security OAuth legacy stack.
Learn how to autowire beans dynamically given ceertain conditions.
Learn about Spring Cloud Gateway’s built-in WebFilter factories and how to use them in advanced scenarios
Learn how to configure Spring Boot to talk to Redis via Lettuce
Learn how to analyze unused dependencies in Maven using the Maven Dependency Plugin.
Learn how to execute a manual logout with Spring Security.
JPA provides a standard for generating DDL from our entity model. Here we explore how to do this in Spring Data and compare that with native Hibernate.
Learn how to use the @EmbeddeId and @Embeddable annotations to represent composite keys in JPA entities.
Learn how to add proxy support to Jsoup
Learn how to test log messages with JUnit
A quick and practical guide to building Java applications in Gradle.
Spring adopts new versioning schemes, and an in-depth look at Java’s new text blocks feature.
A quick and practical guide to the Single Responsibility Principle in Java
A quick and practical guide to disabling Spring Security for a specific profile in Spring Boot.
Learn how to map lists of different element types using Model Mapper.
A handful of Spring configuration tips for getting the most out of application.properties files, and Spring Tools 4.6.1 is released.
Learn how we can enable multiple cache managers in our Spring Boot application.
Learn to construct a JPA query between unrelated entities.
Learn how to implement a Custom Logout Handler using Spring Security.
Learn how to build a simple todo application with Spring Boot and Groovy.
Learn how to encode a Java String to the UTF-8 character set.
Learn how to mock the Jackson ObjectMapper’s readValue method with Mockito.
Explore the difference between mockito-core and mockito-all.
Explore different ways to find the data type in Groovy.
A quick look at building native images for Spring Boot apps with GraalVM, and a new series from Martin Fowler on source code branching patterns.
Learn how to setup connection pooling to an Oracle database with Spring Data
We learned how to store the Refresh Token in an AngularJS client app, how to refresh an expired Access Token and how to leverage the Zuul proxy.
A quick explanation and solution for the “No Persistence Provider for EntityManager” error.
A quick and practical overview of a recommended package structure for Spring Boot projects.
Learn the intricacies of the Map.computeIfAbsent method.
Learn how to handle java.net.ConnectException
Learn about Postman’s support for GraphQL
Learn how to set up database states for your unit tests using DBunit.
Learn how to create a test template using JUnit 5.
Learn how to subscribe or block for a Mono’s promised value.
Learn the several ways to convert from a String to an Integer in Groovy
A quick and practical guide to Mockito’s AdditionalAnswers.
Learn about different Map implementations that accept all case variations of a String as the same key
A good intro to the new Kotlin DSL for Spring Integration, and a quick look at Java 14’s pattern-matching enhancement for the instanceof operator.
A quick overview of context hierarchies in Spring Cloud.
Learn the several ways that Spring MVC and Thymeleaf can work together to render data.
Learn what the Java Number class does and what methods it contains.
An overview of RSocket channels for bi-directional data streaming, and a deep dive into authentication and authorization in Spring Security.
Learn how to use Guava’s MapMaker class to create maps with weak references.
Learn how to create Spring Batch jobs with conditional flow.