r/SpringBoot • u/MrNighty • Jun 11 '26
News Spring Boot 4.1.0 available now
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
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