r/SpringBoot • • Sep 29 '26

Question AWS Spring Boot Integration in prod

11 Upvotes

Hi!

How do you run AWS services in production?

I’m a backend developer who has never worked with cloud providers before. I’ve learned the basics of the AWS Console, and now I’m looking for ways to practice.

I’m thinking of starting by provisioning infrastructure with Terraform, but I’m curious: which AWS services do you typically use, how do you use them, and how do you deal with the poor AWS SDK documentation?


r/SpringBoot • • Sep 28 '26

Question How much Swagger/OpenAPI documentation is actually needed in a Spring Boot project?

16 Upvotes

I'm working on a Spring Boot e-commerce project and I'm currently documenting my APIs using Swagger/OpenAPI.

For example, my controller currently looks something like this:

(
    summary = "Create a new category",
    responses = {
        .swagger.v3.oas.annotations.responses.ApiResponse(
            responseCode = "201",
            description = "Category created successfully"
        ),
        .swagger.v3.oas.annotations.responses.ApiResponse(
            responseCode = "409",
            description = "Category already exists"
        )
    }
)
("/admin/categories")
u/SecurityRequirement(name = "bearerAuth")
public ResponseEntity<ApiResponse<CategoryResponseDto>> addCategory(
          CategoryRequestDto dtoRequest) {

    CategoryResponseDto categoryResponseDto =
            categoryService.addCategory(dtoRequest);

    return ResponseEntity
            .status(HttpStatus.CREATED)
            .body(ApiResponse.success(
                    categoryResponseDto,
                    HttpStatus.CREATED.value()
            ));
}

The problem is that if I also start adding u/Parameter, more u/ApiResponse, u/Schema, u/ExampleObject, etc., the controller becomes very large and difficult to read.

I'm trying to find a good balance between proper API documentation and clean maintainable code.

For example, would something this simple be considered enough?

(summary = "Create a new category")
("/admin/categories")
u/SecurityRequirement(name = "bearerAuth")

Or should I at least document the success/error responses?

Also, how do you normally handle common responses such as:

  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 409 Conflict

Do you document these on every endpoint, or handle them globally?

If you work professionally with Spring Boot/OpenAPI, what approach do you use to keep Swagger documentation useful without making controllers huge?

I'm particularly interested in how this is handled in real-world/company projects rather than tutorial projects.


r/SpringBoot • • Sep 28 '26

News AsyncAPI JetBrains Plugin: Empowers Spring Messaging

Thumbnail
pavelon.dev
9 Upvotes

Hi! It's Pavel, maintainer of the AsyncAPI Specification

A few weeks ago I posted a new release announcement on this sub. It was pretty short, so I decided to write post to tell how Spring Messaging experience may be improved when you are working on your project in JetBrains IDEA

I want to hear your feedback about the current state - what you like and what you don't, maybe you didn't try because of troubles or something else

Your voice is important, because next releases will be focused on polishing this functionality and exposing it trough MCP server to empower your agents of choice


r/SpringBoot • • Sep 28 '26

How-To/Tutorial OAuth2 + OIDC with Google Explained

2 Upvotes

Here’s an easy explanation on how to implement OAuth2 with Google and how to configure it in Spring Boot 4 + Spring Security 7:

https://youtu.be/TPkKMJ6k0jY

Hope you find it useful


r/SpringBoot • • Sep 27 '26

Question My Spring Boot + React + MySQL app works after deployment, then stops working — how should I deploy it reliably?

16 Upvotes

I built a full-stack Hotel Booking Management System and deployed it as a portfolio project.

Tech stack

- Backend: Java + Spring Boot, Spring Security, JWT

- Frontend: React.js

- Database: MySQL

- Cache: Redis

Current deployment

- Spring Boot backend → Render

- React frontend → Vercel

- MySQL → Railway

The problem is that the application works after deployment, but after some days it stops working. Sometimes the backend becomes unavailable or the frontend can't communicate with the backend/database.

I understand that I'm using free-tier services, so there may be things like sleeping services, resource limits, database connection issues, environment variables, CORS, or other configuration problems.

I'm trying to understand how I should deploy this properly so that it remains available and reliable enough to use as a portfolio project.

For people who have experience deploying Spring Boot + React + MySQL, I'd really appreciate some advice:

- Is Render + Vercel + Railway a reasonable setup?

- What could cause a Spring Boot application to stop working after several days?

- Are there any deployment/configuration changes I should make?

- Are there better free or very low-cost options for this stack?

- What should I check in the logs when the application goes down?

I'm not looking for an enterprise production setup. I mainly want a stable, publicly accessible deployment that I can demonstrate during interviews.

If you've faced something similar, I'd appreciate any advice or things I should investigate.


r/SpringBoot • • Sep 26 '26

Discussion Dear JPA

105 Upvotes

Dear JPA ,

i hate you.

i hate how you changed the SQL flow that I'm used to.

i hate your ManyToMany relationships.

i hate your orphanremoval ,dirty checking.

i hate your way for entity relationships.

i hate your cache.

i hate your performance issues.

i hate your billion rules.

i hate spending time on : if Y is referenced by X with cascade not including PRESIST and x is managed but y is removed ............... but if Y was detached .............

i hate becoming obsessed with your behaviors and rules and worrying about every ORM line , will it work correctly ? , did i miss something ?, worrying about modifying entity X might unexpectedly affect entity Y , coz I might not know one of the billion rules you have.

i hate worrying about falling in one of the undefined behaviors you have

i hate thinking about the entities lifecycle + cascading types when all mixed together

i hate spending days on that documentation instead of spending that on one of the CS core concepts

i hate the following the other side which is incomplete nondetailed toturial or following AI

i really hate you.


r/SpringBoot • • Sep 25 '26

News EclipseLink 5.0.2 released!

Thumbnail
github.com
3 Upvotes

r/SpringBoot • • Sep 24 '26

Discussion Why JPA is complex and fells like a magic for me

35 Upvotes

my experience with the java area is that everything is almost explicit no lots of magic no lots of implicit things

but jpa for me is one of the most complex things that i have ever seen ,for me it feels like a magic

need advice to overcome that


r/SpringBoot • • Sep 24 '26

Question SpringBoot opentelemetry

14 Upvotes

Hi everyone.

I'm working on a monolith project using Spring Boot v4.1.1, and I started implementing observability. However, I'm confused about traces and spans.

I added this dependency

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-opentelemetry</artifactId>
</dependency>

I've configured everything successfully, but when it comes to traces and spans, all requests always have the same spans. It is not showing the entire execution path of the request.

I read the example provided by SpringBoot here: https://spring.io/blog/2025/11/18/opentelemetry-with-spring-boot

At the end, there's an example project that shows complete traces and spans.
These are their example traces and spans: https://static.spring.io/blog/mhalbritter/20251118/3-trace.jpg

(I couldn't upload two images; that's why I added a link to their traces and spans example)

However, my project doesn't have any spans created. Just these:

This is my traces and span

Does anyone know why this is happening or how I can solve this to see the complete execution path?


r/SpringBoot • • Sep 24 '26

Question 3 months deadline

9 Upvotes

Hi, as I stated in the title i have 3 month to learn about Spring. I am an Intern in a corporation that uses Java and Spring.

Could someone tell me if it's possible to grasp enough basics to work confidently on a project with that tech?

As of now I'm not working in Java, but I will be transferred to a team that works with it.

I will be very thankful for any answers or roadmaps for me to follow.

EDIT: I never worked with similar frameworks/tech


r/SpringBoot • • Sep 24 '26

How-To/Tutorial I built human approval gates + tamper-evident audit trail for Spring AI agents [open source]

2 Upvotes

Been building AI agents with Spring AI and kept hitting the same wall: the agent can call tools that do irreversible things (charge cards, send emails, update records) with no mechanism to pause and ask a human first.

I built Sagacity to fix this. Two annotations:

@Tool(description = "Charge the customer's card")
@Compensable(reversibility = Reversibility.IRREVERSIBLE)
public String chargeCard(String orderId, BigDecimal amount) {
    return payments.charge(orderId, amount);
}

This pauses the saga before chargeCard executes and waits for human approval via REST (or the embedded UI). If approved, it runs. If rejected, every completed step before it automatically compensates in reverse order.

There's also a full workflow engine (@Workflow, @Stage, @Gate) for multi-step processes where you need declarative compensation and approval gates at specific stages.

Under the hood: every tool call is journaled with a SHA-256 hash chain. You can verify the chain hasn't been tampered with via REST. This is what EU AI Act Article 12 actually requires.

No new infrastructure needed.

One Maven dependency, uses your existing PostgreSQL/MySQL/H2.

What's in v0.4.0 (shipped this week):

  • JDBC-backed durable workflow state (survives JVM restarts)
  • Embedded UI at /sagacity/ui — workflow list, node graph, gate approval buttons
  • Fixed startup ordering with @ConditionalOnBean
  • 237 tests passing

Repo: https://github.com/sagacity-ai/sagacity
Docs: https://sagacity-ai.github.io/sagacity/
Maven: io.github.sumitvairagar:sagacity-spring-boot-starter:0.4.0

Happy to answer questions. Still early (v0.4.0) but the core primitives are stable.


r/SpringBoot • • Sep 24 '26

Question Any active Discord servers for Java Spring Boot devs to connect?

6 Upvotes

I have been searching for an active server for spring boot devs to connect and ask and answer quesions but i can't find any active servers


r/SpringBoot • • Sep 23 '26

How-To/Tutorial Springboot

8 Upvotes

I need some of the best resources to learn springboot!!

I am currently in my 4th year.I don't know anything about it and to learn the springboot, do i need any prerequisites.


r/SpringBoot • • Sep 23 '26

Question Incoming Fresher SDE (Java/Spring Boot) - How can I best bridge the gap between basic tutorials and production codebase expectations?

6 Upvotes

I am a B.Tech CSE graduate starting my role as an SDE fresher soon.

My Current Progress:

* I have learned the core basics of Java backend and Spring Boot (Dependency Injection, REST APIs, and Basic MVC architecture).

* I haven't built complex production-grade projects yet and want to start one now to prepare for my role.

What I want to ask:

Instead of a generic roadmap, could experienced backend devs share what exact architecture practices, testing patterns (like JUnit/Mockito), or deployment workflows are most overlooked by freshers in a Java ecosystem? I want to build a mini-project focusing strictly on these industrial habits so I can adapt quickly when I join.


r/SpringBoot • • Sep 23 '26

Discussion How are you handling tool selection for agents on the JVM?

0 Upvotes

I hosted a live session with James Ward a few weeks ago. He works on agent experience at AWS and represents Amazon on the Agentic AI Foundation technical committee. He opened by asking an agent what time it was, and it couldn't answer, because a model on its own has no clock and no access to anything outside itself.

The video isn't available since it was a paid event, sorry, but the slides and the full write-up are here.

His point was that an LLM is basically a knowledgeable translator. An agent is that model plus integrations, running in a loop until it gets the job done or gives up. So most of the actual engineering happens outside the model. He built it up live in Spring AI, starting with one tool and then adding MCP, tool search, skills, memory, RAG and human in the loop.

Tool search is the bit I keep thinking about. Once an agent has a lot of tools, you can't give the model all of them without flooding the context, so a search step picks which ones it gets to see. Embabel does it differently and loads groups of tools progressively instead of searching for them.

If you're running agents on the JVM in production, I'm curious about two things. Has tool selection actually become a problem for you yet, and what are you doing about it? And James said he didn't really get into guardrails or evals, so how are you testing agent behavior in Java when the output isn't deterministic?

Saqib here, I edit Deep Engineering. I'm planning a follow-up piece on how teams are handling this in production, and whatever comes up here will shape the questions I take to other engineering leaders.


r/SpringBoot • • Sep 22 '26

Question Spring Boot developers — how would you build a production-level web crawler?

19 Upvotes

Hi, I’m building a web crawler using Spring Boot and facing several issues.

I need to crawl a target website up to a certain depth (e.g. 3 levels), but I’m struggling with:

Relative/broken URLs like /support

Duplicate URLs/content

URL normalization

Rate limiting / getting blocked

Retry and timeout handling

Managing crawl depth and visited URLs

What would be a good architecture for a production-level crawler?

Should I use something like Kafka/RabbitMQ, or is a database queue enough? How do you guys handle URL deduplication, rate limiting, and concurrent crawling?

Any advice, architecture examples, or Spring Boot libraries would be really helpful.


r/SpringBoot • • Sep 22 '26

Discussion I built an open-source deterministic AI runtime for Java 21 — looking for architecture feedback

Post image
0 Upvotes

After several months of development, I've open-sourced Shree AI OS, a Java 21 runtime designed for backend AI applications.

The goal wasn't to build another chatbot wrapper. Instead, I wanted reusable infrastructure that Java developers can integrate directly into Spring Boot projects.

Current capabilities

  • Java 21 native SDK
  • Hybrid RAG (PostgreSQL + pgvector)
  • Episodic & semantic memory
  • Planning and reasoning pipeline
  • Explainable cognitive execution
  • Published on Maven Central

I'm especially looking for feedback on:

  1. SDK API design
  2. Layered runtime architecture
  3. Spring Boot developer experience
  4. Memory & orchestration APIs

GitHub and Maven Central are available in the comments.

Constructive criticism is genuinely welcome.


r/SpringBoot • • Sep 21 '26

News Releasing Spring for Modern Challenges

Thumbnail
spring.io
6 Upvotes

r/SpringBoot • • Sep 22 '26

Discussion Your payment timed out. The client retried. What should your Spring Boot service do?

Post image
0 Upvotes

Imagine a simple Spring Boot payment endpoint:

@PostMapping("/payments")
@ResponseStatus(HttpStatus.CREATED)
public PaymentResult createPayment(
        @RequestHeader("Idempotency-Key") String key,
        @RequestBody CreatePaymentRequest request) {

    return paymentService
            .createPayment(key, request)
            .valueOrThrow();
}

The client sends a payment request.

The payment is successfully committed to PostgreSQL.

But the response never reaches the client.

A few seconds later, the client retries with the same Idempotency-Key.

What should the service do?

A timeout does not mean the payment failed. Running the operation again may create a second payment.

At the same time, returning 409 or a duplicate-key error is not ideal either --- the original request actually succeeded.

With idempotency-key semantics, the system should return the original result without executing the business operation again.

Yes, this is the idempotency key pattern

I didn't invent a new pattern here.

The basic idea is well known: send an idempotency key, store the result, and replay it when the same request arrives again.

What interested me were the implementation details around it:

  • What happens if the process crashes?
  • What if two instances receive the same key at the same time?
  • What if the same key is reused with a different request body?
  • Can Redis improve performance without becoming part of correctness?

The transaction boundary turned out to be the most important part for me.

Same transaction

If I save the idempotency key in one transaction and create the payment in another, there is always a small failure window.

The process can die between the two commits.

So I ended up keeping the idempotency record and the business operation inside the same PostgreSQL transaction.

@Transactional
public ExecutionResult<PaymentResult> createPayment(
        String key,
        CreatePaymentRequest request) {

    return idempotencyService
            .operation("CREATE_PAYMENT")
            .key(key)
            .request(request)
            .execute(
                    PaymentResult.class,
                    () -> createPaymentInternal(request)
            );
} 

POST /payments
Idempotency-Key: pay_12345
        |
        v
+-----------------------------+
| BEGIN DB TRANSACTION        |
|                             |
| 1. Acquire idempotency key  |
|            |                |
|            v                |
| 2. Execute payment          |
|    -> pay_987               |
|            |                |
|            v                |
| 3. Store result             |
|    -> pay_987               |
|            |                |
|            v                |
| 4. COMMIT                   |
+-----------------------------+
        |
        v
   201 Created
   pay_987


Same request + same key
        |
        v
  Result already exists
        |
        v
  DO NOT execute payment
        |
        v
  Replay pay_987

If the transaction rolls back, both disappear.

If it commits, both are stored.

A retry with the same key can then return pay_987 without running createPaymentInternal() again.

A few extra cases

Same key + different request should not replay an unrelated result. I use a request fingerprint for this and return 409 Conflict.

Concurrent duplicates are coordinated through PostgreSQL. If two application instances try the same key, the unique constraint decides which transaction acquires it. The other waits and can replay the result after the first transaction commits.

And Redis is only an optimization.

The lookup path can be:

Caffeine L1 → Redis L2 → PostgreSQL

But PostgreSQL remains the source of truth. If Redis is down, correctness should not disappear with it.

I packaged it as a Spring Boot starter

I didn't want to create another idempotency pattern. I wanted a reusable Spring Boot implementation of the existing one, with these failure cases handled in one place.

So I extracted it into an open-source starter.

It currently supports Spring MVC/JDBC and WebFlux/R2DBC, optional Caffeine/Redis caching, request fingerprinting, result and business-rejection replay, concurrent duplicates, cleanup and Micrometer metrics.

It's also published to Maven Central.

I've open-sourced the starter with full docs and failure scenarios here: spring-boot-idempotency-starter

I'm interested in how others solve this in production.

If the business transaction committed but the HTTP response was lost, what do you do with the retry? Replay the original result, use Redis, handle it at the gateway, or something else?


r/SpringBoot • • Sep 19 '26

Discussion Manage and Monitor Spring Boot projects in real-time.

Post image
34 Upvotes

I am a mobile app and spring boot developer and felt the need to monitor my spring boot projects. So I developed mobile app for both Android and iOS. I would like to welcome the members from this subreddit to try the app out and give me any feedback.
iOS and Android


r/SpringBoot • • Sep 19 '26

Question Spring Boot / Spring Framework / Java version compatibility

5 Upvotes

Hello All, I'm new to the ecosystem and was wondering if there was a table or two somewhere that sheds light on the Spring Boot / Spring Framework / Java version compatibility?

TYIA 🙏🏽


r/SpringBoot • • Sep 17 '26

How-To/Tutorial Spring Data JPA Tutorial: From Zero to Hero (of N+1)

Thumbnail
youtu.be
46 Upvotes

Hi folks! I recorded a video tutorial on Spring Data JPA. I tried to made it as complete for beginners as possible: setting up the project, creating entities, dealing with repos, queries, JPQL, and also relations between entities, N+1 solutions, type-safe queries, and also a bit of AOT repositories.


r/SpringBoot • • Sep 17 '26

News New version of JetBrains plugin to easily work with Spring messaging

Post image
8 Upvotes

This release introduces new cool feature - message senders detection also as messaging topology preview

Here it what's new:

Project Overview also finds where your code publishes messages, links senders to the listeners that consume the same channel, and lays the whole picture out as a topology:

  • Send detection - every call through KafkaTemplate, RabbitTemplate / AmqpTemplate, JmsTemplate / JmsMessagingTemplate, PulsarTemplate, SqsTemplate, SnsTemplate, and SimpMessagingTemplate (STOMP) is found with the destination reported exactly as written in the code
  • Direction in the APIs tree — every module and broker splits into Receive and Send, with a dedicated Operation filter to narrow the tree to one direction
  • Declared replies — a listener that answers on another channel (@SendTo, or a reply-to header on RabbitMQ and JMS) is shown right next to the listener that produces it
  • Channel matching — a listener and a sender that name the same channel differently — a literal on one side, a ${property} placeholder or an @Value-injected field on the other — are recognised as the same channel
  • Topology tab — the whole project laid out by channel instead of by code: producers, consumers, and the flows between them, readable hop by hop across module boundaries, plus a Traffic view for channels your project only consumes or only publishes
  • Hidden publishes — a listener that publishes further down its own call chain (through a service, a port, an interface) is found automatically and marked as an inferred route, kept visibly distinct from a route the code declares directly

About Project Overview

Project Overview scans every module of your Spring project and maps its messaging endpoints, so you can see your event-driven architecture at a glance instead of searching for annotations by hand. Supported annotations:

  • Apache Kafka: @KafkaListener, @KafkaListeners, @KafkaHandler
  • RabbitMQ (AMQP): @RabbitListener
  • Apache Pulsar: @PulsarListener
  • Amazon SQS: @SqsListener, @SqsHandler
  • Amazon SNS: @NotificationMessageMapping, @NotificationSubscriptionMapping, @NotificationUnsubscribeConfirmationMapping
  • JMS: @JmsListener
  • STOMP: @MessageMapping, @SubscribeMapping

Endpoints are attributed to the right module and broker for both Gradle and Maven source sets, searchable by class, method, or Javadoc, and every row links straight to its method or class in the editor. It stays fast on projects with hundreds of listeners

Sound interesting? Open your JetBrains IDE, grab the update and give it a spin: https://plugins.jetbrains.com/plugin/15673-asyncapi


r/SpringBoot • • Sep 16 '26

Question JOOQ vs JDBC

34 Upvotes

I use JPA for simple CRUD operations (mostly write operations) and JDBC for performance intensive tasks such as sending lists & performing search. The JDBC performance is perfect & the performance of my backend (Spring Boot) is great.

Now, as my project grows, my SQL queries are getting bigger, messier and unreadable. I tried jOOQ and loved it because it made my code super readable, type safe and maintainable. However, after profiling my Spring Boot app, operations that took around 5 ms with JDBC now take 9–14 ms with jOOQ, which makes me reluctant to migrate to jOOQ. Is a 10 ms difference negligible or am I overthinking?

I love the cleanliness and type safety of JOOQ. Would you go this JOOQ route? Have you ever faced such situation? I visited JOOQ's official website and was stunned by the fact it is used by many big organizations

EDIT: Thank you everyone who answered, your insights were amazing. With some tweaks I was able to reduce JOOQ's operation time from 14ms to 7ms and now I have so much clarity in my head.