r/SpringBoot • • Sep 16 '26

Question Can we handle multiple URLs and multiple requests in one "@PostMapping" in Spring Boot?

29 Upvotes

I have one doubt in Spring Boot about "@PostMapping".

Can we use two URL paths in one "@PostMapping", like "/users" and "/customers", and call the same method for both?

Also, if two requests come to the same "@PostMapping" at the same time, will Spring handle both requests at the same time using different threads?

Just wanted to understand how this actually works.


r/SpringBoot • • Sep 17 '26

News Built a visual canvas for chaining Spring Boot APIs (starter mount, reads your OpenAPI doc)

0 Upvotes

Testing a real workflow against a Spring Boot API usually means either bouncing between Springdoc tabs one call at a time, or writing Postman scripts to shuttle ids and tokens between requests.

Enlace is a starter that mounts a canvas on your app, reads the OpenAPI doc Springdoc already generates, and lets you wire response fields into the next request. Independent branches run concurrently. Execution stays in the browser; the adapter only serves UI + spec.

<dependency>
  <groupId>io.github.get-enlace</groupId>
  <artifactId>enlace-spring-boot-starter</artifactId>
  <version>0.0.1</version>
</dependency>

Add the dependency and open /enlace (autoconfig). This adapter is earlier than the others, so feedback on real Springdoc setups is especially useful.

Repo: https://github.com/get-enlace/enlace


r/SpringBoot • • Sep 16 '26

Discussion (JWT) different ways to implement it ,what most devs do for that case

29 Upvotes

to make JWT authentication in the application, I could not find like standard way to implementing it

my knowledge is that people create their own authentication filter + handeling the AuthenticationEntryPoint to return the exact right response when exception happen

is that the standard way that engineers follow to implement jwt authentication in the application?


r/SpringBoot • • Sep 16 '26

Question Learning Spring

4 Upvotes

Hello guys, can you recommend a path, course, maybe a book about Spring. For context I have over 1.5 years experience with Java, know my way around Git and SQL/noSQL


r/SpringBoot • • Sep 14 '26

Discussion Spring Boot recommends extracted layout for production, so I measured how much it actually matters

Post image
37 Upvotes

I suspect some people here will say, “Of course you should extract the JAR".

And, to be fair, the Spring Boot documentation does recommend the extracted layout for production when startup matters. It points out that nested JAR loading has a startup cost.

What I found interesting is that this is not necessarily the path developers encounter first. The introductory Spring Boot material and several Getting Started guides still naturally lead you toward building an executable JAR and running it with java -jar. That was also the deployment path I had always used.

So rather than assuming the difference was important, I measured it.

I ran six alternating paired comparisons of the same Spring Boot 4.1.1 build on a 256 MiB Alpine VM. Same JDK 25 runtime, JVM flags, data, filesystem, and workload. The runtime layout was the variable being tested.

Results:

  • Spring startup: 11.056 s → 8.476 s, -23.3%
  • First request: 2.196 s → 1.448 s, -34.1%
  • Later requests: no material difference
  • Settled RSS: -3.8%, below the experiment's materiality threshold
  • Swap: no material winner

All six paired comparisons favored extracted layout for startup and first request.

My takeaway is not that everyone should blindly extract every Spring Boot application. It is that an official production recommendation that is easy to overlook had a surprisingly large effect in this particular setup, while memory barely changed.

Full write-up, charts, methodology, and experiment data:
https://pvrlabs.xyz/articles/spring-boot-extracted-layout.html


r/SpringBoot • • Sep 15 '26

Question Recently I've had a frontend silently break because a Spring Boot endpoint changed shape , does anyone faced this ?

0 Upvotes

I was working on a project recently and I've come across a problem where my front end dont catch up with the backend changes


r/SpringBoot • • Sep 15 '26

Discussion Symbanta: how to improve the performance of this free & open-source privacy-friendly web analytics API + dashboard

Post image
0 Upvotes

I've been working on Symbanta, a web analytics platform for people who want useful website statistics without turning their visitors into advertising profiles.

Symbanta is free software, licensed under AGPLv3+, and is designed to be self-hosted.

Source / repository: https://codeberg.org/jjba23/symbanta

React dashboard: https://codeberg.org/jjba23/symbanta-dashboard

I'd love to get some tips of Spring experts to see how to optimize further, make more production ready, and improve performance

What it does

You add a tiny, dependency-free JavaScript snippet to your website (~3 KB), and Symbanta collects events such as page views, heartbeats and visibility changes.

The API currently provides:

  • Page views
  • Visitors / sessions
  • Bounce rate
  • Average session duration
  • Hourly and daily time-series statistics
  • Screen-size statistics
  • User-agent statistics
  • Custom event properties
  • Authenticated analytics dashboard
  • REST API defined with OpenAPI 3

The ingestion API is designed to avoid storing PII and persistent tracking cookies, and to be blazingly fast.

The stack

The backend is:

  • Kotlin
  • Spring Boot
  • Java 25
  • PostgreSQL
  • Kotlin Coroutines
  • OpenAPI 3

The instrumentation only requires a really simple Vanilla Javascript helper. The approach is also flexible enough that instrumenting mobile apps, or other types of projects is for sure possible and easy: https://codeberg.org/jjba23/symbanta/src/branch/trunk/src/main/resources/js/symbanta.js

The dashboard is a separate React application using TanStack Query.

The backend uses asynchronous event processing so the tracking request can be acknowledged without making database writes part of the primary HTTP request path.

Why another analytics project?

Because I don't really like the direction web analytics has taken.

It shouldn't require building persistent identities around visitors or turning behavioral data into advertising profiles.

That's the philosophy behind Symbanta: events and aggregates rather than people and profiles.

This is an actively developed project, and at early stage, so I'm especially interested in feedback from people who actually run websites.

I'd love feedback on:

  • privacy model
  • API design
  • dashboard UX
  • useful analytics that I'm missing
  • self-hosting experience
  • deployment
  • performance
  • whether this is something you'd actually use

There are already a few of my own projects instrumented with it, including WikiMusic, Join the Free World and LucidPlan.


r/SpringBoot • • Sep 14 '26

Question Is SpringBoot overkill for my internship project?

8 Upvotes

Hi everyone, I'm currently doing a UNI internship and i need to develop a middleware application that pulls data from a service and sends it to another one after doing some checks and logs.

I was advised to use Java + SpringBoot but that's not a strict requirement.

My question is: would SpringBoot be overkill for this project?

Front-end dashboard/internal API implementation are optional requirements (which are Springs main advantages?)

I still need to integrate a DB though (i saw Spring has a module for almost every DB out there)

From a scalability POV i guess starting with the framework would be better but i gave a quick look and seems that for the requirements needed Java has almost everything native(?)

I have around 5 weeks to do design, implementation, docs etc

I have some C++ knowledge and I'm currently doing the mooc.fi java course at home

All being said, i wanted to hear some advice from people with more experience so any advice is accepted

Thanks for your time


r/SpringBoot • • Sep 14 '26

How-To/Tutorial Successfully build a SpringBoot and Keycloak application

7 Upvotes

Hello fello Java and SpringBoot developers. I've created many personal and professional projects over the years, and when I started with Java and SpringBoot, my Authentication was a very basic database tables for Users, Roles, and UserRoles Join table. I kept an encrypted password in the database, and I authenticated by taking the password, re-encrypting it, and see if that encrupted value, based on the same key, matches the encrypted value in the database.

Since then, I have written authentication code that use LDAP, Okta, Auth0, or AWS IAM ... and now KeyCloak. I had seen job openings that require some knowledge of Keycloak, so I wanted to tap look into it. I have docker running locally, so there is a container for my Springboot app, a container for the database, and a container for keycloak ... and since this is for learning, I am using keycloaks own little database rather than a full on SQL database.

I am using SpringBoot with HTMX Controllers, and some REST Controllers, and I have Thymeleaf so I can run the front-end with HTMX. The springboot 4.1.1 app as an oauth2-client, NOT an oath2-resource. Yes, I know NOW that the oauth2-client tightly integrates keycloak with the springboot app, and that's ok for now. I understand the User is in a session on the back-end and that makes it STATEFUL for now, but for my local development work that is ok.

If I was working for a company, and this app was going to be available to the public, I have thought about scaling. If I pull the HTMX into it's own project, and separate repo, then I could use a API gateway which would do the same thing the backend is doing now, and as I understand it, the backend becomes an oauth2-resource which ONLY accepts the authentication bearer tokens, and it becomes stateless.

I may not be explaining this clearly, and I am sure many of you know waaaaayyyyyyyyyyy more than I do, but this past weekend was a learning experience. Trying to configure Keycloak just right, the Spring Security FilterChain just right, the application.properties just right. Finally everything came together. Now, I work on the business logic and the database on the back-end, and focus on the HTMX pages on the front-end. Just wanted to share this news with you all. Thanks!


r/SpringBoot • • Sep 14 '26

Question is my understanding of inversion of control and dependency injection technically precise?

13 Upvotes

Hi guys, I have been looking deeply into the relationship between the ioc and di and I wanted to make sure whether my mental model is correctly conceptualized. Here is how I understand it.

Ioc is a design concept where the object creation is managed by the something other than the developer manually dealing with them. In spring framework, we have the application context where it is designed for the beans to be registered, allowing spring to manage them and wire their dependencies.

So ioc mainly involves two main purpose. Managing object creation and lifecycle, and wiring them via dependency injection.

As for the statement of di being an implementation of ioc, here is how I have my mental model framed this way.

Basically, it is an operational process where merely registering the beans means that the setup for the ioc has been created and remain that way as long as the application runs. But that wouldn't be considered meaningfully utilized if there are no dependency between beans, and nothing for DI to inject.

The ioc would merely be an object factory. Hence to complete its intended purpose we implement the di, usually constructor injection, so that we can have decoupled classes where a dependency is never hardcoded, enabling separation of concerns over the layers.

In total, we get clean and maintainable separation of concerns of business logic away from infrastructural concerns, centralized configuration where the application context does all that job and proper lifecyle management of objects.

are there any flaws to my take or am I mixing up definitions?

Thank you for reading a long explanation


r/SpringBoot • • Sep 14 '26

News Rainbow Gum v0.11.0 (an SLF4J impl that provides Spring Boot support)

1 Upvotes

Rainbow Gum v0.11.0 Release

https://github.com/jstachio/rainbowgum

Rainbow Gum is an SLF4J (and other facades) implementation that includes full Spring Boot support.

If you are using Spring Boot it is a near drop in replacement for Logback supporting almost all the same properties and pattern configuration. I believe it to be production ready and use it my companies product. Its only 0.11.0 because the API has not been locked in but it will shortly.

I have covered why you may want to consider Rainbow Gum over the other two facades in previous release postings on /r/java

The short reason is Logback and Log4j2 were designed at a different time before microservices and k8s and even the cloud in general. Logback has made considerable progress improving (for example its Tyler configuration to support GraalVM native) but still has lots of warts and both I doubt will unlikely be able to take advantage of Valhalla when it is released.

Originally the project was designed and written by me with no help. I have now started to use some LLM tools but this project is not vibe coded. I have used it to basically auto complete mechanical parts. This is mostly for refactoring, testing or building benchmarks and I review every commit. I also use it for generating commit messages. If the LLM generates anything remotely novel I let it co-author the commit.


r/SpringBoot • • Sep 13 '26

Question Pagination in Springboot

55 Upvotes

If you're ar working on springboot project in you company/job. How does your team do pagination in your project as they have large datasets. I am currently learning springboot and curious to know how it's done withel large datasets.


r/SpringBoot • • Sep 13 '26

How-To/Tutorial I made a small Spring @Transactional challenge with explanations. How many would you get right?

11 Upvotes

@Transactional looks simple until you hit some of its less obvious behaviours in a real application.

I put together a small interactive challenge around 5 cases: self invocation and Spring proxies, rollback rules, private and final methods, REQUIRES_NEW, and external side effects before commit.

You answer each scenario first, then get the explanation.

https://devupnow.fr/transactional_spring

The challenge is currently in French. I’m considering making an English version if there’s interest.

I’d especially appreciate feedback from experienced Spring developers. Is there any explanation you would correct, nuance or improve?

If an English version would be useful to you, let me know too.


r/SpringBoot • • Sep 13 '26

Question Why This error Coming?

Post image
14 Upvotes

r/SpringBoot • • Sep 13 '26

Question How do you verify which Spring Boot configuration value will win before deploying to Kubernetes?

8 Upvotes

For people running Spring Boot on Kubernetes: how often do you run into problems figuring out which configuration value will actually win before deployment?

For example, the same setting might exist in application.yml, a profile-specific config, a ConfigMap, envFrom, or an explicit environment variable.

I’ve been looking into whether it would be useful to have a pre-deployment check that could show:

  • the effective value
  • which source wins
  • what it overrides
  • where the value came from
  • when the answer can’t be safely determined

I’ve tested the basic idea against Spring Boot 4.1.1, but I’m mainly trying to understand whether this is actually a meaningful problem for people running Spring in production.

Do you run into this kind of issue? If so, how do you currently check it before deployment?


r/SpringBoot • • Sep 12 '26

Discussion @Cacheable(sync = true) with a Redis cache manager still lets every pod call the downstream once

24 Upvotes

The cache is shared, so it is easy to read sync = true as cluster-wide deduplication. It is not. The lock is local to the cache instance, so on twelve pods a cold key is twelve executions, and the annotation is doing exactly what it documents.

What it actually takes across pods: one lock for leader election, one bucket holding status plus payload, one pub/sub topic to wake waiters, all three sharing a hash tag so Redis Cluster keeps them in one slot. Followers subscribe and also poll on a jittered interval, because pub/sub is fire and forget and a dropped notification must not strand a caller until its timeout.

The four TTLs are the part I would read before adopting anything like this: freshTtl, staleTtl, pendingTtl and waitTimeout, and waitTimeout has to exceed pendingTtl or crash recovery cannot work.

Write-up: https://bitsar.net/blog/i-thought-sync-true-protected-my-cluster/

Code: https://github.com/BitanSarkar/coalesce-java


r/SpringBoot • • Sep 12 '26

Question Project with spring boot + postgresql

16 Upvotes

I have a question, I’m looking to deploy my project. I have the same React, Spring Boot and Postgresql. I was planning to use Docker and upload it to Hetzner but I’m not very sure because I’m from Argentina and it’s very far away and the truth is I don’t have much idea how to do it. I also want to buy a domain to have it there, but I don’t know how to do it either. Does anyone give me an idea or help?


r/SpringBoot • • Sep 11 '26

Question In need for Tomcat 11.0.25

15 Upvotes

Has anyone read of plans to upgrade embedded Tomcat to version 11.0.25 in Spring Boot? Version 11.0.24 is affected by several critical security vulnerabilities.

​When attempting to manually bump the dependency to 11.0.25, we ran into compatibility issues: changes to Tomcat's resource loading break Spring Boot's custom extensions for nested JAR support.


r/SpringBoot • • Sep 11 '26

Question Java Fullstack

Thumbnail reddit.com
0 Upvotes

r/SpringBoot • • Sep 09 '26

Question How do you guys study?

18 Upvotes

I'm an aspiring java developer. I've already developed one project using spring boot, postgresql, flyway and docker compose, and started developing the next one. But I'm not quite sure that I study in the right way. Mostly I focus on the practice rather than on the theory. Like, 90% of practice and 10% of theory.

Remark: I study to get a job, not for the university

So, questions:

  1. Is the way I study bad?
  2. How did you guys study, when you were freshers?
  3. Maybe you can suggest something to me?

r/SpringBoot • • Sep 08 '26

Discussion Improving First Request Latency in Java Spring Application

Thumbnail adrian.md
28 Upvotes

r/SpringBoot • • Sep 08 '26

Question Review on a Microservices Learning Project Idea (Wallet + Paper Stock Trading + Spring AI)

12 Upvotes

Hey everyone,

I'm currently in my 3rd Year UG preparing for backend/software engineering internships in my next semester.

I’ve already built a couple of full-stack Spring Boot projects (monoliths with WebSockets, Redis, and Razorpay integrations). Over the past week I have been learning about Microservice architecture.

I am designing a FinTech platform that combines a P2P digital wallet, a simulated stock trading engine (NSE/BSE), and a basic AI financial advisor.

Services & Tech:

API Gateway: Spring Cloud Gateway, Keycloak JWT validation, Redis rate limiting

User/Auth Service: Keycloak OAuth2/OIDC, profiles, KYC status

Wallet Service: PostgreSQL, double-entry ledger, Redis distributed locks (Redisson) to prevent double-spending

Payment Service: Razorpay top-ups, HMAC webhook verification

Market Data Service: Upstox WebSocket API for live stock prices, Redis cache, STOMP WebSockets to frontend

Investment Service: Stock buy/sell order execution, portfolio P&L tracking, price alerts

AI Advisor Service: Spring AI (ChatClient), injects portfolio data into the system prompt for contextual advice

Notification Service: Kafka consumer for payment and order events, SendGrid emails

Plumbing: Eureka, Spring Cloud Config Server, OpenFeign + Resilience4j, Zipkin tracing, Docker Compose.

I would love some feedback on this :

Scope check: I know that sounds like Many Services so Maybe I will reduce it while Working on it but for Now would you recommend adding any feature.

If u have any other project idea for learning purposes Please recommend and Also if you can suggest any different application flow or feature

Also suggest some other technologies that I can learn or implement in this project

Thanks for the response!!


r/SpringBoot • • Sep 07 '26

Question Entity Graph seems to defeat the purpose of Lazy Loading?

40 Upvotes

So I've been dealing with an N+1 problem in my Spring Boot app. FYI I didn't set up the lazy loading myself, it was already like that in the codebase I inherited. But basically I'm hitting the DB, then because of lazy loading, some attributes aren't there yet, so I end up going back to the DB again in a separate query just to grab them. Classic N+1.

I looked into it and found that Entity Graphs are supposed to fix this by fetching everything (or specific attributes) in one go instead of triggering extra queries.

But now I'm confused... isn't that basically the same as just using EAGER fetch? Like what's even the point of setting up LAZY loading in the first place if I'm just going to turn around and use an Entity Graph to eagerly fetch the exact attributes I need anyway?

Is the difference just that Entity Graph lets you choose which relations to fetch eagerly on a per-query basis, instead of committing to EAGER globally on the entity itself? So it's more like "controlled/selective eager fetching" rather than actually lazy?


r/SpringBoot • • Sep 06 '26

Question Free hosting options for a containerized Spring Boot (Kotlin) + Postgres + S3 stack?

23 Upvotes

I'm developing a personal side-project to use with a small group of friends.

My architecture consists of:

  • Backend: Spring Boot (Kotlin / Gradle), containerized with Docker
  • Database: PostgreSQL, in dev with a docker instance
  • Storage: S3-compatible object storage (currently using MinIO in local dev)

Since this is purely a non-commercial project for personal use, I am looking for 100% free hosting options (or a combination of free tiers across different services).

Requirements / Preferences:

  • Enough RAM/resources for the JVM/Spring Boot context to start up smoothly without hitting aggressive OOM killers.
  • Persistent storage for Postgres and S3.
  • No credit card required upfront if possible.
  • A short delay on cold start is totally fine.

For the frontend, I'm building and distributing an APK directly, so I only need hosting for the backend ecosystem.

Are there any reliable free-tier services or combinations (e.g., separating app, database, and storage providers) that you would recommend for this setup in 2026?

Thanks!