Discover the power of partitions in Kafka topics and learn how to consume messages from partitioned topics using Spring Boot.
Also find me here:
Baeldung Editor
Brandon Ward
Brandon is a full stack software engineer with nearly a decade of experience. Much of his career has been building web applications backend by Spring, using both Java and Kotlin. In his free time, you'll find him outdoors snowboarding or mountain biking.
Here's what I've reviewed (so far):
Baeldung on Java
- All
- Spring Data (3)
- Java Dates (2)
- Java Collections (2)
- Web Services (1)
- Testing (1)
- Spring Cloud (1)
- Spring (1)
- Maven (1)
- JVM (1)
- Core Java (1)
- Algorithms (1)
Functional vs. Non-Functional Testing
Filed under Testing
Learn the differences between functional and non-functional testing, and explore several types of testing for each.
Parsing Date Strings with Varying Formats
Filed under Java Dates
Explore strategies for parsing multiple date formats at once.
Spring R2DBC Migrations Using Flyway
Filed under Spring Data
Learn how to use Flyway migrations for a Spring Data R2DBC application.
Custom Constructor in Java Records
Filed under Core Java
Learn how to create custom constructors for Java Records and the benefits they provide.
Difference Between findBy and findAllBy in Spring Data JPA
Filed under Spring Data
Learn the similarities between findBy and findAllBy in Spring Data JPA queries, and discover strategies to verify how Spring Data JPA is operating.
Java List Interface
Filed under Java Collections
Learn about the Java list interface, including core functions and concrete implementations.
Convert an ArrayList of Object to an ArrayList of String Elements
Filed under Java Collections
Discover strategies to normalize lists of objects to strings in Java.
NonUniqueResultException in Spring Data JPA
Filed under Spring Data
Learn about the NonUniqueResultException in Spring Data JPA and discover strategies to avoid it.
Rate Limiting With Client IP in Spring Cloud Gateway
Filed under Spring Cloud
Learn how to limit the rate of incoming requests based on the client’s actual IP address for our Spring Cloud Gateway.
Convert java.util.Date to java.sql.Date
Filed under Java Dates
Learn how to convert a java.util.Date to a java.sql.Date.
Can a Java Application Use More Memory Than the Heap Size?
Filed under JVM
Learn how to restrict the total memory usage in Java.
Algorithm to Identify and Validate a Credit Card Number
Filed under Algorithms
Learn techniques to identify credit cards by their issuer, and algorithms to ensure the validity of the credit card.
Sending SOAP Request via Postman
Filed under Web Services
Discover how to set up and call SOAP services through Postman.
Maven Snapshot Repository vs Release Repository
Filed under Maven
Learn how to use Maven snapshots and releases, and the differences between them.
Baeldung on Linux
- All
- Web (1)
Viewing Retention for a Kafka Topic
Filed under Web
Learn techniques for viewing Kafka topic retention configurations using the provided shell scripts.
Baeldung on Computer Science
- All
- Trees (1)
- Software Architecture (1)
What Is an Anti-pattern?
Filed under Software Architecture
Discover definitions of common anti-patterns, how to recognize them, and strategies for how to actively avoid them.
Disjoint Set Union Data Structure
Filed under Trees
Learn about the disjoint set union data structure, along with some key optimizations for it.
Baeldung on Kotlin
- All
- Kotlin Collections (21)
- Kotlin Basics (15)
- Testing (9)
- Kotlin Strings (9)
- Kotlin (7)
- Kotlin Numbers (6)
- Kotlin Concurrency (6)
- Kotlin Classes and Objects (6)
- Kotlin-Java Interop (4)
- Algorithms (4)
- Kotlin Functions (3)
- Patterns (2)
- Libraries (2)
- Asynchronous Programming (2)
- Kotlin IO (1)
- Kotlin Dates (1)
- Functional Programming (1)
Getting All Field Names of a Class Using Kotlin Reflection
Filed under Kotlin Basics
A quick tutorial on retrieving the field names of a class using reflection in Kotlin.
Merging Kotlin Flows
Filed under Kotlin Concurrency
A quick tutorial on merging multiple Kotlin Flows into a single Flow.
Async Exception Handling in Kotlin
Filed under Kotlin Concurrency
A quick tutorial on async exception handling in Kotlin coroutines.
Checking if Two Objects Have the Same Class in Kotlin
Filed under Kotlin Classes and Objects
A quick tutorial on checking if two objects have the same class or not in Kotlin.
Result Class in Kotlin
Filed under Kotlin Basics
A quick tutorial about the Result class in Kotlin for advanced error handling.
Cyclically Rotate Array by One in Kotlin
Filed under Kotlin Collections
A quick tutorial on how to cyclically rotate arrays in Kotlin.
Util Classes in Kotlin
Filed under Kotlin Classes and Objects
A quick introduction to creating utility classes in Kotlin.
Determine if All Elements Are the Same in a Kotlin List
Filed under Kotlin Collections
A quick tutorial on determining if all elements in a list are identical in Kotlin.
Kotlin ?.let() vs if not null
Filed under Functional Programming
Learn about the differences between let and if-not-null when handling operations on nullable objects in Kotlin.
How to Reverse the Order of Words in a Sentence in Kotlin
Filed under Kotlin Strings
A quick tutorial on reversing the word order in a sentence with Kotlin.
Rotate a List in Kotlin
Filed under Kotlin Collections
Explore several strategies for rotating lists in Kotlin.
How to Convert a String to a Float in Kotlin
Filed under Kotlin Numbers, Kotlin Strings
A quick tutorial about converting strings to floats in Kotlin.
Calculate Greatest Common Divisor in Kotlin
Filed under Algorithms
A quick tutorial on calculating the greatest common divisor of two or more numbers in Kotlin.
Find Least Common Multiple of Two Numbers in Kotlin
Filed under Algorithms
A quick tutorial on computing the least common multiple of two or more numbers in Kotlin.
How to Repeat a String N Times in Kotlin
Filed under Kotlin Strings
A quick tutorial on repeating strings in Kotlin.
Difference Between “it” and “this” Keywords in Kotlin
Filed under Kotlin Basics
An introduction to the differences between the “it” and “this” keywords in Kotlin.
Split a String Into Chunks of a Given Size in Kotlin
Filed under Kotlin Strings
Explore how to split a string into chunks of a specific size in Kotlin.
Idiomatic Ways to Transform Maps in Kotlin
Filed under Kotlin Collections
Explore several strategies for transforming Maps in Kotlin.
Using Kotlin when() Clause for <, <=, >=, and == Comparisons
Filed under Kotlin Basics
Learn how to use Kotlin operator functions for detailed comparisons in when clauses.
Identifying and Addressing Kotlin Code Smells
Filed under Kotlin
Learn how to recognize common Kotlin code smells along with strategies to mitigate issues that are discovered.
Converting Callback Methods to Coroutines in Kotlin
Filed under Asynchronous Programming
Explore ways to convert asynchronous callback driven code to Kotlin coroutines.
Difference Between !! and ? in Kotlin
Filed under Kotlin Basics
Learn the difference between the safe null operator and the unsafe non-null assertion operator in Kotlin.
Get the Line Number Where an Exception Was Thrown in Kotlin
Filed under Kotlin Basics
Explore strategies for extracting the line number and other metadata from where an exception was thrown in Kotlin.
How to Reverse a String in Kotlin
Filed under Kotlin Strings
Explore the techniques of reversing a string in Kotlin.
Iterate Over a String Backward in Kotlin
Filed under Kotlin Strings
Explore techniques for iterating a string backward in Kotlin.
How to Create a Frequency Map in Kotlin
Filed under Kotlin Collections
Explore several strategies for creating a frequency map in Kotlin.
Testing Extension Methods in Kotlin
Filed under Kotlin Functions, Testing
Learn a few strategies of testing extension functions in Kotlin.
Removing the First Element From an Array in Kotlin
Filed under Kotlin Collections
Explore several strategies for removing the first element from an array in Kotlin.
Removing the First Element From an ArrayList in Kotlin
Filed under Kotlin Collections
Learn several strategies for removing the first element from an ArrayList in Kotlin.
Get Subarray of an Array Between Given Positions in Kotlin
Filed under Kotlin Collections
Learn various techniques to get a subarray from an array in Kotlin.
Matrix Addition and Multiplication in Kotlin
Filed under Kotlin Collections
Learn how to perform matrix addition and multiplication in Kotlin.
Generate Multiplication Table in Kotlin
Filed under Kotlin
Learn how to generate a multiplication table in Kotlin.
How to Sort Elements in Lexicographical Order in Kotlin
Filed under Kotlin Collections
Learn several strategies for ignoring the case when sorting word collections lexicographically.
Clone a Set in Kotlin
Filed under Kotlin Collections
Explore several strategies for cloning Sets in Kotlin.
Merge Sort in Kotlin
Filed under Kotlin Collections
Learn several strategies of implementing the merge sort in Kotlin.
Insertion Sort in Kotlin
Filed under Kotlin Collections
Learn how to implement the insertion sort in Kotlin.
JSON String to Map
Filed under Libraries
Explore using several libraries for parsing JSON strings to maps in Kotlin.
Find the Index of an Element in a Kotlin Array
Filed under Kotlin Collections
Explore several ways to find the index of an element in a Kotlin array.
Class Inheritance with Kotlinx Serialization
Filed under Kotlin Classes and Objects
Learn how to handle complex class inheritance with Kotlinx serialization.
Quicksort in Kotlin
Filed under Algorithms
Explore a few variations of the quicksort algorithm in Kotlin.
Comparator in Kotlin
Filed under Kotlin Basics
Learn how to use and create Comparators effectively in Kotlin.
Difference Between flatMapMerge(), flatMapConcat() and flatMapLatest() in Kotlin
Filed under Asynchronous Programming
Learn how to flatten asynchronous functional programming constructs in Kotlin with several flattening operators on Flows.
Kotlin TODO() Function
Filed under Kotlin Basics
Discover how to use the Kotlin TODO() function to mark code that is not yet implemented.
Find the Factorial of a Given Number in Kotlin
Filed under Algorithms
Learn several techniques for computing the factorial of an integer in Kotlin.
Data-Driven Testing With Kotest
Filed under Testing
Learn several strategies for data-driven testing with Kotest.
Check Whether a Character Is a Vowel or Consonant in Kotlin
Filed under Kotlin Strings
Learn several strategies for determining if a char is a consonant or vowel in Kotlin.
The Facade Pattern in Kotlin
Filed under Patterns
Explore how to manage complexity with the facade pattern in Kotlin.
JUnit 5 vs. Kotest: A Comparison for Unit Testing
Filed under Testing
Explore the differences between Kotest and JUnit 5, along with when to use each technology.
An Introduction to KDoc
Filed under Kotlin
Learn the basics of KDoc in Kotlin to more effectively document source code.
Check if a String Is a Palindrome in Kotlin
Filed under Kotlin Strings
Discover a few strategies for determining if a string is a palindrome in Kotlin.
How to Use MockServer in a Kotest Test
Filed under Testing
Learn how to use MockServer in Kotest to verify requests and responses.
How to Run a Function Before Every Test Using Kotest
Filed under Testing
Learn to efficiently test Kotlin applications with Kotest’s lifecycle hooks for running functions before tests.
The Chain of Responsibility Pattern in Kotlin
Filed under Patterns
Learn how to apply the Chain of Responsibility pattern in Kotlin with a practical example.
Convert Binary Number to Decimal and Vice Versa in Kotlin
Filed under Kotlin Numbers
Learn how to convert between binary and decimal numbers in Kotlin.
Kotest: Assert a List Has Elements with Specific Properties
Filed under Testing
Learn strategies for verifying properties on objects inside of lists with Kotest.
How to Write a Spring Boot Test Using Kotest
Filed under Testing
Learn how to use Kotest for writing Spring Boot tests in Kotlin.
Swap Function in Kotlin
Filed under Kotlin Basics
Learn some techniques for writing variable swap functions in Kotlin.
How to Run Testcontainers Inside a Kotest Test
Filed under Testing
Discover how to use Testcontainers with the Kotest testing framework for Kotlin.
Converting a Map to a String in Kotlin
Filed under Kotlin Collections
Learn several strategies to convert Maps to Strings in Kotlin, including some techniques to create JSON representations.
How to Assert the Type of an Object in Kotest
Filed under Testing
Learn several ways to use Kotest to assert that Kotlin objects are of the expected class or subclass.
Adding New SourceSet with Gradle Kotlin DSL
Filed under Kotlin
Discover how to add source sets to Gradle builds with the Kotlin DSL, along with tips for using these source sets in your projects.
Get Difference Between Two Lists in Kotlin
Filed under Kotlin Collections
Learn several ways of computing the difference between two lists in Kotlin.
Callback Functions in Kotlin
Filed under Kotlin Functions
Learn how to use Kotlin callback functions effectively.
Convert Between Int and Char in Kotlin
Filed under Kotlin Numbers
Learn several strategies for converting between Ints and Chars in Kotlin.
A Guide to detekt: Static Code Analysis for Kotlin
Filed under Kotlin
Learn how to use detekt for Kotlin-specific static code analysis, including some configuration tips for effective use.
Kotlin Comparable Interface
Filed under Kotlin Basics
Learn the nuances of the Comparable interface in Kotlin and some additional features it has in comparison to its Java counterpart.
How to Run Parallel Coroutines in Kotlin
Filed under Kotlin Concurrency
Learn several strategies for running coroutines in parallel in Kotlin.
Mapping java.util.Optional to T in Kotlin
Filed under Kotlin-Java Interop
Learn how to unwrap java.util.Optional in Kotlin, along with additional strategies for approaching nullability in Kotlin.
Preconditions with Kotlin
Filed under Kotlin Basics
Explore Kotlin’s preconditions for validating arguments and states. Learn when to use each precondition function.
Mutating Arrays in Kotlin
Filed under Kotlin Collections
Learn some strategies for mutating arrays in place and the tradeoffs from a purely functional approach.
Opt-in Requirements in Kotlin
Filed under Kotlin
Learn about Opt-in APIs in Kotlin, including how to use them and how to make your own.
Kotlin Generic Inline Classes
Filed under Kotlin Basics
Explore the generic inline class in Kotlin and learn some powerful ways to use it.
Kotlin Coroutines With Timeout
Filed under Kotlin Concurrency
Learn several strategies to manage timeouts in a Kotlin coroutine.
Using the Gson TypeToken in Kotlin
Filed under Libraries
Explore how to deserialize JSON to generic Kotlin objects with the Gson TypeToken.
Difference Between Collection and Sequence in Kotlin
Filed under Kotlin Collections
Explore some key differences between Collections and Sequences in Kotlin.
Calling Kotlin Suspending Functions from Java
Filed under Kotlin-Java Interop
Learn several strategies for calling Kotlin suspend functions from Java.
Construct Suspend Functions With Kotlin’s suspendCoroutine
Filed under Kotlin Concurrency
Discover strategies for converting callbacks to coroutines.
Difference Between runCatching and try / finally in Kotlin
Filed under Kotlin Basics
Explore the differences between using runCatching and a try / finally expression in Kotlin. Then, find out when to prefer each.
Getting Started With Kotlin/Native
Filed under Kotlin
Discover the basics of Kotlin/Native including how to set a project up and interop with other native libraries.
IO and Default Dispatchers in Kotlin Coroutines
Filed under Kotlin Concurrency, Kotlin IO
Learn about the Default and IO Dispatchers for Kotlin Coroutines and discover some strategies for using them effectively.
“Accidental override” Error in Kotlin
Filed under Kotlin-Java Interop
Learn about the accidental override error in Kotlin and how to fix situations where code has conflicting JVM signatures.
Get Maximum Value Within a Kotlin Array
Filed under Kotlin Collections
Learn several methods for finding the max value in an array with Kotlin.
Kotlin Bit Operations
Filed under Kotlin Numbers
Learn about bit operations, bit shifts, and bit masks in Kotlin for low-level integer manipulation.
Create and Throw a Custom Exception With Kotlin
Filed under Kotlin Basics
Learn the basics of creating full-featured custom exceptions in Kotlin.
Remove All Whitespaces from a String in Kotlin
Filed under Kotlin Strings
Learn how to remove whitespaces from Kotlin strings.
Create a Deep Copy of a Kotlin Data Class
Filed under Kotlin Classes and Objects
Learn how to make deep copies of Kotlin objects.
Taking the First N Elements of an Array in Kotlin
Filed under Kotlin Collections
Learn how to take items from the beginning of arrays in Kotlin.
Get the Current Date/Time in Kotlin
Filed under Kotlin Dates
Discover ways to get the current date and time in Kotlin.
Check if a Number Is Odd or Even in Kotlin
Filed under Kotlin Numbers
Learn about using the rem() operator to determine if numbers are even or odd in Kotlin.
Defaulting Null Values on Non-Optional Parameters in Kotlin
Filed under Kotlin Classes and Objects
Discover patterns to set default values for nulls on required, nullable parameters in Kotlin.
Best Practices for Using Constants in Kotlin
Filed under Kotlin Basics
Discover strategies for using constants effectively in Kotlin.
Count Number of Digits With Kotlin
Filed under Kotlin Numbers
Learn multiple approaches to counting the number of digits in a number or string with Kotlin.
Sort Collection of Objects by Multiple Fields in Kotlin
Filed under Kotlin Collections
Discover several strategies for sorting collections by multiple fields.
Package-Private Alternative in Kotlin
Filed under Kotlin-Java Interop
Explore alternatives to Java’s package private in Kotlin.
Objects in Kotlin
Filed under Kotlin Classes and Objects
Learn what objects are in Kotlin and how they can make your code cleaner and easier to develop and maintain.
Extension Functions in Kotlin
Filed under Kotlin Functions
A quick guide to using and creating extension methods in Kotlin.