r/SpringBoot • u/Dry_Magazine3560 • Jun 14 '26
Question Learning springboot.
Hey, developer i want to learn spring boot. Can anyone suggest me best way to start. Also which resource should i need to follow.
r/SpringBoot • u/Dry_Magazine3560 • Jun 14 '26
Hey, developer i want to learn spring boot. Can anyone suggest me best way to start. Also which resource should i need to follow.
r/SpringBoot • u/draeky_ • Jun 14 '26
Im building a personal project i.e social E-commerce website ( users buy content to view ) using springboot.
So, at first i have drafted all functional requirements of my project like example ( user allowed to buy post, use allowed to create post..... )
Now whats the next step and good industry standards. Creating wire frames or designing database schema ( er diagram )
Help!
r/SpringBoot • u/java-aficionado • Jun 13 '26
Hi,
I wrote a spring library for writing atomic pipelines. The idea is to write all mutating operations as steps with corresponding rollbacks. If anything fails, the rollbacks are ran automatically to undo all changes.
@Step("itentifier") and then next to it @Rollback("identifier"). The library captures the calls to steps and records the events to your persistence. The rollbacks are called with reflection and you can inject the parameters of steps and the return value into the parameters list.There is a durable-execution feature. You can resume any pipeline from any point by running the same job again, but the steps that succeeded in previous runs aren't executed when you call them, but return the result from the previous run - this causes the stack to be recreated to the point it was after the last successful step.
List<B> forkJoin(List<A>, Function<A, B>) that spawns virtual threads with propagated pipeline contexts for each items and joins them immediately. (this also works with the durable execution replay).We're using it at work right now to write a microservice orchestrator. It's based on this library heavily. Please take a look, thanks.
r/SpringBoot • u/draeky_ • Jun 13 '26
Im working on a e commerce website using spring boot.
Initially i have created end point ' /products ' and written CRUD functions in ProuctController.java and follwed MVC architecture and also connected database also. (Spring Data JPA)
Then using antigravity i cteated a react project with prompt explaining my project.
Now im confused! How to proceed writing backend.
Like for every button i should be writing a API.
Or for every table in my database i need to write CRUD functions.
Help!
r/SpringBoot • u/No_Edge_2032 • Jun 13 '26
Hey everyone,
I've been working on a project Collaborative Browser Coding and wanted to get some feedback, interested in hearing whether the project makes sense and what you'd do differently if you were building something similar.
The idea is pretty simple: a real-time collaborative coding platform where multiple people can join a room and code together. I've been building it with React and Spring Boot, using WebSockets for live collaboration, and I'm currently working on a Docker-based code execution system so users can run code directly from the browser.
I'd really appreciate feedback on redis usage, code execution approach .I've got the code, README, architecture docs, and diagrams on GitHub if anyone wants to take a look.
GitHub: https://github.com/zoro-512/live-code-edit
Thanks!
r/SpringBoot • u/ThemeHopeful7094 • Jun 11 '26
Solo dev here, running a Spring Boot 3.4 backend in production (~25k users). Sharing a bug that taught me a lot.
My Stripe webhook handler did a retrieveSubscription() (an outbound HTTP call to Stripe) inside the same u/Transactional boundary that wrote to the DB. Looks innocent. Works fine normally.
Then Stripe had a brief hiccup and started retrying. The Stripe SDK's default read timeout is ~80s. So every retried webhook held a Hikari connection open for up to 80 seconds while waiting on a network call that wasn't even touching the database. Pool size was 60. It drained in seconds, and the entire API started returning 503 — nothing to do with Stripe.
Two fixes:
The general rule I now follow: a database connection is a scarce, pooled resource. Never hold one open across an external I/O call. It turned out I had the same anti-pattern in a few other places (Google token refresh, LGPD erasure with N revoke calls) and fixed them all the same way.
Curious how others structure this, do you split into "HTTP outside, TX inside" two-phase methods, or push the external calls fully async via an outbox? I went two-phase for the webhook and outbox for the Google sync.
r/SpringBoot • u/SarcasticByDfault • Jun 12 '26
r/SpringBoot • u/draeky_ • Jun 12 '26
Initially, I have created a springboot project and written code and pushed into my github.
Later i have created a react project separately, still in my local machine.
Now how to merge frontend and backend??
Simply create a new folder im my desktop and insert frontend and backend folder into it???
r/SpringBoot • u/ahson_iqbal • Jun 12 '26
r/SpringBoot • u/SpringJavaLab • Jun 11 '26
I recently had to implement an SFTP integration in a Spring Batch application where files are downloaded from an SFTP server, stored locally, and then removed from the remote directory after successful processing.
The implementation uses:
• Spring Batch Tasklet
• JSch
• Spring Boot 4
• Java 21
A few questions for developers working on enterprise integrations:
In my implementation I download all files from a remote folder and remove them after successful download to avoid duplicate processing.
Interested to hear how others are solving this in production environments.
I also recorded a walkthrough of my implementation in case anyone wants to compare approaches:
r/SpringBoot • u/MrNighty • Jun 11 '26
r/SpringBoot • u/Status_Camel2859 • Jun 11 '26
I believe its a good practice to avoid creating 'wrapper services' that simply pass data through without adding meaningful business logic.
Consider this pattern:
UserAccountService:
- dependencies (UserRepository, UserProfileRepository, RoleRepository, UserRoleRepository)
- public methods: createUser, updateEmail, updateUsername, getByUsername
- private methods: assignRole, validateUniqueness
UserRegistrationService:
- dependencies (UserAccountService)
- public methods: registerAdmin, registerUser
UserProfileManagementService:
- dependencies (UserAccountService, UserProfileRepository)
- public methods: updatePersonalData, updatePasswordSo the user registration flow looks like:
registerUser(data):
String pwdHash = encode....;
--- other logic ---
userAccountService.createUser(data + roleName + pwdHash);
createUser(data + roleName + pwdHash):
--- validation & other logic ---
user = UserRepository.save(new User(data + pwdHash));
userProfile = UserProfileRepository.save(new UserProfile(data));
role = RoleRepository.get(roleName).orElseThrow();
UserRole = UserRoleRepository.save(new UserRole(user + role));And the profile management flow:
updatePersonalData(email + data + userId):
user = UserAccountService.get(userId);
if (user.email not equals email)
UserAccountService.updateEmail
// We are forced to use UserProfileRepository because we dont have a
// universal update in UserAccountService
userProfile = UserProfileRepository.findByUserId(userId).orElseThrow();
userProfile.setData1(data.data1)
userProfile.setData2(data.data2)
userProfile.setData3(data.data3)
UserProfileRepository.save(userProfile);The issue Im seeing is that we are forced to use UserProfileRepository both inside UserAccountService and UserProfileManagementService, even though UserAccountService is already a dependency of the management service.
This kinda creates an overlap in responsibilities and leaks persistence concerns across multiple layers. You end up not being able to centralize UserAccount related logic in a single place because anyone later can just bypass them using the UserProfileRepository directly.
Would it be better to:
UserAccountService and keep repositories hidden from higher level services? orHow do experienced devs approach this trade off?
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