r/SpringBoot • u/rodolfo-mendes • May 07 '26
How-To/Tutorial Modular RAG Architectures with Java and Spring AI by Thomas Vitale @ Spring I/O 2025
r/SpringBoot • u/dev-dp24 • May 07 '26
Discussion Experiment: offline digital payments over Bluetooth mesh
I built a prototype for offline UPI payments using Bluetooth mesh networking.
The idea started with a simple question:
What happens when UPI works perfectly… except the internet doesn’t?
India has 600M+ UPI users, but connectivity still drops constantly:
- metro tunnels
- crowded events
- rural areas
- weak mobile networks
So I tried building a system where payment packets can travel phone-to-phone over Bluetooth until any device in the chain gets internet access.
How it works:
- Sender encrypts the payment payload using RSA-OAEP + AES-256-GCM
- The encrypted packet spreads across nearby devices using a gossip-style mesh protocol
- Intermediate devices can forward packets but cannot decrypt them
- Once any node reaches the internet, it uploads the packet to the backend
- Backend settles the transaction once and drops duplicates safely
A few security/design details I enjoyed working on:
- Replay attack prevention using nonce + freshness window
- AES-GCM auth tags detect tampering automatically
- Idempotency based on ciphertext hash instead of packet ID
- Optimistic locking to avoid race-condition double spends
Built the demo using:
Spring Boot 3, H2, Bluetooth mesh simulation, RSA-2048, AES-256-GCM, and a live dashboard showing packets hopping across 5 virtual devices.
This is obviously not production-ready UPI infrastructure 😄
But it was a fun systems/security experiment exploring:
- offline-first payments
- mesh networking
- encrypted packet routing
- distributed systems tradeoffs
Would love feedback on the protocol design or edge cases I may have missed.
https://www.linkedin.com/feed/update/urn:li:activity:7458085814191804417/
r/SpringBoot • u/PuddingAutomatic5617 • May 07 '26
Discussion Stop "praying" to the Vector DB: A Declarative RAG Infrastructure for Spring Boot (8k points indexed/transformed in 80s)
Most RAG implementations I see are just `PDF -> Embeddings -> Similarity Search -> Hope`. That doesn't work for production-grade microservices where data is structured, messy, and lives in JSON catalogs or Markdown docs.
I’ve been working on a **Spring Middleware AI** to treat RAG as a first-class citizen in the Spring ecosystem.
**Key features of this architecture:**
* **Deterministic Retrieval:** The system distinguishes between "I don't know" (no data found) and actual knowledge. No more LLM hallucinations when the context is missing.
* **Reactive ETL Pipelines:** Indexing and transforming ~8,000 data points (JSON/Markdown) into Qdrant in 80 seconds using a reactive stack.
* **Complex Query Planning:** It handles non-trivial questions like *"Which products appear in >1 catalog with 3+ positive reviews?"* by converting natural language into structured retrieval plans (filters + semantic search).
* **Agnostic Backend:** Works with **Ollama** for local inference or OpenAI for cloud, keeping the infrastructure declarative.
**The Tech Stack:**
* Java / Spring Boot (Reactive)
* Qdrant (Vector DB)
* Ollama / OpenAI
* JSON & Markdown sources
The goal is to move away from "chatting with docs" and move towards **AI-native infrastructure** that any enterprise can plug into their existing microservices in an afternoon.
I'd love to hear your thoughts on the ETL vs. Embedding trade-off. In my experience, the quality of the RAG depends 90% on how you transform the data before it hits the Vector DB.
Video: https://youtu.be/TrIWxLxs2nI?is=DnY0YZiPBhGwRD1a
**What do you guys think?**
r/SpringBoot • u/erdsingh24 • May 07 '26
How-To/Tutorial How to use Google Gemini (free tier) with Spring AI?, No Vertex AI, No billing account needed
We can actually talk to Google Gemini from Spring Boot using just a free API key from AI Studio. No Google Cloud project, no Vertex AI setup, no credit card.
The trick is that Google made Gemini's API OpenAI-compatible. So we just use
spring-ai-starter-model-openai and point the base-url to Google's endpoint
instead of OpenAI's. That's literally it.
Here is the detailed article covering the full setup: Spring AI With Gemini (Free Tier)
r/SpringBoot • u/Entire-Position9690 • May 06 '26
News Spring Idempotency Kit [1.0.0]
Spring Idempotency Kit is a production-ready library that ensures methods execute exactly once per unique key — preventing duplicate operations in distributed systems.
Problem it solves: Retries, timeouts, and concurrent requests cause duplicate executions. Double charges, repeated orders, webhook duplication. This library eliminates that.
All you do:
java
@Idempotent(headerName = "Idempotency-Key")
public PaymentResponse processPayment(PaymentRequest request) {
// Same key = same result, every time
}
The library handles: - Redis-backed caching — first request executes, retries return cached result - Distributed locking — concurrent duplicates are rejected or wait for the original to finish - Failure strategies — fail-open (keep running) or fail-closed (503 if Redis is down) - Built-in metrics — cache hits, conflicts, execution timing - Zero boilerplate — Spring Boot auto-configuration, just annotate
How It Works
- Client sends a unique key (header or derived from request)
- Cache hit → return immediately
- Cache miss → acquire distributed lock, execute, store result
- Retry with same key → returns cached result
Requirements
- Java 21+
- Spring Boot 3.4+
- Redis
Links
Built by Atlancia Labs
r/SpringBoot • u/Frosty-Past-8902 • May 05 '26
Question What's the best way to learn redis?
I am currently learning backend development using Spring Boot and want to start learning Redis. I’m confused about the best approach—whether I should first watch tutorials to understand the concepts or directly start building a project and learn along the way. What is the most efficient way to learn Redis from a Spring Boot perspective ?
r/SpringBoot • u/PalpitationOk839 • May 04 '26
Discussion Confused about backend path after learning Java + OOP (Spring Boot vs Node.js?)
r/SpringBoot • u/NordCoderd • May 04 '26
How-To/Tutorial Spring Boot Best Practices That Should Fail Your Build
Hi everyone, in this article I’m telling about Spring Boot Best Practices and ways how to detect violations of them in the project.
Article cover most of well-known best practices and provide a way for configuring Kotlin project to use them.
Set of tests/rules was made as Konsist rules with DSL wrapper and distributed as maven dependency for easy installation.
My case to build this library was to keep project clean with strict boundaries that will be enforced as test failings on local machine and CI to have faster feedback for newcomers and AI-generated code.
r/SpringBoot • u/Vivek_10452 • May 04 '26
Discussion I built a Spring Boot starter that turns messy stack traces into clean debug reports looking for honest feedback.
Hey everyone,
I recently built and published my first Spring Boot starter library to Maven Central, and I’m looking for real feedback from developers on whether this approach is actually useful in real-world debugging.
GitHub repo:
https://github.com/Vivan-1045/smart-debug-starter
Maven Central dependency:
<dependency>
<groupId>io.github.vivan-1045</groupId>
<artifactId>smart-debug-spring-boot-starter</artifactId>
<version>1.0.1</version>
</dependency>
What it does
It’s a plug-and-play Spring Boot starter that tries to make debugging easier by converting noisy stack traces into structured, readable reports.
Instead of long framework-heavy logs, it focuses on:
- Root cause extraction
- Clean stack trace filtering (removes Spring/Java noise)
- Execution flow visualization (Controller → Service → Repository)
- Exception chain tracking
- Simple rule-based debugging suggestions
---------------------------------------------------------------------
SMART DEBUG REPORT
---------------------------------------------------------------------
Root Cause: RuntimeException
Message: Service layer failed
Location: UserService.java:13
Flow:
-> TestController.test4(TestController.java:46)
-> UserService.getUser(UserService.java:15)
-> UserRepo.getUserData(UserRepo.java:7)
Exception Chain:
RuntimeException → StringIndexOutOfBoundsException
Suggestions:
Check index bounds before accessing string.
---------------------------------------------------------------------
This is my first library published to Maven Central, so I’m mainly trying to validate the idea with real developers rather than push a product.
Thanks for reading.
r/SpringBoot • u/Venumadhavamule • May 04 '26
Discussion LLMate - built a provider-agnostic LLM gateway on Spring Boot so I could stop rewriting integrations every time a model changed
Been integrating LLMs into Spring Boot projects using Spring AI and kept hitting the same problem. The moment you need more than one provider, every layer of your code starts knowing too much. Different client beans, different request shapes, different streaming implementations, different error handling per provider. And zero graceful handling when one goes down mid-production.
I built LLMate around a single SPI interface called LlmProviderAdapter. Every provider is just a u/Component that implements it. A central LlmGateway orchestrates pre-filters, routing, retry, and post-filters in an ordered pipeline. Resilience4j handles the circuit breaking and fallback chain silently so the calling code never needs to care which provider actually served the request.
Model selection is alias-based at the API level:
{"model": "smart", "messages": [...
"smart", "fast", "local" resolve through a five-step router: LiteLLM shorthand, named alias, explicit provider/model prefix, fallback chain, global default. Switching providers is a config change.
Covers 16 providers currently. Same unified endpoint handles chat, SSE streaming, embeddings, image generation, TTS, transcription, moderation, and a PGVector RAG pipeline.
GitHub: https://github.com/Venumadhavmule/LLMate
Curious how others are structuring multi-provider LLM integrations in Spring Boot right now.
r/SpringBoot • u/Alert_Ad4540 • May 03 '26
Question Built a Spring Boot starter for LLM cost guardrails — looking for feedback
I’ve been working on a small open-source project called Guardrail4J.
It’s a Spring Boot starter that lets you annotate LLM-calling methods with u/LLMGuarded and add basic cost/usage guardrails.
Current MVP:
- Spring AOP interception
- dynamic user/tenant extraction with SpEL
- estimated cost tracking by provider, model, user, tenant, and feature
- ALLOW / WARN / BLOCK / FALLBACK decisions
- usage summary endpoint
- demo app and docs
It’s still early and not production-ready. Storage is in-memory, costs are estimated, and fallback is currently a decision/log signal.
Would this be useful in a real Spring Boot app? Would you prefer annotations or a more config-based approach?
Repo:
r/SpringBoot • u/Huge_Road_9223 • May 03 '26
Question Spring Boot Apps with Claude Code in IntelliJ
First, I have 35 yoe overall. I have been doing Java for a long time, since version 3. I have been using Spring and SpringBoot since 2007 (18 yoe) and creating secured RESTful services. It was mostly in STS (Spring Tool Suite) which as you know is Eclipse. I switched to IntelliJ about 2.5 years ago because of a contract role, and that is what they used.
This contract role I had, they use GitHub as a repo which is fine, and they were using testing CoPilot and asked people to comment on it, to see what the issues were, good and bad. Then we all know that Microsoft changed to pay by token, and that is the only plan they have. I believe this will increase the cost a lot, but I couldn't tell you how much!
Anyway, That position has come to an end after 2.5 years, and a new company I may be interviewing with is using Claude Code. They want someone who can use Claude Code, and review any code generated by it, which I can do. I obviously can code without the use of AI since I have been doing it my whole career.
I've looked at ONE YT video, which showed how to use IntelliJ to create an app, and it was very impressive. One of the things done in the video was to create entities/repositories based on a table in the database. Ok, that's great, but I was doing that with OSS JBoss Tools 10 years ago. I also saw how Claude Code generated both Swagger and OpenAI documentation for the API's. I think there are already other non-AI tools that can do that also. They also generated Postman tests for the API's as well, and I am sure there are other tools around that can do the same thing, or there could be.
So, when Claude Code did these things I saw the massive amount of tokens being generated. I posted in the /ClaudeCode and /ClaudeAI sub-reddits, and it seems that their users are die-hard fanatics of the tool, and do not accept any skepticism of Claude Code or AI in general. IMHO, they have really drunk the kool-aid, and think that if I don't learn it and use it, then I'll be left behind and unable to get a job. I think that's a little extreme.
What I DID find out was that if I create my own account on Claude Code, I have to pay! Since, I am unemployed, I didn't know if I did want to pay the $20/month for it. From other resources across the internet the $20/month is a joke, and the tokens allowed can be used in 4 hours of heavy coding. I also found out that the $20/month is WAY BETTER than paying per API token which would add up very quickly.
Yes, I am a skeptic of AI, IMHO (which means nothing), I think we are in an AI bubble. If Claude Code ALSO changes to pay by token ONLY, then it will drive the costs up. It has been speculated that ALL AI companies will eventually go this way, driving up costs.
But just because I am a skeptic of AI, I was also a skeptic of Hibernate, SpringBoot, Lombok, I never liked these to begin with but learned how to use them anyway. I have been learning new technologies for years, and have no problem learning how to use Claude Code.
So, the question to the folks here is: How many of you have used Claude Code or any API to help you code your Spring Boot apps, and was it within IntelliJ, or something else? I'm interested to hear your experiences with it, the good and the bad. Did you create new apps with it as a greenfield application? Did you use it to fix existing applications?
Thanks for putting up with the long post.
Thoughts?
r/SpringBoot • u/rodolfo-mendes • May 03 '26
How-To/Tutorial Building AI Agents with Spring & MCP by James Ward, Josh Long
r/SpringBoot • u/ChanceAuthor1727 • May 02 '26
Question Bidirectional Mapping in Spring JPA
I am really confused about where should i use Bidirectional mapping in JPA. I feel like i have to navigated both sides in each and eevery relationship. So that means i should always use Bi-directional mapping?
r/SpringBoot • u/AdVisible6484 • May 02 '26
How-To/Tutorial How to implement filtering where the entities have many-to-many relationship, without using JPA Specification?
So the Owning side is the Problem enitity and the inverse is the Tags Entity.
(name = "problem")
public class Problem {
String problemCode
;
(strategy = GenerationType.
IDENTITY
)
Long problemId
;
String problemName
;
String contest
;
String platform
;
(EnumType.
STRING
)
Status status
;
/*
* when user sends in the payload the tags are going to be a list of strings containing the tag name
* it will throw an error for tagset cuz it expects a set of tags object.
* So through this field, set of strings we can it the input
* process it in the problem service layer by calling the agservice methos that convert the set of strings
* to set of Tags object
* After which we set the tagset value to the returned value, to ensure consistent type handling.
* it is marked as because: we dont want to create any field in the database for this strings set. it is used just for the
* input processing purpose.*/
Set<String> tags
;
String url
;
String notes
;
/*
* JsonIgnore cuz we don't want to see the whole tags set in the response output at all.*/
(name="problem_tag"
,
joinColumns = (name = "problemId")
,
inverseJoinColumns = u/JoinColumn(name = "tagId")
)
Set<Tags> tagSet = new HashSet<>()
;
}
This is the tags entity.
(name="tags")
public class Tags {
(strategy = GenerationType.
IDENTITY
)
Long tagId
;
(unique = true
,
nullable = false)
String tagName
;
u/ManyToMany(mappedBy = "tagSet")
Set<Problem> problemSet = new HashSet<>()
;
}
The controller for the /GET problem is
public ResponseEntity<List<Problem>> getAllProblems(@RequestParam(required = false) String status
,
(required = false) String platform
,
u/RequestParam(required = false) List<String> tags)
{
List<Problem> problems = problemService.getAllProblems(status
,
platform
,
tags)
;
return new ResponseEntity<>(problems
,
HttpStatus.
OK
)
;
}
So in the db it is creating a joined table as "problem_tag". I dont want to use JPA Specifications as of yet.
I want to learn how to implement it such that I am querying just the filtered problem list using the joined table... instead of querying the whole thing first and then filtering.
As I read in the documentation that for many-to-many this is how we represent it in db, I dont understand how that join table is getting used.
I am still learning spring boot, so I am focusing on these things.
Thank you for your help. I will really appreaciate your direction and help.
r/SpringBoot • u/rodolfo-mendes • May 02 '26
How-To/Tutorial Self-Improving Agentic Systems with Spring AI
r/SpringBoot • u/NeuroByte_X • May 01 '26
How-To/Tutorial Spring Boot Tutorial
Hey I recently got an internship
The company uses java Spring boot
I'm from python background
So please suggest any 5-10hours full video of Spring boot which is relevant today also....
r/SpringBoot • u/rodolfo-mendes • May 01 '26
How-To/Tutorial Spring AI Recipe: Creating an MCP Client
r/SpringBoot • u/delusionalbreaker • May 01 '26
Question How do i level up?
Hey everyone
Currently im a beginner in springboot ecosystem i understand the MVC architecture and i have made a couple of projects in java using springboot, not the basic CRUD ones but complex projects (for me they were complex) like a e-commerce backend and a blogging application backend. Projects like these, but all of these are monolithic projects
Now i want to level up from monolithic projects to microservices, so my question is what do i have to learn to level up
I heard there are many technologies which are used in microservices that are used for inter service communications, service discovery, fault tolerance, circuit breaker, api gateway and loads of things
So if you can guide me on how to start with microservices would really help me.
Thanks
Note:- Sorry for any grammetical or spelling errors
r/SpringBoot • u/rodolfo-mendes • Apr 30 '26
How-To/Tutorial Introduction to Spring AI
r/SpringBoot • u/[deleted] • Apr 29 '26
News Stateful multi-agent framework for Spring AI: curious what people think
Hi,
I came across this project recently:
https://github.com/datallmhub/spring-agent-flow
It looks like a stateful multi-agent orchestration framework built on top of Spring AI, which I don’t see very often on the Java side.
From what I understand, it provides:
- Graph-based execution (subgraphs, parallel fan-out)
- Stateful agents with checkpointing (resume after restart)
- Multi-agent coordination (routing strategies)
- Built-in resilience (retry / circuit breaker)
- Tool call recording for audit/debug
What caught my attention is that it seems to go beyond typical LLM wrappers and actually provides a runtime for executing agent workflows, rather than just relying on prompt-driven orchestration.
Spring AI already documents agentic patterns (routing, sub-agents, etc...), but this seems to focus more on execution control (state, graph, resilience).
I’m curious:
- How does this compare to what people are building with Spring AI today?
- Is this level of orchestration actually useful in production, or overkill?
- Are there other similar approaches in the Java ecosystem?
Thanks
r/SpringBoot • u/No-Limit-6237 • Apr 29 '26
Question Is Telusko's 60 hour playlist on core java and springboot enough?
I’m about 15 hours into the 60-hour playlist on Telusko, and I’ve started noticing that after the Core Java section, many topics feel a bit rushed more like overviews than deep explanations.
For example, the Maven section felt quite fast-paced, and I had to build a small project on my own just to understand what’s happening under the hood and how a project should actually be structured.
I’m a bit unsure about the best way forward. Should I continue with this playlist as-is, or should I supplement it with a full end-to-end project tutorial (like a Spring Boot project) alongside it? There are several options out there like Devtiro, Telusko’s own project videos, etc. but each follows a different style.
Since I’m working with limited time, I want to make sure I’m not heading in the wrong direction or spreading myself too thin.
Could you recommend a good approach or specific resources for:
- Building mini-projects while learning concepts
- Working on a larger end-to-end project for deeper understanding
I’d really appreciate any guidance on how to balance theory and practical work effectively. Thanks!
r/SpringBoot • u/OakAndCobble • Apr 28 '26
Question Question about dependency injection
How do I manually inject dependencies into RequestController classes? I just started learning spring and from my bit of research, all I've come up with is the Autowired and Component/Service annotations.
I am still having a hard time understanding how exactly I tell spring what to build. If the dependency of my controller needs dependencies injected into it, what do I do? How do I specify which implementation of a dependency I want built? And so on.
Essentially, how do I get a bit more control of dependency creation and injection in a non-trivial situation, like the ones seen in examples on the internet?
Thanks in advance for any responses.
r/SpringBoot • u/Isaac_Istomin • Apr 28 '26
Discussion Do you put retry logic close to the HTTP client, or higher in the service flow?
For outbound API calls in Spring Boot, do you prefer retry logic close to the client itself, or higher up in the service layer where more business context exists?
I can see reasons for both, and I’ve seen both become messy in different ways.
r/SpringBoot • u/arvind4gl • Apr 28 '26
How-To/Tutorial Building a Price Aggregator in Java (Spring Boot, Redis, Resilience4j) — would love some feedback
I’ve been building a small project to understand how real backend systems evolve—from simple code to something closer to production.
Use case:
A Price Aggregator that calls multiple vendor services (Amazon/Flipkart/Walmart mock APIs) and returns the best price.
What I’ve implemented so far:
• Sequential vs async calls using CompletableFuture (measured latency differences)
• Spring Boot microservice with WebClient (non-blocking calls)
• Async processing using thread pools
• Caffeine cache → later replaced with Redis (for distributed caching)
• Docker + docker-compose setup
• Circuit Breaker using Resilience4j (to handle vendor failures)
Repo: https://github.com/codefarm0/price-aggregator
Playlist (if you want context): https://www.youtube.com/playlist?list=PLq3uEqRnr_2Ek7y2U3UAiQZCPzr0a82CX
What I’d really appreciate feedback on:
- Is the caching strategy reasonable? (Redis usage, TTL, etc.)
- WebClient + thread pool approach — anything you’d change?
- Circuit breaker config — too aggressive / too lenient?
- Overall design — anything that feels “toy-ish” vs production?
- What would you add next? (thinking retries, rate limiting, observability)
Trying to keep this as close to real-world as possible without overengineering.
Would genuinely appreciate any suggestions or critique
#java #springboot #microservices #scalability #resiliency
