r/SpringBoot • u/olivergierke • Jun 11 '26
News Spring Modulith 2.1 GA released
r/SpringBoot • u/Few_Concept_1117 • Jun 11 '26
I build my first microservices project and kind want to test my websockets endpoints and flow.
How you guys build your frontend, i tried in react but got frustrated looking at syntax and got bored.
I have been trying to initiate since 3 days every time i frustrated and quit.
r/SpringBoot • u/BadCommit • Jun 11 '26
Currently, I am using mappingJacksonValue as the response type from my controllers. Here we are using dynamic filters based on the request parameters. The attributes exposed from the response vary. Since this got deprecated with the Spring Boot 4 migration, I don't see any alternatives for this.
Has anyone come up with a solution for this?
r/SpringBoot • u/Bariss26 • Jun 10 '26
In every Spring Boot project, we end up writing the exact same layers for basic CRUD: Read/Create/Update DTOs, MapStruct interfaces, REST Controllers, Services, and Repositories.
AI can generate this, but it doesn't enforce a stable contract across a codebase. Runtime solutions (like Spring Data REST) add reflection overhead, limit custom business logic, and bloat JSON payloads with HATEOAS _links.
I wanted a solution that generates plain, reviewable Java source code during the build phase (javac), with zero runtime dependencies. So, I wrote an annotation processor.
You just annotate your JPA entity:
@CrudGen
@Entity
public class Product {
@Id @GeneratedValue
private Long id;
@DtoField(dto = "Create", required = true)
@DtoField(dto = "Update")
@DtoField(dto = "Read")
private String name;
@DtoField(dto = "Read")
private BigDecimal price;
}At compile time, it automatically generates the build/generated sources for:
application/json-patch+json partial updates.@EntityGraph on JPA reads to handle relations without mapper-level database lookups.The generated code is part of your normal build output. Failures surface at compile time, and changes are visible in diffs. The library targets Spring Boot 3 and 4 (processor runs on Java 8+).
I would love to get your architectural feedback on the compile-time generation approach vs. runtime reflection tools.
(Links to the repo and Maven Central are in the comments).
r/SpringBoot • u/MarketingReasonable8 • Jun 11 '26
r/SpringBoot • u/Wonderful-Wafer2826 • Jun 10 '26
Hi, I'm an engineering student and a beginner in SpringBoot. I haven't worked on a big project so I'd love to learn and possibly do a project together. If anyone is looking for the same then dm me :) have a nice day.
r/SpringBoot • u/Whole-Patience3528 • Jun 10 '26
Does eager fetching cause n+1 problem like lazy fetching ?
r/SpringBoot • u/friscomatt • Jun 10 '26
I want to be able to reference external classpath resources via SomeClass.class.getResourceAsStream(). These resources live OUTSIDE the jar on the filesystem. I've tried many ways to do this with command line changes using -cp, etc. but I must be doing something wrong. My production application needs to be able to pick up files from the local filesystem, but there are some classes out of my control that expect these files/resources to be on the CLASSPATH and picking them up using my methodology above. These files and resources CANNOT be inside the jar. I'm using a quite old version of spring boot 2.4.2. Any guidance would be greatly appreciated.
r/SpringBoot • u/Aromatic_Ad3754 • Jun 10 '26
r/SpringBoot • u/hiura-mihateUwU • Jun 10 '26
Im trying to setup the google and facebook oauth, ask ai and some random dudes on the forum. They tell me to use apring security, now i dont even know wtf is happening. Why my oauth requests got rejected, wtf is in the useDetails, and i really struggling to get everything working, at the end i strip out everything and rolling back the git commit, then use scribe java instead. Wtf is this? How tf spring dev able to dealt with this and still have sanity left?
r/SpringBoot • u/TheCoolBroskie • Jun 10 '26
I’m a backend programmer and I want to start offering freelance services and custom automation tools to businesses (like real estate agencies, contractors, logistics companies, etc) entirely on an asynchronous, email/text basis
Most people associate freelancing with frontend web design (React, WordPress, etc), but I want to strictly focus on backend logic, data management, and workflow automation.
Here is my current technical stack:
- Languages: Java, Python
- Frameworks & Libraries:** Spring Boot, JDBC
- Databases: SQL Server (Azure SQL)
- Security: JWT, cookie-based authentication
r/SpringBoot • u/ibreathecoding • Jun 09 '26
When it comes to spring many are hidden under the hood; Spring as such sit on top of infrastructure; Ex DispatcherServlet, Security Filters, Jackson, Tomcat, JVM, OS all mapped to 3 lines of code.
r/SpringBoot • u/rodolfo-mendes • Jun 09 '26
r/SpringBoot • u/Level-Sherbet5 • Jun 09 '26
Hello techies
Actually I wants to integrate speech to text and vice-versa in my spring boot major project for free As I am student .
I cant buy the paid stuffs at all .
So can you guys suggest me how and what model to integrate in my spring boot project as I have very less amount of time to build that .
And from where I can get the guidance to build that and integration setup .
And one more thing if anyone wants to be partner of mine to build this project with my DM is always open for you guys .This project is just to improve skills and add quality to my resume.
r/SpringBoot • u/Remote_Resident2388 • Jun 08 '26
So I was working on a backend project and was using mongodb compass to store the data logically on 2707 port but to achieve transactional property I decided to move on to mongo atlas
I replaced the host & port in my application.properties with the atlas uri still after running the project it showing connected to local host
Even when I am writing garbage values in uri still the program is running and showing connected to localhost
Pls help
r/SpringBoot • u/ThenParamedic4021 • Jun 08 '26
r/SpringBoot • u/MarketingReasonable8 • Jun 08 '26
r/SpringBoot • u/deividas-strole • Jun 08 '26
r/SpringBoot • u/ChaminduJ96 • Jun 07 '26
r/SpringBoot • u/miss__mystic • Jun 06 '26
Sharing a side project — a focus app where the home screen is a live airport departures board. The backend is Spring Boot: a scheduled generator builds a board from real OpenFlights routes every 45s, caches the snapshot in Redis, and broadcasts it to /topic/board over STOMP. Clients render countdowns locally and fall back to REST polling if the socket drops. Stateless JWT auth, JPA for sessions/stats.
Live: https://aerofocus-ruby.vercel.app/ · Code: github.com/sanchita-88/aerofocus. Happy to talk through any of the design choices.
r/SpringBoot • u/Status_Camel2859 • Jun 06 '26
Here is a sample DTO projection:
@Query("""
SELECT new com.sample.ProductSummaryDTO(
p.id,
p.title,
p.slug,
i.imageUrl,
(SUM(v.stockQuantity) > 0),
MIN(v.displayPrice),
MAX(v.compareAtPrice),
MAX(CASE
WHEN v.compareAtPrice > 0
THEN ROUND(((v.compareAtPrice - v.displayPrice) * 100.0) / v.compareAtPrice)
ELSE 0
END)
)
FROM Product p
JOIN Variant v ON v.product.id = p.id AND v.active = true
LEFT JOIN ProductImage i ON i.product.id = p.id AND i.isPrimary = true
WHERE (:id IS NULL OR p.id = :id)
AND (:title IS NULL OR p.title LIKE CONCAT('%', :title, '%'))
AND (:categoryIds IS NULL OR p.category.id IN :categoryIds)
AND p.visible = true
GROUP BY p.id, p.title, p.slug, i.imageUrl
HAVING (:minPrice IS NULL OR MIN(v.displayPrice) >= :minPrice)
AND (:maxPrice IS NULL OR MIN(v.displayPrice) <= :maxPrice)
""")Assume there are no @OneToMany relationships in the entity model, only @ManyToOne. We also need pagination because the dataset is large.
In a scenario like this, where the response requires aggregated data from multiple tables, it seems that the aggregation logic ends up in the repository query itself. Because at this point you have to select the correct variant, image, price etc all in the Repository itself and therefore the logic for all of that (IFs etc...).
Is this how most people handle it?
Or do you prefer splitting it into multiple steps (which can get pretty verbose), for example:
Im curious what approach is generally preferred in terms of performance, maintainability, and scalability.
r/SpringBoot • u/Specialist-Ad9362 • Jun 06 '26
( Small note: cross-posting from r/java to get Spring Boot feedback and increase the project’s visibility. )
If you have ever shipped a service that writes to a database and publishes events to an event broker (Kafka, Pulsar, etc.) in the same request handler, you have probably hit the dual-write problem: the database commits, the publish fails, and downstream consumers are missing an event they should have received. Or the reverse, where you try to publish to Kafka first and then commit: the publish succeeds, the commit fails, and consumers act on a state change that never happened. The fix is well known, the transactional outbox, but doing it well is mostly plumbing that gets rewritten in every project.
I built Ekbatan for this. It is an open-source Java persistence framework for event-driven systems that builds the outbox pattern into the persistence layer and makes the outbox pattern easier to use.
Ekbatan mostly focuses on safely persisting events in the database alongside the main data in the same transaction. It does not try to be a Kafka/Pulsar/etc publishing framework, although it has helper tools for common ways to use the persisted events, such as local-event-handler for the listen-to-yourself pattern, Or Debezium CDC pipelines with JSON or Avro or Protobuf event conversion to publish messages to Kafka, Pulsar, or similar brokers.
For Spring Boot projects, Ekbatan includes a starter that auto-configures the framework and wires the core pieces into the application context. (There are integrations for Quarkus and Micronaut as well.)
Ekbatan targets Java 25 and later, so it is a fit for new projects rather than older codebases. The supported databases are PostgreSQL, MariaDB, and MySQL. Deployments run on a standard JVM, and the framework also compiles to GraalVM native-image.
Website & Tutorials:
https://zyraz-io.github.io/ekbatan/
Source:
https://github.com/zyraz-io/ekbatan
Available on Maven Central under the `io.github.zyraz-io` group. Licensed Apache 2.0.
Would appreciate your feedback.
r/SpringBoot • u/MarketingReasonable8 • Jun 06 '26
Tell me after completing this what the next thing i do and what is missing in this
r/SpringBoot • u/tomayt0 • Jun 05 '26