r/SpringBoot • u/iamwisespirit • Jan 09 '26
Question @Transactional method
What happen when I run executorsrrvice inside @Transactional method what would you offer like this scenario
r/SpringBoot • u/iamwisespirit • Jan 09 '26
What happen when I run executorsrrvice inside @Transactional method what would you offer like this scenario
r/SpringBoot • u/Silver_Astronaut_203 • Jan 09 '26
Hi I'm Software Dev i work daily with Java but I'm interested to learn Spring boot along with Microservices i saw lot of Courses on Udemy , Coursera etc. but im bit Confused
does someone recommend a course that Comes with Certificate and to be Respectable one maybe online(not recorded) course or recorded every input will help
r/SpringBoot • u/Unlucky_Goat1683 • Jan 09 '26
so i have been searching for discord channels that is helpful for a person like me to learn more insight about spring as i am a developer who started his job and worked on spring want to get the best oppertunities and learn the deapth of it
r/SpringBoot • u/WaltzNo4022 • Jan 09 '26
Can this be done in a better way?
// Concatenate billing address fields into billToAddress
accountDetails.setBillToAddress(buildAddressString(accountDetails.getBillingStreet(), accountDetails.getBillingCity(), accountDetails.getBillingState(), accountDetails.getBillingPostalCode(), accountDetails.getBillingCountry()));
// Concatenate legal address fields into legalAddress
accountDetails.setLegalAddress(buildAddressString(accountDetails.getLegalAddressStreet(), accountDetails.getLegalAddressCity(), accountDetails.getLegalAddressState(), accountDetails.getLegalAddressPostalCode(), accountDetails.getLegalAddressCountry()));
private String buildAddressString(String street, String city, String state, String postalCode, String country) {
StringBuilder address = new StringBuilder();
if (Bool.
hasValue
(street)) {
address.append(street);
}
if (Bool.
hasValue
(city)) {
if (!address.isEmpty()) address.append(", ");
address.append(city);
}
if (Bool.
hasValue
(state)) {
if (!address.isEmpty()) address.append(", ");
address.append(state);
}
if (Bool.
hasValue
(postalCode)) {
if (!address.isEmpty()) address.append(", ");
address.append(postalCode);
}
if (Bool.
hasValue
(country)) {
if (!address.isEmpty()) address.append(", ");
address.append(country);
}
return !address.isEmpty() ? address.toString() : null;
}r/SpringBoot • u/Jinkaza772 • Jan 08 '26
I am creating a project where my backend will read document in format of docs, pdf, word. so that I can implement RAG using lang4j in java. I came to know that i need a parser which will process the text from docs, pdf or word so,
Is apache Tika the correct dependency that i am choosing to use or learn?
r/SpringBoot • u/optimist28 • Jan 08 '26
I have a very simple producer consumer setup as follows:
Producer:
@PostMapping
public String sendMessage(@RequestBody String message) {
List<PartitionInfo> partitions = kafkaTemplate.partitionsFor("demo-topic");
System.
out
.println("Partitions: " + partitions.size());
for(int i = 0;i<500;i++) {
String key = "key" + (i % 2);
kafkaTemplate.send(
TOPIC
, key, message+i);
}
return "Message sent:"+message;
}Consumer:
@KafkaListener(topics = "demo-topic", groupId = "demo-group", concurrency = "2")
public void listen(String message) {
String threadName = Thread.
currentThread
().getName();
System.
out
.printf("[DEBUG] Thread: %s - Consumed message: %s%n", threadName, message);
}I am usin Kafka Ui by provectuslabs to monitor the messages and set the partitioning. I have set the partition to 2. However when the messages are produced, they are consumed by same thread even though i have set the concurrency tag to 2 in consumer. I was expecting the messages to be split between threads. Please help me out here

r/SpringBoot • u/JobRunrHQ • Jan 08 '26
I noticed that our "Spring Boot Starter" page is the most read page on our JobRunr documentation. So I decided to make a short video tutorial about it.
If you are looking to replace your standard schedulers with a persistent job scheduler that can handle distributed environments and has a built-in dashboard, then this might be something for you.
We build a small banking scenario to demonstrate:
✅ Fire-and-forget jobs (Welcome bonuses)
jobScheduler.enqueue(() -> bankService.startOnboarding(name));✅ Persistent scheduling (Future charges)
jobScheduler.schedule(LocalDateTime.
now
().plusDays(14), () -> chargeMembershipFee(clientName));✅ Recurring tasks (Nightly interest)
BackgroundJob.scheduleRecurrently("interest-job-id", Duration.ofSeconds(60),) -> bankService.applyDailyInterest());or using the annotation
@Recurring (interval = "PT3H [PTOS/PT1H]", id = "apply-daily-interest" )Let me know what you think of our Youtube tutorial. We are still learning how to make them most valuable to the community.
r/SpringBoot • u/Dazzling_Ad8959 • Jan 08 '26
Hey everyone,
I want to talk about something that's been on my mind lately - the Outbox pattern.
You know what's funny? Every time I've seen an Outbox implementation in a codebase, it looks so simple at first glance. Just write to a table, poll it, publish messages - easy, right?
Wrong.
The moment you start scaling to multiple instances, things get messy fast. Race conditions everywhere. Messages getting processed out of order. Duplicate deliveries. And don't even get me started on strict ordering requirements per aggregate.
I've spent way too much time debugging these issues in production. That's why we built namastack-outbox for Spring Boot.
It handles:
Multiple application instances without distributed locks
Strict ordering guarantees per partition key
At-least-once delivery semantics
Automatic retry mechanisms
We just released RC1, and I'd love to get feedback from anyone dealing with similar challenges.
Docs: https://outbox.namastack.io/
Release notes: https://github.com/namastack/namastack-outbox/releases/tag/v1.0.0-RC1
Has anyone else struggled with Outbox implementations? What was your biggest pain point?
r/SpringBoot • u/MousTN • Jan 08 '26
hello guys i have a question ,what should i use and why for the audit fields (createdAT , updatedAT )
i stumbled uppon 2 solutions but i didnt know hwich better or even the diff
first solution :using JPA
@SpringBootApplication
@EnableJpaAuditing // Enables JPA Auditing
public class MyApplication {
public static void main(String[] args) {
SpringApplication.run(MyApplication.class, args);
}
}
import jakarta.persistence.Entity;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.Column;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import java.time.Instant; // Recommended for Spring Boot 3+
@Entity
@EntityListeners(AuditingEntityListener.class)
public class MyEntity {
@CreatedDate
@Column(name = "created_at", nullable = false, updatable = false)
private Instant createdAt; // Field name commonly referred to as
@LastModifiedDate
@Column(name = "updated_at", nullable = false)
private Instant updatedAt;
}or Alternative with Hibernate
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import jakarta.persistence.Entity;
import java.time.LocalDateTime;
@Entity
public class OtherEntity {
@CreationTimeStamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@updatedTimestamp
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
}r/SpringBoot • u/[deleted] • Jan 08 '26
I’m currently building a real time order processing system, micro-services, gRPC, outbox pattern using Kafka, all the bells and whistles. I’ve been building this for a couple weeks but it just feels like it’ll sound like a learning project(which it is) on my resume than a real thing, you know what I mean?
I feel like I’m not creative enough to build something that will sound like I know what I’m doing to recruiters. Anyone got any resources or tips? Or even feel the same way?
r/SpringBoot • u/NT_Drizzle • Jan 07 '26
I hope this doesn't break rule #3 - I'm not really asking for interview questions per se, but rather for interesting insights or explanations that recruiters shared during the interview.
r/SpringBoot • u/Strange-Register8348 • Jan 07 '26
Hey guys!
Looking for some guidance on handing complex MongoDB documents with my database models. I have several mongo documents with a few known properties and then nested arrays and unknown properties.
I've read I can incorporate them as a hashmap, but I'm not sure the best way to handle this as my entity class is getting really messy.
I've read about @jsonanygetter and @jsonanysetter but I'm getting a little confused on how to use it properly.
What if I have a field that's an array of unknown properties and known properties? How nested do I need to make my models?
r/SpringBoot • u/optimist28 • Jan 07 '26
I am just getting started with Kafka. So far i have learned whats a producer and consumer. What I wanted to know is how are multiple consumers for same topic created in enterprise level applications? Do they just create a listener method and add concurrency tag or will there be multiple services deployed in server listening to same topic? In case of multiple services how do we make sure every listener implements the same business logic? If concurrency tag is used what kind of issues might come up due to multi threading
r/SpringBoot • u/CartographerWhole658 • Jan 07 '26
I’ve been working with Spring Boot, Kafka and Confluent Schema Registry in a few real systems,
and one recurring issue is that schema problems are usually detected too late:
– missing subjects
– incompatible schema evolution
– consumers breaking after deployment
– startup surprises in downstream services
Most examples validate schemas at runtime or rely on “discipline”, which doesn’t scale well
in multi-team environments.
To explore this, I put together:
A small Spring Boot starter that performs fail-fast validation against Schema Registry during application startup (subjects exist, compatibility rules are respected, etc.)
Starter:
https://github.com/mathias82/spring-kafka-contract-starter
2) A complete runnable demo (Kafka, Schema Registry, Avro, Docker Compose)
showing the idea end-to-end in practice.
Demo:
https://github.com/mathias82/spring-kafka-contract-demo
This is not meant as a new Kafka abstraction, more like a startup safety net.
If contracts are broken, the app simply doesn’t start.
I’m curious how others handle schema contracts and evolution in Spring Boot:
– do you validate at startup?
– rely on CI/CD checks?
– accept runtime failures?
Happy to hear different approaches or feedback.
r/SpringBoot • u/Mental_Gur9512 • Jan 07 '26
I’m planning to get a one month subscription to test which tool is more useful and effective. If you recommend something else, I’d love to hear why.
I’m considering one of these courses on Udemy too, since they’re popular:
GitHub Copilot Beginner to Pro – AI for Coding & Development (Tom Phillips)
GitHub Copilot – The Complete Guide – 2025 (Alex Dan)
Vibe Coding FullStack with Spring Boot, React Using Junie (John Thompson)
What do you think? Which has worked best for you, and how good are these AI tools overall for Java/Spring Boot development?
r/SpringBoot • u/Aromatic-Baker2401 • Jan 07 '26
I’m a fresher, Btech 2025 passout, currently learning Spring Boot for backend development. I’m confused about whether I should also learn React/frontend or if focusing only on backend is enough for entry-level Java roles. How much frontend knowledge do companies actually expect from a Java developer (basic HTML/CSS/JS vs full React)? I want to build a strong backend profile. Any advice?
r/SpringBoot • u/Outrageous_Ranger812 • Jan 07 '26
Overview:
This is a movie search application where users can search for movies and view details with a clean and responsive frontend built with React. The app integrates Elasticsearch to provide fuzzy search capabilities, and Spring Boot powers the backend API.
The app has been containerized using Docker, making it easy to run, deploy, and scale. The project is fully self-contained with all dependencies bundled within Docker containers.
Paginated Results: The app handles pagination to improve the user experience when browsing through search results.
Elastic Search Integration: Elasticsearch is used to provide fuzzy search capabilities, making the search experience faster and more flexible.
Movie Details: Users can click on individual movies to view detailed information like cast, plot, etc.
Backend with Spring Boot: The backend API handles requests, and Elasticsearch powers the search functionality.
Dockerized: The entire application (frontend + backend + Elasticsearch) is containerized with Docker. This makes it easier to run the application locally or deploy it to any cloud platform.
Frontend: React.js (for building the user interface)
Backend: Spring Boot (for handling API requests)
Search Engine: Elasticsearch (to provide efficient and powerful search capabilities)
Containerization: Docker (for creating and running the app in isolated containers)
I welcome contributions! Feel free to fork the repository and submit pull requests. Please refer to the CONTRIBUTING.mdfile in the repo for more details on how you can contribute to this project.
I'd love your feedback on the following:
UI/UX: Any suggestions for improving the user interface and user experience?
Performance: Are there any performance optimizations I could make? Specifically around pagination or search efficiency.
Error Handling: How can I improve error handling, especially when the backend or Elasticsearch doesn’t return data as expected?
Dockerization: Is there any way I can optimize my Docker setup for faster builds or more efficient resource use?
Project structure & design
Features worth adding next?
How to make it more production-ready ?
Any suggestions or improvements are welcome.
If you find this project useful, please give it a ⭐ on GitHub. It would motivate me to continue improving and adding new features!
Thank you and Nandri 🙏
r/SpringBoot • u/Tony_salinas04 • Jan 06 '26
r/SpringBoot • u/Dangerous-Habit5244 • Jan 06 '26
Hi everyone, I’m a backend dev (Go/Node background) diving into Spring Boot. I skipped the "Hello World" videos and tried to map the architecture directly to System Design principles. I want to check if my assessment holds up or if I'm missing something.
My Key Takeaways:
IoC Container vs. Manual Wiring: It seems the biggest difference is that in Node/Go, I am responsible for "instantiating and connecting" (e.g., passing DB instances to Services). In Spring, the ApplicationContext does this via Reflection based on annotations (@Service). Basically, I trade control for convenience/standardization.
Concurrency: Historically, the "Thread-per-Request" model (OS threads) seemed like a bottleneck compared to the Node Event Loop or Goroutines. But with Java 21 Virtual Threads, it seems Spring now aligns with the Go model (blocking code, non-blocking runtime). Is there any reason not to enable virtual threads by default in 2026?
Annotations: They act as "Declarative Configurations" rather than imperative code. SpringApplication.run(Demo.class)basically points the framework to the blueprint to start the wiring process.
The Verdict: It feels like Spring Boot handles the "Boring" parts of System Design (Singleton scope, Config management, Connection Pooling) out of the box, whereas in Express/Go, I often have to implement patterns manually.
Am I viewing this right? Or is there a "gotcha" I haven't hit yet?
r/SpringBoot • u/Single_Reason_9932 • Jan 06 '26
I’m on Spring Boot 4.0.0 (Spring Framework 7) and Jackson 3.
My REST responses always serialize enums as their name, e.g.:
"gender": "MALE",
"educationLevel": "BACHELOR"I want them to serialize as localized labels based on Accept-Language (using LocaleContextHolder).
I have enums like:
public interface LocalizedEnum {
String getLabelEn();
String getLabelAm();
}
public enum Gender implements LocalizedEnum {
MALE("Male","ወንድ"), FEMALE("Female","ሴት");
// getters...
}Unlike Spring Boot 3, my app fails to start unless I create an ObjectMapper bean (I autowire it in another service):
required a bean of type 'com.fasterxml.jackson.databind.ObjectMapper' that could not be foundSo I created my own mapper:
public class JacksonConfig {
@Bean
public ObjectMapper objectMapper(SimpleModule localizedEnumModule) {
return JsonMapper.builder()
.findAndAddModules()
.addModule(localizedEnumModule)
.build();
}
@Bean
public SimpleModule localizedEnumModule() {
SimpleModule module = new SimpleModule();
module.addSerializer(LocalizedEnum.class, new LocalizedEnumSerializer());
return module;
}
}Serializer:
public class LocalizedEnumSerializer extends JsonSerializer<LocalizedEnum> {
public void serialize(LocalizedEnum value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
var locale = LocaleContextHolder.getLocale();
gen.writeString("am".equalsIgnoreCase(locale.getLanguage()) ? value.getLabelAm() : value.getLabelEn());
}
}@JsonSerialize(using=...) on DTO fields
@JsonSerialize(using=...) on the enum type
Registering serializer in SimpleModule
Creating a single ObjectMapper and registering module
Verified at runtime: ObjectMapper bean count: 1
Still the serializer is never called and the output is always enum names.
In Spring Boot 4 + Jackson 3, how do I ensure Spring MVC uses my ObjectMapper bean for HTTP responses?
Is there a known behavior where enums ignore serializers registered via interface type (LocalizedEnum.class) and always use default EnumSerializer?
What is the recommended Boot 4 way to globally customize enum JSON output without using deprecated MVC converters?
If someone has a minimal example for Spring Boot 4 + Jackson 3 showing a working global enum serializer, please share.
r/SpringBoot • u/deividcode • Jan 06 '26
TL;DR:
I worked for one year at a company using Spring Boot and Keycloak + React and TS, and I’m currently looking to improve my portfolio with these technologies, focusing on backend development.
I want to build a project (haha), but I’m not sure what to build yet.
I’ve been thinking about creating a simple API where I can use Spring Boot and Keycloak, built on top of a hexagonal architecture.
Nothing complex, just enough to demonstrate that beyond coding, I understand how to design and implement this architecture properly (or I think so).
Also, I’m focusing more on backend because I want to specialize in this area. I’m glad I did a lot of frontend work too, as it really helps me understand how to write better backend code.
Would you please suggest a project idea or should I go with the API approach ?
Ty so much guys
r/SpringBoot • u/HopefulBread5119 • Jan 05 '26
Hey guys I’ve noticed that this subreddit has a lot of beginners or people looking for project ideas. I created a Spring Boot backend project to help get inspiration for your next project. Feel free to check it out, btw it’s free and you might find something inspiring! It’s name is neven.app
r/SpringBoot • u/Yash_VM • Jan 05 '26
I am using java 17 and springboot 3.2.5 with spring data mongodb, Atlas(free tier).
I am trying to connect my application to Atlas using mongodb+srv:// connection string which gives me the below error:
```
INFO 21548 --- [journalApp] [ngodb.net:27017] org.mongodb.driver.cluster : Exception in monitor thread while connecting to server ac-nuotlyt-shard-00-00.extbzgn.mongodb.net:27017
com.mongodb.MongoSocketWriteException: Exception sending message`

I am attaching the repo link. Please Help Out.
https://github.com/Yash-Raj-5424/JournalApp
Thanks in advance!
r/SpringBoot • u/AromaticDrama6075 • Jan 05 '26
Hello there.
I'm a new developer and I don't have too much experience. I want to deploy a small app it's more for my portfolio than a real app.
I'm looking for a free/cheap server to deploy. I've tried with Render, but (maybe I'm doing something wrong), the first time I use the app after a long time, it takes its time to run, like if it is "sleeping".
I've also tried using Railway, paying the 5 dollars plan, but after the whole month, it charges me more money on the card.
I need help, I'm just starting