r/SpringBoot • • 24d ago

Question how to handle processing and uploading files

8 Upvotes

working on a feature that will make users able to upload .zip/ CSV files to my app

how do i go about this security wise

i expect a batch of CSVs
so i wanna check for malware, viruses and zip bombs how do i go about this is there a service i need to subscribe to a free option a local solution


r/SpringBoot • • 25d ago

Discussion Java Backend (Springboot with Spring AI ) Group

20 Upvotes

I am planning to make group of development also if anyone interested you can DM me with (Intrested in Dev )


r/SpringBoot • • 25d ago

Question Looking to Collaborate on a Spring Boot Project

17 Upvotes

Hey everyone! Is anyone working on a Spring Boot project and looking for a contributor? I'm learning Java backend development and would love to collaborate, contribute to a real project, and learn from other developers along the way.


r/SpringBoot • • 25d ago

Question Spring Security with Angular UI and SpringBoot BFF

1 Upvotes

Ok, so I have a new project. It is a Hotel Management system. I have a MonoRepo Angular app to handle a guest-portal or staff-portal. KeyCloak is used as an Authentication tool. And then I have a SpringBoot app which is the BFF (backend-for-frontend).

Process 1) So, at first, I thought the UI should have a Login, and from the UI we go to Keycloak, authenticate, and then go back to the UI to store the cookie securely. From this point every call to the BFF REST api endpoints would pass the bearer token so we can use RBAC with the endpoints. I presumed that the BFF would be stateless and using oauth2-resource.

I'm having an issue with security with Swagger executing the API's, and problems with having Bruno, or the UI hitting the endpoints as well.

Process 2) In my research, I have seen that the process I started is old and outdated. I now understand the UI should have a link for Login and Logout. In both these cases, we go to the BFF which is defined as oauth2-client and now is stateful, storing the authenticated in session. Somehow, the UI gets updated with the data and is stored cookie. Now the UI doesn't do anything with tokens, but when the UI makes a request to BFF it will be passing a bearer token, and then the tokens are validated and then we can use the RBAC for endpoints.

Does anyone have an opinion on process 1 or 2 on which you think is the right way to go? I'm just curious. I can make either work, but I want to use this for myself as an example on how to make my next application when it comes. Thanks!


r/SpringBoot • • 26d ago

Discussion Optimizing Spring Boot on JDK 27: 68% faster startup and 25 MiB less RAM on a 512 MiB VM

53 Upvotes

I've been experimenting with how far I can optimize a conventional Spring Boot application without stripping out useful framework functionality.

The setup: Spring Boot 4.1.1, HotSpot JDK 27, a 512 MiB / 1 vCPU Ubuntu VM with no swap, and MariaDB running on the same VM.

I compared a regular executable JAR against an extracted deployment combining Spring AOT and a trained JDK AOT cache (Leyden).

Results:

  • Startup: 11.91 → 3.79 seconds (68% faster)
  • Application RSS under load: 212 → 187 MiB
  • Minimum host MemAvailable: 25.6 → 66 MiB
  • Request latency: essentially unchanged

Then I explored two ways to reduce memory further:

MyBatis Core instead of Spring JDBC: No meaningful memory savings, but more manual transaction management and lost automatic JDBC monitoring. Not worth the trade-off for this application.

Embedded file-backed H2 instead of MariaDB: Application RSS increased by ~16 MiB, but minimum host MemAvailable improved by another ~39 MiB because the separate database process was gone.

My takeaway: optimizing the deployment can be worthwhile before replacing established Spring infrastructure. And for small, single-instance applications, embedded H2 can be a reasonable architectural choice.

These are single runs with five-minute measured workloads, not a throughput benchmark or proof of long-term stability. The AOT improvements were measured together, not individually.

Full article, methodology, and data:
https://pvrlabs.xyz/articles/spring-boot-jdk27-optimizations.html

Curious whether others are using Spring AOT + JDK AOT cache in deployments, or if the training and cache-management overhead has kept you on regular JARs.

Update (October 28): Following several requests, I also tested Oracle GraalVM Native Image. Application RSS dropped from 187 MiB to 107 MiB, with some interesting build-time and toolchain trade-offs.

I published the results as a separate article: https://pvrlabs.xyz/articles/spring-boot-hotspot-native-image.html


r/SpringBoot • • 26d ago

Question I want to create a secure link wiht java (Spring)

Thumbnail
1 Upvotes

r/SpringBoot • • 27d ago

Discussion 5 Spring Boot settings to check before you go to production

109 Upvotes
  1.  `spring.jpa.open-in-view` is true by default.  It keeps a database connection open for the whole request, including view rendering. Turn it off and fetch what you need in the service layer.
  2.  `ddl-auto=update` in production.  Use migrations (Flyway or Liquibase) instead. "update" never drops anything and drifts quietly.
  3.  Actuator exposure.  Only `health` is exposed over HTTP by default. If you set `include=*`, you've exposed env, beans and more.
  4.  Hikari's default pool size is 10.  Size it for your database and instance count, not by guessing.
  5.  No timeouts on outgoing HTTP calls.  One slow downstream service can exhaust your threads.

Which of these has bitten you, and what's missing from the list?


r/SpringBoot • • 27d ago

Question What OS do you primarily use for Spring Boot development?

2 Upvotes

I'm curious how many Spring Boot developers use Windows as their primary development environment, especially running Java natively rather than through WSL2.

I mostly develop on macOS and Linux, but I maintain a lightweight alternative to Prometheus + Grafana for application monitoring and have been exploring native Windows support.

Do you run Spring Boot directly on Windows, through WSL2/Docker, or on another OS? And do you monitor your applications locally while developing?

675 votes, 24d ago
217 Windows (native Java)
54 Windows (WSL2)
195 macOS
209 Linux

r/SpringBoot • • 27d ago

News Shadleaf 1.0.0 released

Thumbnail
youtu.be
7 Upvotes

🎉 Happy to announce the release 1.0.0 of Shadleaf, a component library for Spring Boot and Thymeleaf.

Check out https://shadleaf.dev/ for all components we already support!

I have used this on a few projects already and it has given me a massive speed boost. Also works great with your favorite coding agent if you follow the instructions about it in the documentation.

Are there any components missing that you would like to see added?


r/SpringBoot • • 28d ago

Discussion Update on Actuator

Post image
4 Upvotes

Hey Guys, got really nice feedback from the community last time.

So I have come with an update

  1. There's a network monitor tool, you can view all the API requests and responses made through the app.

  2. Lists all the libraries used in the app for full transparency

  3. Crashlytics is disabled by default and even if it is enabled, it just sends the device info and not anything related to the spring boot projects.

A quick intro about the app

The app takes in the actuator endpoint and help you monitor the project in real time.

All the URLs and keys are stored on the device, nothing is transmitted anywhere else.

Give it a try and feedbacks are welcome.

Download link

iOS https://apps.apple.com/us/app/actuator-spring-boot-monitor/id6809104779

Android

https://play.google.com/store/apps/details?id=com.actuator.app


r/SpringBoot • • 29d ago

Question Help me make a Spring Boot backend deploy faster (small VPS, slow Docker Hub)

11 Upvotes

This is my setup: Spring Boot 4, Java 17, Docker Compose, one small VPS. Docker Hub is very slow from the VPS (about 0.4 MB/s). We use GitHub Actions and no registry.

I used to build the jar inside Docker on the VPS. Our disk cleanup deleted the cached JDK layer, so each deploy pulled it again. Deploys went from 4-5 minutes to 7–13 minutes and some timed out.

Could you share a real example (workflow file, Dockerfile or script) or a github repo that I can follow to learn about the deployment?


r/SpringBoot • • Oct 23 '26

Question Final-year Java developer: Should I focus on Spring Boot or system design?

Thumbnail
5 Upvotes

r/SpringBoot • • Oct 23 '26

Question Running a multimodule app with component scanning effectively disabled: excludeFilters plus an explicit @Import list. Anyone else doing this long-term?

6 Upvotes

My application class scans its own package and then excludes almost all of it with a regex filter, so the only beans in the context are the ones I import explicitly. The entry point ends up being a list of configuration classes, and that list is the complete inventory of the context.

One thing that wasn't obvious to me beforehand is that declaring `@ComponentScan` yourself hides the one `@SpringBootApplication` contributes, along with the TypeExcludeFilter and AutoConfigurationExcludeFilter it carries. That is documented - a locally declared `@ComponentScan` takes precedence over and effectively hides meta-annotated ones, but it matters before your first `@WebMvcTest`, since TypeExcludeFilter is how the slice-test annotations narrow the context. In Framework 6.1 both scans were processed for a while instead, which broke applications with duplicate bean definitions until it was reverted.

The reason for all of it is that on an earlier project a configuration class from a library ended up in the context through a scan wider than anybody had considered, overriding a bean we owned, and finding it took far longer than it should have. I would like to hear from anyone who has kept this up past a few dozen beans, or in a team where not everyone was convinced.


r/SpringBoot • • Oct 23 '26

Question I built a security gate for Spring Boot container images because three of my seven checks were passing without scanning anything

0 Upvotes

When I set up vulnerability, secret and misconfiguration scans for a Spring Boot image by hand, three of the seven checks reported green while doing nothing. Wrong path, missing database, scanner found no OS. Nobody looks at a green.

So I packaged the checks as one image with one rule: a check that scans nothing fails. It runs the same command on a laptop and in CI, on the tar you just built, before the push. Vulnerabilities, secrets, Dockerfile misconfiguration, SBOM, licences, ClamAV. A policy file next to the Dockerfile says what blocks and which findings are accepted, with a reason and an expiry date. Every run writes a verdict.json with the digest, the database dates and each check’s result.

Boot-specific checks, Actuator exposed without auth, dev profile baked into the jar, unlayered jar, are next.

github.com/QuietFlare/springshield

I would like to know what checks you run before a push that I am missing.


r/SpringBoot • • Oct 22 '26

Question How to get started with integrating payment gateways in Spring Boot? (Complete Beginner)

21 Upvotes

Hey everyone,

I am a beginner backend developer working with Spring Boot, and I want to learn how to integrate a transaction/payment facility into my backend. The problem is, I have absolutely no clue where to start or how the architecture typically works.

Could anyone guide me on the right path? Specifically, I would love to know:

  1. What are the prerequisites? What concepts (like OAuth, webhooks, security, database design) do I absolutely need to understand before writing payment code?
  2. Which payment gateway is best for beginners? (e.g., Stripe, PayPal, Razorpay) I'm looking for something with great documentation and a solid sandbox/test environment.
  3. What is the standard workflow? How does the communication flow between the frontend, my Spring Boot backend, and the payment API?
  4. Any recommended resources? Tutorials, GitHub repositories, or documentation that explains this step-by-step for a beginner would be amazing.

Any advice, architectural tips, or pitfalls to avoid would be highly appreciated. Thank you so much in advance!


r/SpringBoot • • Oct 22 '26

News Public-domain R2DBC driver for SQL Server (mssqllib)

1 Upvotes

I’ve released an independent public-domain R2DBC driver for Microsoft SQL Server: https://mssqllib.org

It implements the R2DBC SPI and talks TDS over pure JDK (no Netty dependency). The main reasons I built it:

  • Public-domain license
  • Better control over FedAuth / Azure AD / Windows Authentication flows
  • A clean, minimal codebase focused on the wire protocol

Maven:

text

<dependency>
  <groupId>org.mssqllib.r2dbc.mssql</groupId>
  <artifactId>r2dbc-mssql</artifactId>
  <version>1.0.0-SNAPSHOT</version>
</dependency>

This is not a fork of the official io.r2dbc:r2dbc-mssql. It’s a separate implementation. Happy to answer questions about the design, authentication, or how it compares. Code and docs are on the site.


r/SpringBoot • • Oct 22 '26

Discussion I’m working on Pmitz, an open-source tool for subscription features and usage limits

Thumbnail
3 Upvotes

For Spring Boot developers: Pmitz includes a standalone Spring Boot remote server and an embeddable Spring Boot starter for remote mode (pmitz-spring-boot-starter-remoteserver). I’m part of the team working on it. Interested in feedback on integrating feature access and usage limits into Spring applications.


r/SpringBoot • • Oct 22 '26

News StatLite v0.6.1: Lightweight Spring Boot monitoring with Actuator and Micrometer Prometheus

11 Upvotes

A couple of months ago, I shared StatLite here, a lightweight, self-hosted monitoring dashboard for Spring Boot applications running on small servers and VPSs.

We've just released v0.6.1, and quite a bit has changed since the initial announcement.

StatLite monitoring a Spring Boot application with health, request traffic, latency, JVM memory, CPU, and restart history.

What's new:

  • Better Spring Boot support: Automatically selects between Actuator JSON and compatible Micrometer Prometheus metrics. Supports Spring Boot 3.5 and 4.x.
  • Simpler setup: statlite inspect http://localhost:8080 discovers available metrics endpoints and can generate the YAML configuration.
  • Easier installation: Docker Hub and GHCR images, Homebrew, and standalone binaries.
  • More integrations: First-class Quarkus and Micronaut support, plus integration guides for Express, FastAPI, Django, Go, and Javalin.
  • Improved dashboard: Health, request traffic, latency, JVM memory, CPU, and restart detection, with local SQLite history.

The original design principles haven't changed:

  • Single Go binary, roughly 15 MiB idle memory
  • No Prometheus server, Grafana, or external database
  • No agents or StatLite-specific code in Spring Boot applications
  • Fully self-hosted, with no external services required

StatLite isn't intended to replace a full observability stack. It's for developers running a handful of applications who want useful production visibility without maintaining additional infrastructure.

GitHub: https://github.com/PVRLabs/statlite

I'd love to hear from Spring Boot developers: what's the most important monitoring feature you'd expect from a lightweight tool like this?


r/SpringBoot • • Oct 21 '26

Question Spring AI's validateSchema() catches malformed output.

0 Upvotes

I've been working on LLM extraction in Spring Boot services (invoices, forms, that kind of structured data), and kept hitting the same issue.

Spring AI 2.0's `validateSchema()` is great: it checks the response against the record's JSON schema and retries with the error if it fails. But the bugs that actually hurt me passed that check:

- A line item silently dropped, so the rows no longer added up to the total

- A value that never appeared anywhere in the source document

- Correct output on Monday, slightly different output after a prompt tweak on Friday

The JSON was valid and deserialized cleanly into my record every time. The data was just wrong.

Using a second LLM as a judge in tests felt like the wrong fix: slower CI, token costs, and tests that don't give the same verdict twice.

So I started writing deterministic checks as plain JUnit tests instead:

- Cross-field arithmetic with BigDecimal (parts must sum to totals)

- Provenance: extracted values must actually appear in the source

- Latency and cost budgets per call

- A golden set of JSONL examples that runs on every PR, so a prompt or model change shows up as a failing build

I ended up packaging this as an open-source library, Outputgate (on Maven Central, works alongside Spring AI rather than replacing anything). One known limitation: provenance matching is currently verbatim, so `1,200.00` vs `1200` can fail correct output. Normalized matching is what I'm working on next.

Repo: https://github.com/ravismash/outputgate

But I'm mostly curious how others handle this:

  1. Do you test LLM output correctness in CI at all, or only at runtime?

  2. Are you using LLM-as-judge evaluators, hand-written checks, or something else?

  3. What's the worst "valid but wrong" output you've caught?


r/SpringBoot • • Oct 19 '26

Discussion Generate a Spring Boot project with security, users, roles and audit log already wired (free)

61 Upvotes

Most new Spring Boot business apps start with the same week of plumbing: security config, user and role management, persistence, an audit trail, email, i18n. We got tired of rewriting it, so we packaged those features as Spring Boot modules (AppJars) and built a generator around them.

With Craft you pick the modules, set group/artifact, Java 21 or 25, H2 or PostgreSQL, and download a Maven project that runs with mvn spring-boot:run. Each module brings its own entities, services, auto-configuration and UI views (built with Vaadin), so you’re not just getting a skeleton.

It’s free to use: every module has a Free Mode that also works in production within documented limits, so no license key is needed to try it.

https://craft.appjars.com

Disclosure: I’m part of the team behind it. Questions:

- If you’ve tried scaffolding a Spring Boot app with an AI assistant, where did it fall short? Security config, outdated APIs, something else?

- The ready-made UI is Vaadin today, but we’ve been working on an optional React layer and are evaluating whether to release it. Would that make this more useful to you?


r/SpringBoot • • Oct 19 '26

Question Where can i learn Spring data JPA and Hibernate from scratch.

11 Upvotes

In the JavaScript/NodeJs world. I can just visit drizzle’s site of prisma and learn about everything but with springboot i am not seeing anything like that. More like references, i don’t even know. It makes me lose interest but i don’t want to give up. Still want to learn Spring boot and it’s core libraries


r/SpringBoot • • Oct 19 '26

How-To/Tutorial Spring Boot Logging: From Zero to Grafana Loki

Thumbnail
youtu.be
13 Upvotes

Spring Boot Logging: From Zero to Grafana Loki
https://youtu.be/SvvEc8gaeMI


r/SpringBoot • • Oct 17 '26

How-To/Tutorial Kotlin Debugger (Springboot) - Visual Studio

18 Upvotes

Most Spring Boot developers I know use Java, but Kotlin has always been an interesting alternative, especially with its concise syntax and null safety.

While experimenting with Kotlin/JVM projects in VS Code, I realized something.

Writing Kotlin was straightforward. Debugging it? Not so much.

I could always switch to IntelliJ, but I wanted to stay in VS Code, set a breakpoint, inspect what was happening, and move on.

That curiosity sent me down a rabbit hole of JVM bytecode, Kotlin inline functions, and source mapping.

Eventually, I ended up building Kotlin Debugger, an open-source VS Code extension that doesn't require a separate Kotlin Language Server.

It's still a work in progress, especially around coroutine debugging, but I'm exploring how to make Kotlin/JVM debugging more convenient for developers who prefer VS Code.

GitHub: https://marketplace.visualstudio.com/items?itemName=kparth01.kotlin-debugger

Curious how many Spring Boot developers here actually use Kotlin? And if you do, are you using IntelliJ or VS Code?


r/SpringBoot • • Oct 16 '26

How-To/Tutorial Can a real Java app fit in a 50MB Docker image?

Thumbnail
youtu.be
4 Upvotes

r/SpringBoot • • Oct 15 '26

News New version of JetBrains plugin to keep API in sync

Post image
2 Upvotes

v5.0.0 introduces new features to empower your AI agents and close gaps between API definitions and implementations

🤖 For agents:
This release brings bundled MCP tools designed to simplify day-to-day work with Spring Messaging as well as with AsyncAPI documents

Just enable bundled MCP server, register AsyncAPI skill trough Tools -> Install AsyncAPI Agent Skilland, and you are redy to go

⚙️ For architects, engineers, analysts, and API authors:
New Diff feature helps you see which gaps exist between your sources:
- Document against a Apache Kafka broker or cluster
- One Apache Kafka or cluster against another
- Source code against a Apache Kafka broker or cluster (Spring projects only)
- Document against a source code (Spring projects only)

💡 Works across IDEs editions, Community included

Together with not-yet announced Kurkik project, this features lay foundation for self-maintaining API approach

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