Learn how to reuse an embedded Kafka broker in multiple test classes to speed up integration tests.
Also find me here:
Baeldung Editor
Eric Martin
Eric Martin has been a software engineer in Kansas City, Missouri, for over 20 years. He has been focused on designing and building enterprise Java applications in multiple industries. In his free time, he enjoys brewing beer, cooking, and spending time with his family.
Here's what I've reviewed (so far):
Baeldung on Java
- All
- Java (72)
- Java String (56)
- Java IO (44)
- Testing (43)
- Spring Boot (43)
- Core Java (38)
- Persistence (30)
- Java Numbers (28)
- Spring Data (27)
- Java List (27)
- Java Concurrency (27)
- Java Array (27)
- Java Map (26)
- Spring (25)
- JVM (24)
- Data (23)
- Algorithms (23)
- JPA (21)
- Security (18)
- Java Collections (18)
- Maven (15)
- JSON (15)
- DevOps (14)
- Spring Security (13)
- NoSQL (13)
- Java Streams (13)
- Java Dates (13)
- HTTP Client-Side (12)
- REST (11)
- Cloud (10)
- Artificial Intelligence (10)
- Architecture (10)
- Logging (9)
- Spring MVC (8)
- Spring AI (8)
- Networking (8)
- Jackson (8)
- IDE (8)
- Spring Web (7)
- Spring Cloud (7)
- Groovy (7)
- Gradle (7)
- Jakarta EE (6)
- Web Services (4)
- Reactive (4)
- Spring WebFlux (3)
- Spring Persistence (3)
- Java Web (3)
- Docker (3)
- XML (2)
Tool to Analyze Offline Java Heap Dumps
Filed under Java
Explore two different memory analyzers to demonstrate how we analyze the Java heap memory via an offline heap dump file.
Resolving JSONException: JSONObject text must begin with ‘{‘ in Java
Filed under JSON
Explore why the ‘JSONObject text must begin with ‘{‘ at character 0’ exception occurs, what it means, and how to resolve it, with clear examples.
Guide to Maven Toolchains
Filed under Maven
Explore Maven Toolchains and how they let us define specific tool versions for our builds.
How to Randomly Get a Key, a Value, or an Entry From a HashMap in Java
Filed under Java Map
Explore different ways to randomly retrieve data from a HashMap in Java.
How to Query JPA LocalDateTime Field With a LocalDate Value
Filed under Java Dates, JPA
Learn how to query LocalDateTime fields using a LocalDate value in JPA using simple range queries, JPQL functions, and dynamic Criteria API queries.
Set the Null Value for a Target Property in MapStruct
Filed under Java
Learn different ways to always set a specific object field to null using MapStruct.
Bind Custom Validation Message in Spring
Filed under Spring Boot
Learn about Spring Boot’s validation message system, how to configure it effectively, streamline error handling, and make message management more intuitive.
Order of Configuration in Spring Boot
Filed under Spring Boot
Explore the order of configuration in Spring Boot as an essential tool for building predictable and maintainable applications.
Baeldung on Linux
- All
- Administration (80)
- Scripting (76)
- Files (72)
- File Editing (48)
- Filesystems (29)
- File Searching (25)
- Text Processing (23)
- Processes (23)
- Installation (18)
- Web (15)
- File Viewing (12)
- Security (10)
- Package Management (7)
- Docker (7)
- User Administration (6)
- Search (6)
- Networking (6)
- Boot Process (5)
- Network Configuration (4)
- File Permissions (4)
- File Conversion (4)
- File Compression (4)
- Network Monitoring (3)
- Building (3)
- Service Management (1)
- File Transfer (1)
How Do File Permissions Work for the Root User
Filed under File Permissions
Learn how file permissions work for the root user, how root can override them, and discover scenarios where even the root is restricted.
What Are the Differences Between [0-9], [[:digit:]] and \d
Filed under File Searching, Scripting
Explore these expressions, compare them, discuss how they behave differently under various conditions, and provide practical Linux examples to show their differences
Identifying the Window Manager and Desktop Environment in Linux
Filed under Administration
Break down the differences between a Window Manager and a Desktop Environment then discuss different methods to identify each.
Dual Boot Ubuntu Alongside macOS
Filed under Boot Process
Learn how to install Ubuntu along with macOS on Intel-based Macs.
How to Tell if a Linux Machine Supports AVX/AVX2 Instructions
Filed under Administration
Learn how to tell if a Linux machine supports Advanced Vector Extensions (AVX) and its extension, AVX2 instructions.
What Is a Bootloader in Linux?
Filed under Boot Process
Learn about what a bootloader is and how it works to load and initialize an operating system
What’s the Difference Between find . and find . -print
Filed under File Searching
Explore difference between find . and find . -print including their historical context and subtle differences
How to Uninstall GNOME Stock Applications
Filed under Installation
Learn how to remove the stock GNOME apps from several distributions, using their respective package manager
Executable Cannot Be Found Although It’s in the $PATH in Alpine Docker
Filed under Docker
Explore the common “executable not found” error in Alpine Docker containers and how to fix it, including causes like missing libraries and mismatched architectures.
Baeldung on Scala
- All
- Testing (1)
- Scala Web (1)
- Scala Strings (1)
Testing With Gatling Using Scala
See how to easily write scenarios to performance test your REST application using Gatling with Scala.
Generate Secure Random Passwords in Scala
Filed under Scala Strings
Learn how to generate secure random passwords with various criteria.
Baeldung on Computer Science
- All
- Machine Learning (17)
- Algorithms (15)
- Programming (13)
- Networking (12)
- Security (9)
- OS (9)
- Artificial Intelligence (7)
- Searching (6)
- Latex (6)
- Math and Logic (5)
- Data Structures (5)
- Core Concepts (5)
- Deep Learning (4)
- Web (3)
- Sorting (3)
- Software Architecture (3)
- Trees (2)
- Graphs (2)
- Graph Traversal (2)
- Path Finding (1)
- Concurrency (1)
- Computer Vision (1)
How to Start Building an Operating System
Filed under OS
Examine resources that apply to all operating system development endeavors and explore learning paths based on specific operating system concepts and programming languages.
How to Calculate the Number of Tag, Index, and Offset Bits of Different Caches
Filed under Core Concepts
Learn how to calculate the allocation of tag, index, and offset bits in different cache architectures.
What Is Prompt Engineering?
Filed under Artificial Intelligence
Learn about prompt engineering, its importance, various prompt techniques, and components.
Introduction to the Fetch-Execute Cycle
Filed under OS
Explore the Fetch-Execute cycle and its stages in detail.
How to Implement a Queue Using Two Stacks?
Filed under Data Structures
Learn two approaches to simulating a FIFO queue using two LIFO stacks.
Understanding Multicloud Deployment Strategies
Filed under Software Architecture
Learn how to maximize flexibility and resilience by adopting a multicloud deployment strategy
WaveNet Speech Synthesis
Filed under Deep Learning
Study speech synthesis using the WaveNet model
Detecting Syllables in a Word
Filed under Artificial Intelligence
Explore several approaches to finding syllables in a word, which is an important task in natural language processing (NLP).
SEO: Off-Page vs. On-Page Techniques
Filed under Web
On-page SEO focuses on optimizing individual web pages, while off-page SEO focuses on improving a website’s overall quality
Baeldung on Kotlin
- All
- Kotlin Collections (3)
- Kotlin Strings (2)
- Kotlin Numbers (2)
- Kotlin Classes and Objects (2)
- Kotlin Arrays (2)
- Security (1)
- Kotlin IO (1)
- Kotlin Functions (1)
- Kotlin (1)
- HTTP Client-Side (1)
Resolving Kotlin Error: “Primary constructor call expected”
Filed under Kotlin Classes and Objects
Explore various approaches to fixing this error, illustrating each with problematic code examples, their solutions, unit tests, and detailed explanations.
Kotlin Application Deployment With Docker and Kubernetes
Filed under Kotlin
Learn to deploy a simple Kotlin application to Kubernetes (K8s) using Docker and Docker Hub.
Spring Security JWT With Kotlin
Filed under Security
See a Spring Boot application example with tests to use JWT and secured endpoints.
Convert a Data Class to ByteBuffer in Kotlin
Filed under Kotlin Classes and Objects
Learn how to convert a Kotlin data class to a ByteBuffer using different forms of serialization
Rename a File in Kotlin
Filed under Kotlin IO
Learn how to use the built-in method exposed by the File class or use the Files class from the Java NIO package to rename files in Kotlin
any() vs. none() vs. all() in Kotlin
Filed under Kotlin Collections
Learn about the all(), none(), and any() collection methods that enable concise and declarative condition checking.
Getting Binary Representation of Int in Kotlin
Filed under Kotlin Numbers
Explore the methods available in Kotlin to get the binary representation of integers.
Check if a Number Can Be Expressed as Sum of Two Prime Numbers in Kotlin
Filed under Kotlin Numbers
Explore multiple approaches to checking if a number can be expressed as the sum of two prime numbers.
Convert String Array to Int Array in Kotlin
Filed under Kotlin Arrays, Kotlin Strings
Learn to convert a String array to an Int array in Kotlin and how to handle potential exceptions.
Baeldung on Ops
- All
- Docker (30)
- Kubernetes (26)
- Jenkins (6)
- Git (6)
- Cloud (3)
- Logging (1)
- DevOps (1)
How to Change a Docker Container’s MTU
Filed under Docker
By keeping container MTU settings in sync with the host and the broader network infrastructure, teams can minimize packet loss, avoid fragmentation, and maintain consistent performance, even in environments that involve tunnels, VPNs, or overlay networks.
Sticky Session on Kubernetes Cluster
Filed under Kubernetes
Explore how sticky sessions work in Kubernetes, why they are important for stateful applications, and the different ways they can be implemented.
Monitor Jenkins Build Status in a GitHub Repository
Learn two efficient methods for tracking Jenkins build status directly within GitHub.
Create Namespace Using Helm Templates
Filed under Kubernetes
Learn how to create a namespace using Helm templates, ensuring consistency and reusability in your Kubernetes deployments
Passing Environment Variables to a Vue App at Runtime
Filed under DevOps
Walk through a practical approach to dynamically injecting environment variables and configuring the app to read them effectively.
Understanding backoffLimit in Kubernetes Jobs
Filed under Kubernetes
Explore backoffLimit, its importance, practical applications, how to configure it effectively, and tips for balancing reliability with resource efficiency.
Load a Docker Image From a Tar File
Filed under Docker
Learn how to save Docker images into tar files and load them back in
Guide to Setup Jenkins on Kubernetes
Filed under Jenkins, Kubernetes
Deploying Jenkins on Kubernetes offers a robust, scalable solution for automating CI/CD pipelines, enabling seamless integration and delivery across software projects.
Docker Interactive Mode After Executing Script
Filed under Docker
Learn how to run a script inside a Docker container after its creation and access to a shell terminal
Baeldung on SQL
- All
- SQL Queries (10)
- Database Concepts (4)
- SQL Tables (3)
- SQL Views (2)
- Security (1)
- SQL Joins (1)
- SQL Basics (1)
- Database Access (1)
- DML (1)
Update Multiple Rows With Different Values With Single Query
Filed under SQL Queries
Explore how to update multiple rows with different values, depending on the value of existing columns
Generate SQL Insert Script From Excel Worksheet
Filed under SQL Queries
Explore methods for generating SQL INSERT scripts from an Excel worksheet and best practices for ensuring a smooth execution process.
SQL injection that gets around mysql_real_escape_string()
Filed under Security
Review some obscure corner cases that enable malicious inputs to slip past mysql_real_escape_string().
SQL Query for Calculating a Rolling 7-Day Average
Filed under SQL Queries, SQL Views
Discuss a general approach to calculating a 7-day rolling average, including indexed views in MSSQL Server, materialized views in MySQL, and materialized views with refresh in PostgreSQL.
Multiple Indexes vs. Multi-Column Indexes
Filed under Database Concepts
Explore database indexes, focusing on the differences between individual and composite indexes.
Calculating Running Totals in SQL
Filed under SQL Queries
Learn several methods for calculating running totals in SQL
Understanding the Execution Order of SQL Statements
Filed under Database Concepts
Explore the logical execution order of SQL statements, from FROM to TOP, and learn how this order affects the outcome of a query.
Inserting Values From a SELECT Statement into Another Table
Filed under DML, SQL Queries
Learn about copying data between tables with the INSERT INTO … SELECT statement
How to List ALL Grants of a User in SQL
Filed under Database Access
Learn how to list user grants in MySQL, PostgreSQL, and SQL Server.