<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/sources/baeldung/best-of/2025" -->

---
title: Best Baeldung posts of 2025 | daily.dev
description: The most upvoted Baeldung posts of 2025, curated by the daily.dev community.
canonical: https://daily.dev/sources/baeldung/best-of/2025
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:url: https://daily.dev/sources/baeldung/best-of/2025
og:type: website
og:site_name: daily.dev
og:title: Best Baeldung posts of 2025 | daily.dev
og:description: The most upvoted Baeldung posts of 2025, curated by the daily.dev community.
og:image: https://media.daily.dev/image/upload/s--VAY5ToZt--/f_auto/v1724209435/public/daily.dev%20-%20open%20graph
---

# Best of Baeldung — 2025

1. 1  
[](/posts/spring-boot-4-spring-framework-7-what-s-new-32sgv6roy "Spring Boot 4 & Spring Framework 7 – What’s New")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
11m read time • Sep 12, 2025  
### Spring Boot 4 & Spring Framework 7 – What’s New  
Spring Boot 4 and Spring Framework 7 introduce significant modernization updates including Java 17 baseline with Java 21/25 support, Jakarta EE 11 alignment, and Kotlin 2.2+ compatibility. Key features include enhanced GraalVM native image support, built-in API versioning, declarative HTTP clients with @HttpServiceClient, resilience annotations for retry logic, improved observability with Micrometer 2 and OpenTelemetry, modular architecture for better performance, and JSpecify null safety adoption. The releases also bring testing improvements with context pausing and RestTestClient, while removing deprecated javax.\* packages and Jackson 2.x support.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/86d3f473cc9c26d22d95b9bd9656549f?_a=AQAEulh)  
93
2. 2  
[](/posts/how-to-reduce-spring-boot-memory-usage--dsbmzxp6d "How to Reduce Spring Boot Memory Usage?")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
7m read time • Sep 04, 2025  
### How to Reduce Spring Boot Memory Usage?  
Spring Boot applications typically consume significant memory (150+ MB) due to JVM architecture, embedded server threads, and framework overhead. Memory usage can be reduced through JVM tuning (serial garbage collector, reduced thread stack size, RAM limits), configuring web server thread pools, container-aware deployment practices, and removing unused dependencies. Key techniques include using -XX:+UseSerialGC, -Xss512k for thread stacks, setting MaxRAM limits, reducing Tomcat threads to 20, and matching JVM flags to container limits.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/28069997fb2ccc0aa9a3501581a11d8b?_a=AQAEulh)  
82
3. 3  
[](/posts/how-to-convert-nested-loops-to-stream-in-java-gbvcmzea7 "How to Convert Nested Loops to Stream in Java")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
4m read time • Mar 11, 2025  
### How to Convert Nested Loops to Stream in Java  
Java Streams, introduced in Java 8, offer a declarative and efficient way to handle data by replacing complex nested loops. This post explores transforming nested loops into Streams, covering basic operations, filtering, and short-circuiting iterations. It highlights how streams can simplify complex transformations, improve readability, and enable parallel execution. However, for simple or performance-critical tasks, traditional loops may be more suitable.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/9fe6a7e1fed5dab6e32774e8bd9483c7?_a=AQAEuj9)  
78  
2
4. 4  
[](/posts/decreasing-intellij-ram-usage-haqrjtb31 "Decreasing IntelliJ RAM Usage")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
5m read time • Mar 11, 2025  
### Decreasing IntelliJ RAM Usage  
Learn how to decrease IntelliJ IDEA's RAM usage by optimizing memory settings, disabling unused plugins, adjusting garbage collection, and enabling Power Save Mode. These steps help improve performance and ensure a smoother development experience.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/bdf334823bf91642cdc4171ac4262e8c?_a=AQAEuj9)  
70  
3
5. 5  
[](/posts/thread-per-connection-vs-thread-per-request-hqm6sjwmh "Thread per Connection vs Thread per Request")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
8m read time • Apr 22, 2025  
### Thread per Connection vs Thread per Request  
This post compares two server threading models: thread-per-connection and thread-per-request. It defines the terms 'connection' and 'request', discusses their implementation in Java web servers, and highlights the advantages and disadvantages of each model. Thread-per-connection involves a dedicated thread for each client connection, while thread-per-request uses a new thread for each request, regardless of connection status. The choice between these models depends on factors like scalability, context switching, and expected traffic patterns.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/91a7b8855be955ba213e3c774a11bf10?_a=AQAEuj9)  
67
6. 6  
[](/posts/introduction-to-apache-kylin-vn61dev56 "Introduction to Apache Kylin")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
10m read time • Apr 20, 2025  
### Introduction to Apache Kylin  
Apache Kylin is an open-source OLAP engine designed for sub-second query performance on massive datasets. Initially developed by eBay and later managed by the Apache Software Foundation, it excels in handling high concurrency and integrates seamlessly with Hadoop and data lake platforms. Key features include multidimensional modeling, optimized indexing, and support for both batch and streaming data sources. The platform can be easily explored using Docker, allowing for straightforward setup, model creation, and CUBE building via SQL and REST API.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/91a7b8855be955ba213e3c774a11bf10?_a=AQAEuj9)  
63
7. 7  
[](/posts/introduction-to-jimmer-orm-vmry1v9x4 "Introduction to Jimmer ORM")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
8m read time • Jul 18, 2025  
### Introduction to Jimmer ORM  
Jimmer ORM is a new database framework that differs from JPA by requiring developers to specify data interaction details at the call site rather than through annotations. It uses interfaces as entities and relies heavily on DTOs for both reading and writing data. The framework includes a dedicated DTO language to reduce manual DTO creation overhead and supports multiple databases including MySQL, PostgreSQL, and Oracle. Unlike Hibernate, Jimmer doesn't implement dirty checking or traditional lazy loading, instead focusing on explicit data shape specification through DTOs and Object Fetcher APIs.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/9880ebb8ae54ad1c710ef3bf168d3e40?_a=AQAEulh)  
60
8. 8  
[](/posts/what-s-new-in-maven-4-9ldjprt7w "What’s New in Maven 4")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
6m read time • Dec 22, 2025  
### What’s New in Maven 4  
Maven 4 introduces significant improvements after 15 years since Maven 3\. Key updates include POM version 4.1.0, build/consumer POM separation for cleaner dependency resolution, new artifact types for explicit classpath and module path control, and renaming 'modules' to 'subprojects' to avoid confusion with Java modules. The release adds a tree-based lifecycle for better multi-project performance, before/after phase hooks, condition-based profile activation, and a unified sources section for custom source directories. An upgrade tool helps migrate from Maven 3, while maintaining backward compatibility with version 4.0.0 POMs.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/f3936b726a3720f3151636207d7cddad?_a=AQAEulh)  
57
9. 9  
[](/posts/introduction-to-restheart-wciogkl16 "Introduction to RESTHeart")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
8m read time • May 15, 2025  
### Introduction to RESTHeart  
RESTHeart is a Java-based framework designed to build HTTP APIs on top of MongoDB, automatically exposing collections as REST and GraphQL endpoints. It offers CRUD operations, role-based access, and authentication out of the box with minimal setup, providing a zero-code solution. This tutorial guides on running RESTHeart locally or via Docker, setting up authentication, and performing CRUD operations both through REST and GraphQL APIs.

+5  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/4eedca81982be4695ded7b84850a62ef?_a=AQAEuj9)  
56  
2
10. 10  
[](/posts/introduction-to-dicedb-zkgouahen "Introduction to DiceDB")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
5m read time • Jun 24, 2025  
### Introduction to DiceDB  
DiceDB is an open-source, high-performance in-memory database that offers Redis-like commands with modern features such as reactive queries. The tutorial covers installation via Docker, connecting through the DiceDB CLI, and performing basic operations like SET, GET, DEL, PING, ECHO, TYPE, and EXISTS commands. DiceDB runs on port 7379 by default and provides a developer-friendly experience for real-time applications with familiar key-value operations.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/bdf334823bf91642cdc4171ac4262e8c?_a=AQAEulh)  
48  
1
11. 11  
[](/posts/cleaning-spring-properties-files-yzssu9kga "Cleaning Spring Properties Files")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
8m read time • Jun 23, 2025  
### Cleaning Spring Properties Files  
Spring Properties Cleaner is a Maven plugin that automatically cleans up Spring application properties files by removing duplicates, standardizing formatting, sorting keys, and extracting common properties across multiple profile-specific files. The plugin can be configured to detect issues during builds, sort properties in clustered or alphabetical order, inline prefixes for better commonality extraction, and manage vertical whitespace. It supports three extraction modes (full, consistent, multiple) for promoting properties to a common application.properties file, helping maintain cleaner and more organized configuration files in Spring projects.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/47b54e24b3c193fdbb083fc322bb2b36?_a=AQAEulh)  
47
12. 12  
[](/posts/a-practical-guide-to-recordbuilder-in-java-fmgquvzpy "A Practical Guide to RecordBuilder in Java")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
6m read time • Jul 14, 2025  
### A Practical Guide to RecordBuilder in Java  
RecordBuilder is a Java library that enhances Java records with builder pattern functionality through annotation processing. It generates fluent builders, withX() methods, and consumer-based modification capabilities while maintaining immutability. The library eliminates boilerplate code for creating flexible object construction patterns and automatically stays synchronized with record structure changes, making it more maintainable than manual builder implementations.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/0aef58ddf52c2c440b51fefe6f0b7baa?_a=AQAEulh)  
45
13. 13  
[](/posts/implement-feature-flags-in-java-with-unleash-2edyut6fe "Implement Feature Flags in Java With Unleash")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
6m read time • Jan 30, 2025  
### Implement Feature Flags in Java With Unleash  
Feature flags, or feature toggles, enable the activation and deactivation of application functionalities without altering the codebase. Unleash is an open-source tool for managing these flags across multiple environments. This guide walks through setting up Unleash locally, configuring a feature toggle, and integrating them into a Java application using Spring Boot. The setup ensures features can be toggled in real-time, improving development cycles and enabling controlled feature rollouts.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/bdf334823bf91642cdc4171ac4262e8c?_a=AQAEuj9)  
41  
3
14. 14  
[](/posts/implementing-cqrs-with-spring-modulith-iuktcg12f "Implementing CQRS with Spring Modulith")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
9m read time • Aug 15, 2025  
### Implementing CQRS with Spring Modulith  
CQRS (Command Query Responsibility Segregation) separates write operations from read operations using different optimized models. Spring Modulith helps structure applications into loosely coupled modules organized by business capability rather than technical concerns. The implementation uses domain events for asynchronous communication between modules, with the command side handling ticket booking/cancellation and the query side managing movie searches and seat availability. Spring Modulith's @ApplicationModuleListener enables eventual consistency through the transactional outbox pattern, while jMolecules annotations clarify architectural roles.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/28069997fb2ccc0aa9a3501581a11d8b?_a=AQAEulh)  
37
15. 15  
[](/posts/how-to-run-a-java-program-in-the-background-rac50azgu "How to Run a Java Program in the Background")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
6m read time • Apr 15, 2025  
### How to Run a Java Program in the Background  
Learn various methods to run a Java application as a background process, keep it running after terminal closure, and monitor it using logs. Explore the use of '&' operator, nohup, systemd services, screen, and tmux for effective process management.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/f3936b726a3720f3151636207d7cddad?_a=AQAEuj9)  
36
16. 16  
[](/posts/introduction-to-netflix-hollow-ga3ukrmbi "Introduction to Netflix Hollow")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
7m read time • Dec 14, 2025  
### Introduction to Netflix Hollow  
Netflix Hollow is a low-latency Java framework for distributing data from a source to multiple targets using a producer-consumer model. The producer fetches data from external systems and publishes snapshots to file systems or object storage, while consumers read and process these snapshots. The framework efficiently manages memory by offloading large datasets to external storage, addressing Java heap space issues. Implementation involves defining entity classes with primary keys, setting up publishers and announcers for producers, generating consumer APIs using HollowAPIGenerator, and configuring announcement watchers and retrievers for consumers. The library handles snapshot versioning, updates, and notifications automatically.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/0aef58ddf52c2c440b51fefe6f0b7baa?_a=AQAEulh)  
34
17. 17  
[](/posts/event-driven-listen-notify-support-in-java-using-postgresql-alc4bthhq "Event-Driven LISTEN/NOTIFY Support in Java using PostgreSQL")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
8m read time • Jun 09, 2025  
### Event-Driven LISTEN/NOTIFY Support in Java using PostgreSQL  
PostgreSQL's LISTEN and NOTIFY commands enable asynchronous communication between database server and clients, creating a simple messaging system. The LISTEN command registers interest in receiving events on specific channels, while NOTIFY broadcasts messages to all listeners. Java applications can raise notifications using standard JDBC with either NOTIFY commands or pg\_notify() function. Listening for notifications requires driver-specific functionality - the official PostgreSQL JDBC driver requires polling with getNotifications(), while PGJDBC-NG provides callback-based listeners for more efficient event handling. This mechanism supports real-time dashboards, cache invalidation, and data auditing use cases.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/86d3f473cc9c26d22d95b9bd9656549f?_a=AQAEulh)  
34
18. 18  
[](/posts/stream-gatherers-in-java-phjuktyqe "Stream Gatherers in Java")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
8m read time • May 20, 2025  
### Stream Gatherers in Java  
Java 24 introduces the Gatherer interface, enhancing Java Stream APIs by allowing more flexible intermediate operations. Gatherers facilitate custom data transformations and support asynchronous processing. The article explores built-in Gatherers and demonstrates creating custom Gatherers for diverse input-output mappings, demonstrating how these can be used for one-to-one, one-to-many, many-to-one, and many-to-many relationships.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/0b75a36127a5c5dc73e173543a8471df?_a=AQAEuj9)  
30
19. 19  
[](/posts/how-to-implement-a-thread-safe-singleton-in-java--6czqr4waa "How to Implement a Thread-Safe Singleton in Java?")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
3m read time • Jul 15, 2025  
### How to Implement a Thread-Safe Singleton in Java?  
Explores multiple approaches to implementing thread-safe Singleton patterns in Java, including synchronized methods, eager initialization, double-checked locking, Bill Pugh pattern, and enum singletons. Compares their performance trade-offs and provides practical examples with test code to demonstrate thread safety in concurrent environments.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/f3936b726a3720f3151636207d7cddad?_a=AQAEulh)  
29
20. 20  
[](/posts/kafka-producer-and-consumer-message-acknowledgement-options-zjbdqvrom "Kafka Producer and Consumer Message Acknowledgement Options")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
8m read time • Jan 28, 2025  
### Kafka Producer and Consumer Message Acknowledgement Options  
The tutorial explains the acknowledgment options available for producers and consumers in Apache Kafka, detailing how the three producer acknowledgment modes (none, leader, and all) impact message reliability and system performance. It also covers essential consumer configuration properties, such as group ID, auto offset reset, enable auto commit, and auto commit interval, which affect consumer message processing and reliability. Understanding these options allows developers to balance performance and reliability for different use cases.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/91a7b8855be955ba213e3c774a11bf10?_a=AQAEuj9)  
27
21. 21  
[](/posts/introduction-to-smithy-sitms13cc "Introduction to Smithy")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
11m read time • Jul 27, 2025  
### Introduction to Smithy  
Smithy is an Interface Definition Language (IDL) developed by Amazon for describing APIs in a language and protocol-agnostic format. It enables automatic generation of both client SDKs and server stubs from API definitions, serving as a single source of truth. The tutorial covers defining resources, operations, and services using Smithy syntax, then demonstrates how to use Gradle plugins to generate Java client and server code. Smithy focuses on resource-based APIs and supports various protocols like JSON over HTTP, offering more opinionated structure compared to OpenAPI or RAML while providing flexibility in transport and serialization methods.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/91a7b8855be955ba213e3c774a11bf10?_a=AQAEulh)  
26
22. 22  
[](/posts/introduction-to-basex-1nrh7emqw "Introduction to BaseX")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
10m read time • Oct 28, 2025  
### Introduction to BaseX  
BaseX is a lightweight XML database that stores, queries, and manipulates XML data using XQuery and XPath. It offers multiple interfaces including a GUI, command-line tool, and HTTP REST API. The tutorial covers installation requirements (Java 17+), basic database operations (creating, opening, dropping databases), resource management (adding, deleting XML files), querying with XQuery, and HTTP server setup with authentication. The REST API enables programmatic access to databases and resources, supporting CRUD operations through standard HTTP methods.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/846b2ee21b04a0928def5bacf90cb876?_a=AQAEulh)  
22
23. 23  
[](/posts/integrating-jolokia-with-spring-boot-aj2phxrst "Integrating Jolokia With Spring Boot")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
4m read time • Mar 17, 2025  
### Integrating Jolokia With Spring Boot  
Learn how to integrate Jolokia with a Spring Boot application to monitor your application via API endpoints. This tutorial covers initial setup, basic commands for interacting with MBeans, and methods to secure Jolokia endpoints by restricting access through configuration.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/bdf334823bf91642cdc4171ac4262e8c?_a=AQAEuj9)  
22
24. 24  
[](/posts/introduction-to-ambassador-design-pattern-vkkbsvywd "Introduction to Ambassador Design Pattern")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
7m read time • Jun 21, 2025  
### Introduction to Ambassador Design Pattern  
The Ambassador Design Pattern acts as a network proxy between clients and servers, encapsulating networking components like retry logic, caching, timeouts, and circuit breakers in a reusable component. It can be implemented as a library dependency within the same container or as a separate sidecar container exposing REST APIs. The pattern promotes code reusability and maintainability by centralizing network communication logic, but introduces potential latency and availability concerns when deployed as a separate service.

+5  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/f65f2d0115cc21eb3c9faea29ed8298a?_a=AQAEulh)  
21
25. 25  
[](/posts/authorize-request-for-certain-url-and-http-method-in-spring-security-sim3hjf1u "Authorize Request for Certain URL and HTTP Method in Spring Security")  
[![baeldung's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576)](/sources/[source]/best-of/[year])  
7m read time • Jun 07, 2025  
### Authorize Request for Certain URL and HTTP Method in Spring Security  
Spring Security provides flexible mechanisms to authorize requests based on URLs, HTTP methods, and user roles. The tutorial demonstrates implementing role-based access control in a blogging platform where users can manage their own posts while admins have broader permissions. Key concepts include configuring SecurityFilterChain for URL-based authorization, using @PreAuthorize for method-level security, implementing custom UserDetailsService for database authentication, and creating service layers that enforce business logic with proper access controls. The implementation covers user registration, authentication, and CRUD operations with appropriate security constraints.

+5  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/ebafd2222608245ba4447db750943c20?_a=AQAEulh)  
21  
1

[See all Baeldung archives](/sources/baeldung/best-of)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","@id":"https://daily.dev/sources/baeldung/best-of/2025#page","url":"https://daily.dev/sources/baeldung/best-of/2025","name":"Best Baeldung Posts of 2025","description":"The most upvoted Baeldung posts of 2025, curated by the daily.dev community.","isPartOf":{"@type":"WebSite","url":"https://daily.dev"}},{"@type":"ItemList","@id":"https://daily.dev/sources/baeldung/best-of/2025#items","numberOfItems":25,"itemListElement":[{"@type":"ListItem","position":1,"url":"https://daily.dev/posts/spring-boot-4-spring-framework-7-what-s-new-32sgv6roy","name":"Spring Boot 4 \u0026 Spring Framework 7 – What’s New"},{"@type":"ListItem","position":2,"url":"https://daily.dev/posts/how-to-reduce-spring-boot-memory-usage--dsbmzxp6d","name":"How to Reduce Spring Boot Memory Usage?"},{"@type":"ListItem","position":3,"url":"https://daily.dev/posts/how-to-convert-nested-loops-to-stream-in-java-gbvcmzea7","name":"How to Convert Nested Loops to Stream in Java"},{"@type":"ListItem","position":4,"url":"https://daily.dev/posts/decreasing-intellij-ram-usage-haqrjtb31","name":"Decreasing IntelliJ RAM Usage"},{"@type":"ListItem","position":5,"url":"https://daily.dev/posts/thread-per-connection-vs-thread-per-request-hqm6sjwmh","name":"Thread per Connection vs Thread per Request"},{"@type":"ListItem","position":6,"url":"https://daily.dev/posts/introduction-to-apache-kylin-vn61dev56","name":"Introduction to Apache Kylin"},{"@type":"ListItem","position":7,"url":"https://daily.dev/posts/introduction-to-jimmer-orm-vmry1v9x4","name":"Introduction to Jimmer ORM"},{"@type":"ListItem","position":8,"url":"https://daily.dev/posts/what-s-new-in-maven-4-9ldjprt7w","name":"What’s New in Maven 4"},{"@type":"ListItem","position":9,"url":"https://daily.dev/posts/introduction-to-restheart-wciogkl16","name":"Introduction to RESTHeart"},{"@type":"ListItem","position":10,"url":"https://daily.dev/posts/introduction-to-dicedb-zkgouahen","name":"Introduction to DiceDB"},{"@type":"ListItem","position":11,"url":"https://daily.dev/posts/cleaning-spring-properties-files-yzssu9kga","name":"Cleaning Spring Properties Files"},{"@type":"ListItem","position":12,"url":"https://daily.dev/posts/a-practical-guide-to-recordbuilder-in-java-fmgquvzpy","name":"A Practical Guide to RecordBuilder in Java"},{"@type":"ListItem","position":13,"url":"https://daily.dev/posts/implement-feature-flags-in-java-with-unleash-2edyut6fe","name":"Implement Feature Flags in Java With Unleash"},{"@type":"ListItem","position":14,"url":"https://daily.dev/posts/implementing-cqrs-with-spring-modulith-iuktcg12f","name":"Implementing CQRS with Spring Modulith"},{"@type":"ListItem","position":15,"url":"https://daily.dev/posts/how-to-run-a-java-program-in-the-background-rac50azgu","name":"How to Run a Java Program in the Background"},{"@type":"ListItem","position":16,"url":"https://daily.dev/posts/introduction-to-netflix-hollow-ga3ukrmbi","name":"Introduction to Netflix Hollow"},{"@type":"ListItem","position":17,"url":"https://daily.dev/posts/event-driven-listen-notify-support-in-java-using-postgresql-alc4bthhq","name":"Event-Driven LISTEN/NOTIFY Support in Java using PostgreSQL"},{"@type":"ListItem","position":18,"url":"https://daily.dev/posts/stream-gatherers-in-java-phjuktyqe","name":"Stream Gatherers in Java"},{"@type":"ListItem","position":19,"url":"https://daily.dev/posts/how-to-implement-a-thread-safe-singleton-in-java--6czqr4waa","name":"How to Implement a Thread-Safe Singleton in Java?"},{"@type":"ListItem","position":20,"url":"https://daily.dev/posts/kafka-producer-and-consumer-message-acknowledgement-options-zjbdqvrom","name":"Kafka Producer and Consumer Message Acknowledgement Options"},{"@type":"ListItem","position":21,"url":"https://daily.dev/posts/introduction-to-smithy-sitms13cc","name":"Introduction to Smithy"},{"@type":"ListItem","position":22,"url":"https://daily.dev/posts/introduction-to-basex-1nrh7emqw","name":"Introduction to BaseX"},{"@type":"ListItem","position":23,"url":"https://daily.dev/posts/integrating-jolokia-with-spring-boot-aj2phxrst","name":"Integrating Jolokia With Spring Boot"},{"@type":"ListItem","position":24,"url":"https://daily.dev/posts/introduction-to-ambassador-design-pattern-vkkbsvywd","name":"Introduction to Ambassador Design Pattern"},{"@type":"ListItem","position":25,"url":"https://daily.dev/posts/authorize-request-for-certain-url-and-http-method-in-spring-security-sim3hjf1u","name":"Authorize Request for Certain URL and HTTP Method in Spring Security"}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sources","item":"https://daily.dev/sources"},{"@type":"ListItem","position":3,"name":"Baeldung","item":"https://daily.dev/sources/baeldung"},{"@type":"ListItem","position":4,"name":"Best of","item":"https://daily.dev/sources/baeldung/best-of"},{"@type":"ListItem","position":5,"name":"2025"}]}]}
```

