Best of BaeldungOctober 2024

  1. 1
    Article
    Avatar of baeldungBaeldung·2y

    Reduce Memory Footprint in Java

    Application size is crucial for performance, and optimizing memory usage can significantly reduce an application's memory footprint. This guide explains how to estimate the memory size of Java applications, explore techniques like using primitive types, combining classes, and bit packing for optimizing memory. It also covers using the Java Object Layout (JOL) library for verification and comparing standard Java collections with third-party libraries like Eclipse Collection for additional optimization.

  2. 2
    Article
    Avatar of baeldungBaeldung·2y

    A Guide to @Locked in Lombok

    Project Lombok's @Locked annotation, introduced in version 1.18.32, is designed to enhance support for virtual threads in Java by acting as a variant of the ReentrantLock, ensuring better performance in concurrent applications. It simplifies the locking mechanism in methods, reducing boilerplate code, and provides a clear advantage over the @Synchronized annotation, particularly with virtual threads. Multiple methods can share the same lock, or different locks can be specified for read and write operations to boost performance.

  3. 3
    Article
    Avatar of baeldungBaeldung·2y

    Rapid Spring Boot Prototyping with Bootify

    Bootify is a tool designed to accelerate Spring Boot development by automating the creation of boilerplate code and configuration files. It provides a user-friendly interface to set up entities, relationships, and application components, making it easier to focus on business logic and custom features. The post details a step-by-step guide to creating a Spring Boot CRUD application using Bootify, from project setup to code generation.

  4. 4
    Article
    Avatar of baeldungBaeldung·2y

    How to Mock Multiple Responses for the Same Request

    Learn how to use MockServer to simulate multiple responses for the same API request, particularly for a payment processing system. This setup helps test the application's polling mechanism without requiring actual backend services. The guide covers defining the payment request model, integrating with the bank's payment service, and validating the polling logic by mocking different payment statuses.

  5. 5
    Article
    Avatar of baeldungBaeldung·2y

    Caching Guide

    Caching enhances system performance by temporarily storing data from resource-intensive methods. This guide explores popular caching libraries like Caffeine, Ehcache, and JCache, and provides steps for implementing cache abstraction in Spring applications. Advanced topics include two-level caching configuration and the use of multiple caching managers within the same project.

  6. 6
    Article
    Avatar of baeldungBaeldung·2y

    Monitor Java Application Logs With Loggly

    This tutorial walks through configuring SolarWinds Loggly, a cloud-based log management tool, for Java applications using various logging libraries like Log4j and Logback. It demonstrates setting up accounts, configuring systems for log transport, and verifying the setup to enable efficient log monitoring and analysis.

  7. 7
    Article
    Avatar of baeldungBaeldung·2y

    Intellij Idea – How to Build Project Automatically

    IntelliJ IDEA supports automatic builds to streamline the development process. This tutorial explains how to enable the feature, helping to avoid manual compilation and ensuring continuous integration. Automatic builds can be especially beneficial when combined with features like hot reload for faster feedback cycles and better code maintenance.

  8. 8
    Article
    Avatar of baeldungBaeldung·2y

    Spring Boot 3 – Configure Spring Security to Allow Swagger UI

    Learn how to configure Spring Security to allow access to Swagger UI in a Spring Boot 3 application. This guide covers setting up the necessary dependencies, creating a simple controller, and configuring security using WebSecurityCustomizer and SecurityFilterChain to permit unauthenticated access to Swagger UI endpoints.

  9. 9
    Article
    Avatar of baeldungBaeldung·2y

    Introduction to Apache Commons Validator

    Learn the basics of Apache Commons Validator, a powerful Java library for simplifying data validation. Understand its use cases, such as form and API input validation, and how to set it up. Discover built-in validators for dates, numbers, and currencies, and explore practical code examples. The library ensures consistent and secure input validation across your application.

  10. 10
    Article
    Avatar of baeldungBaeldung·2y

    Filter a List by Any Matching Field

    Learn how to filter a List of objects in Java by checking if any of their fields contain a given String. This tutorial covers different approaches, including creating a String representation for full-text search and using reflection and recursion to dynamically search through an object's fields without explicitly knowing its structure.