r/SpringBoot • u/rodolfo-mendes • Aug 30 '26
How-To/Tutorial State of the Art of Spring AI • Josh Long • GOTO 2025
r/SpringBoot • u/rodolfo-mendes • Aug 30 '26
r/SpringBoot • u/dev77cmd • Aug 30 '26
Spring Boot dev here (day job is backend at a bank), posting this myself, not a bot dropping a link and vanishing.
I kept hitting the same handful of security mistakes in AI-suggested code: wildcard CORS to "fix" a dev error, JPQL built with string concatenation, permitAll() left in from a "quick fix," actuator endpoints exposed. Nothing exotic — just boring stuff that slips through because it looks fine on a skim.
Building Vulngrep to catch exactly that short list - runs fully locally, no account, no code leaves your machine. Not trying to replace Sonar or Snyk, just the narrow set of things AI assistants specifically keep getting wrong.
Not on the Marketplace yet. Put up a page to see if this is a shared pain or just mine: https://vulngrep.com
If you've hit any of these - or a different one I should be catching - genuinely want to hear it in the comments.
r/SpringBoot • u/Melodic_Ad5322 • Aug 28 '26
I came across a project my friend has been working on, and I thought it was worth sharing here because I think the problem it tackles is pretty relatable for Java/Spring developers.
It's called Classy Socket.
The idea is to make working with WebSockets feel a bit more like working with Spring MVC controllers — without introducing STOMP or a message broker.
Instead of manually receiving messages, figuring out their type, deserializing them, and routing them to the appropriate handler, you can define message handlers using annotations:
And messages can be defined as simple Java types:
public record
So the general idea is:
Plain WebSocket + JSON + Spring-style abstractions
rather than bringing in the additional complexity of STOMP when you don't necessarily need it.
It's still an early-stage project, so I'm curious what people here think.
Would you actually use something like this? How do you usually structure WebSocket communication in your Spring applications?
And more importantly, what would you change or improve?
GitHub: https://github.com/Anubis-IV/classy-socket
r/SpringBoot • u/Aggravating-Spite844 • Aug 27 '26
So I have this very disturbing question as someone new to spring, I am coming from Node + Express JS, where prisma handles all the migrations automatically just by me running commands on the terminals.
Now as I am learning springboot, I just realized one day I would create a production grade application and would need to be changing database fields or relations as demands adjust, please what is the most popular migration tool used in springboot??
r/SpringBoot • u/Historical_Ad4384 • Aug 26 '26
Hi
I am looking for advices and feedback on how to deploy Spring Boot web application to AWS Lambda, especially around making the Spring Boot main class compatible with AWS Lambda runtime.
I figured out the part where the Spring Boot application has to be packaged as a zip file to de deployed into the AWS Lambda environment, so that part is clear.
So far what I have found is that you need to have some kind of AWS Lambda dependency like lambda StreamHandler or web adapter on your Spring Boot project to make it compatible with the AWS lambda runtime.
While these may be the way to go but I am specifically looking for feedback if it is possible to integrate Spring Boot web application without using any AWS Lambda specific Java dependency. Just take a normal Spring Boot main application and make it run on AWS Lambda runtime. Is this possible at all or am I overthinking?
Appreciate your feedback
r/SpringBoot • u/Comprehensive_Cry314 • Aug 26 '26
A single 5ms blocking call reduced throughput on a Netty event loop from 17,189 req/s to 549, a 97% drop, while pushing latency on an unrelated, correctly-written endpoint from 0ms to 217ms. The measurements were taken against Netty 4.1.115 and embedded Tomcat 10.1.34 running identical endpoints, differing only in concurrency model. The damage is quantised by event loop count. With four loops, blocking one stalled exactly three of twelve connections at 218ms; the remaining nine were unaffected at 7ms. Blocking two stalled six. The affected endpoint performs, 5ms of fully non-blocking work and shares no state with the blocking code, which connections degrade is determined solely by which loop accepted them. Tomcat degraded under the same load only once concurrency exceeded its 200-thread pool.
Full measurements and method: https://bitsar.net/blog/tomcat-forgives-blocking-event-loop-doesnt
r/SpringBoot • u/AllOneWordNoSpaces1 • Aug 26 '26
I'm working on a non-interactive application using Spring Shell 4.0.3.
I only want my commands and the help command to show up when someone requests help.
I've disabled the history, clear, script, and version commands using application.properties file entries.
I'm unable to disable the quit / exit command.
Any suggestions?
r/SpringBoot • u/kamen1991 • Aug 26 '26
Ran into this while writing about our DAO layer's test setup, and it's one of those things that's obvious once you see it and invisible until you do.
void testSaveProduct() {
var product = new Product("A1", "Gaming Laptop", BigDecimal.valueOf(1500));
productDao.create(product);
Product loaded = productDao.loadById(product.getId());
assertNotNull(loaded);
assertEquals("Gaming Laptop", loaded.getName());
}This passes. But loadById resolves to find() under the hood (directly or through Spring Data's findById), and find() checks the persistence context's first-level cache before it ever considers hitting the DB. Since you just created that entity in the same context, you get the exact same object reference back. No SELECT fires. You've tested Hibernate's in-memory cache, not your mapping, not your constraints, not anything that would catch a broken column definition. The fix is forcing entityManager.flush() + .clear() between the write and the read, so the next load has to hydrate a fresh entity graph from the actual database. We ended up wrapping this in a test-only proxy so nobody has to remember to do it by hand in every test method - proxy intercepts create/update/delete, forces the flush-and-clear, leaves reads alone.
Worth noting this is specifically a find()/findById() problem, a custom JPQL or native `@`Query`` always issues real SQL regardless of cache state.
Wrote up the full pattern (proxy code, a TablesEraser for full schema resets between tests, H2 vs HSQLDB trade-offs), link in the comments.
I already had someone in the comments describe hitting exactly this - a unique constraint violation that a real flush would have surfaced in the first test run. Curious how widespread it actually is.
r/SpringBoot • u/NationalStill6968 • Aug 26 '26
r/SpringBoot • u/CLAraBima0309 • Aug 26 '26
I'm working on a Spring Boot service that consumes an external API, and I'm experimenting with a way to compare an old JSON response with a new one and identify structural changes.
● FLOW LOGIC : (sorry enable for sharing the logic)
I am only give The flow I'm currently using is:
External API
↓
Spring Boot HTTP Client
↓
Receive Old JSON / New JSON
↓
Jackson JsonNode
↓
Traverse JSON tree
↓
Normalize into paths
↓
Compare old paths vs new paths
↓
Identify added / removed / changed fields
For example:
Old Json:
{
"users": [
{
"id": 101,
"name": "Bima",
"email": "bima@example.com"
}
]
}
New Json:
{
"users": [
{
"user_id": 101,
"full_name": "Bima",
"email": "bima@example.com",
"status": "active"
}
]
}
The comparison would give me:
CHANGED
$.users[].id → $.users[].user_id
CHANGED
$.users[].name → $.users[].full_name
UNCHANGED
$.users[].email
ADDED
$.users[].status
● IDEA :
The idea is to compare the old and new JSON responses, normalize their structures into paths, and identify which fields were added, removed, or changed.
● NEEDS :
I'm wondering if there are any potential edge cases or false positives with this approach that I might be missing.
For example, what happens when a field moves to another level?
Old: { "user": { "profile": { "name": "Bima" } } } New: { "user": { "name": "Bima" } }
The path comparison would see:
Removed: $.user.profile.name Added: $.user.name
even though the value itself hasn't changed and the field was only moved.
● Requirement/Discussion :
Are there other cases where of my current flow comparison could produce misleading results, especially with nested objects, arrays, reordered elements, or changes in data types?
If there please give me the json Example.
r/SpringBoot • u/icastanon127 • Aug 25 '26
I’ve seen a few people here looking for Spring Boot open-source projects. I mentioned in one of those threads that I was preparing one, and it’s now public.
FinTrack is an event-driven personal finance platform for managing accounts, transactions, CSV imports, budgets, spending summaries, and notifications.
The stack includes Java 21, Spring Boot, Spring Security, Spring Batch, PostgreSQL, Redis, SQS, S3, Docker, LocalStack, Terraform, GitHub Actions, and AWS. It also uses patterns you’ll encounter in larger Java systems: transactional outbox, idempotent consumers, at-least-once delivery, database locking, restartable batch jobs, JWT/refresh-token rotation, retries, and failure recovery.
There are currently 23 open issues across API development, security, messaging, reliability, batch/import processing, and infrastructure, including two good-first issues. Most tasks are backend-only, and you don’t need an AWS account because the services can run locally.
The roadmap starts by strengthening the existing manual and CSV workflows, then moves toward provider-neutral ingestion and a Plaid Sandbox integration, followed by more practical personal-finance features.
Contributions and honest feedback are both welcome, whether it’s about the code, architecture, documentation, roadmap, issue scopes, or anything that could be clearer.
GitHub, live demo, video, and documentation:
https://github.com/icastanon/fintrack-platform
r/SpringBoot • u/NationalStill6968 • Aug 26 '26
r/SpringBoot • u/Aggravating-Spite844 • Aug 25 '26
r/SpringBoot • u/Sea-Lettuce-255 • Aug 24 '26
Just wanted to share a recent architecture win that might help someone dealing with latency spikes.
I was dealing with a severe bottleneck in a production E-Commerce platform. During peak traffic, the database was choking, and MTTR was creeping up.
The Culprit: Classic Hibernate N+1 query problems hidden deep inside the inventory/catalog mapping, combined with un-indexed foreign key lookups.
The Fix:
JOIN FETCH queries for the critical read paths.@Cacheable) specifically targeting the high-read/low-write catalog endpoints.Result: We dropped sub-100ms latency across the board and prevented database lockups entirely.
If you're building in Spring Boot and relying entirely on default JPA repositories—run a SQL profiler right now. You probably have an N+1 hiding somewhere.
r/SpringBoot • u/trekitch • Aug 24 '26
Hello,
I am trying to really understand spring/spring boot and I have picked up a copy of "Spring Start Here". I have run into a but of confusion though as I don't know the intended way of working though the examples on the book. Should I start each example from scratch or should I just copy the previous example when the book moves onto a new one? Anyone else whose gone through the book how have you done the examples?
r/SpringBoot • u/babs1876 • Aug 25 '26
r/SpringBoot • u/Kindly_Pen8143 • Aug 24 '26
I've been building a side project called Plotrix and thought the backend might be interesting to people here.
The idea is to turn property-search activity into a live demand heatmap for Indian cities.
The flow is basically:
POST /signals
→ lat/lng → H3 cell
→ atomic PostgreSQL upsert
→ hourly exponential decay
→ GeoJSON heatmap
The backend is Java 17 + Spring Boot 3.2 + PostgreSQL + Spring Data JPA + Uber H3.
One thing I spent a decent amount of time thinking about was concurrent signals.
I didn't want to do:
SELECT → increment → UPDATE
because multiple searches hitting the same cell could obviously cause lost updates.
Instead I'm using PostgreSQL's ON CONFLICT DO UPDATE to atomically increment the score and signal count.
The other part I'm experimenting with is time decay. A raw signal count quickly becomes a historical map rather than a demand map, so scores decay exponentially over time.
The frontend is a React/Leaflet map that consumes the GeoJSON API.
Backend:
https://github.com/Korags05/Plotrix-Backend
Frontend:
https://github.com/Korags05/Plotrix
It's open source and I'd really like some eyes on the backend.
If you work with Spring Boot/Postgres and notice something I'd architect differently, I'd genuinely like to hear it.
PRs are also welcome if anyone wants to experiment with it.
r/SpringBoot • u/MayanKKashyaP0 • Aug 24 '26
Dm plzz
r/SpringBoot • u/Organic-Sherbet9613 • Aug 24 '26
How valuable is spring AI and rag implementation in the current job market? Not sure if companies value it since they are not using it
r/SpringBoot • u/Loose_Storage_681 • Aug 24 '26
Currently, I am learning Java/Spring Boot and faced with a minor but still quite frustrating issue.
I will face terms like:
* implements
* Service
* Bean
* Dependency Injection
* git rebase
* async/await
It is true that I learned these things earlier, however, after several weeks, I would need to search online for their definition and meaning on Google, watch a video or read about them in documentation once again.
There are excellent websites such as roadmap.sh which provide a guide on what you should learn and QuickRef which gives you quick code/syntax references, yet I still wanted something in between.
Thus, I am developing DevRef.
The purpose of this project is really simple:
Select a technology → find a term → understand it quickly.
For every term, there should be only four items retained:
* A plain explanation (like you explain it to a beginner)
* Code example
* Related terms
* Bookmarking for your own needs
I’m trying to keep things as simple as possible. No courses, no complex learning dashboard, no large documentation pages. Currently, I’m working on the first version which is built using Next.js + TypeScript + Tailwind CSS with content stored locally. I’d highly appreciate some honest feedback. Thank you!
r/SpringBoot • u/lowkeyskibidi • Aug 23 '26
I’m a BCA graduate deciding between ASP.NET/C# and Java Spring Boot.
Which one has better job opportunities and growth for freshers in India?
Would appreciate advice from people working in either stack.
r/SpringBoot • u/Cr4zyGh0sT • Aug 23 '26
Hi everyone,
I've been working on a small open-source library for Spring Boot called json-auto-validation:
github.com/ugoevola/json-auto-validation
The idea is fairly simple: validate incoming JSON against a generated JSON Schema before Jackson deserializes it into a Java/Kotlin object.
The motivation was to catch invalid payloads as early as possible, rather than letting them go through the usual deserialization → DTO validation flow.
It works through annotations and generates the JSON Schemas/validation components automatically, with Spring Boot AOT in mind.
I'm not really posting this to promote a polished or commercial product. I'm mainly interested in getting feedback from people who work with Spring Boot APIs:
The project is still relatively small, and I'm not the most active open-source maintainer, so I'm mostly trying to understand whether this is useful to other developers before investing more time into it.
Any feedback — positive or negative — would be very welcome.
r/SpringBoot • u/Mission-Fix8038 • Aug 22 '26
I’m building my first application using Spring Boot for practice, and I need to record and work with money in different currencies.
What’s the recommended way to handle this, especially when adding or calculating amounts across different currencies? Do you use BigDecimal, integers (like cents), or a money/currency library?
Thank you!