🚀 Day 39 – Java Backend Journey | Running User & Notification Services Together 🔹 What I practiced today Today I worked on running multiple microservices together, specifically the User Service and Notification Service, and verified their communication using Kafka. 🔹 What I implemented ✔ Started both services on different ports User Service → port 9090 Notification Service → port 9091 ✔ Verified Kafka-based communication User Service → Kafka → Notification Service • User Service produces UserCreated event • Notification Service consumes the event • Notification is triggered 🔹 What I observed • When a user is created → event is published • Notification service receives the event instantly • Services work independently but communicate via Kafka 🔹 What I learned • How to run multiple services simultaneously • Importance of port configuration • How microservices interact in real-time • Practical understanding of event-driven communication 🔹 Why this is important ✔ Demonstrates real microservices architecture ✔ Shows decoupled communication ✔ Helps in building scalable systems ✔ Common in real-world backend projects 🔹 Key takeaway Running multiple services together helped me understand how independent microservices collaborate using events, forming a complete backend system. 📌 Next step: Add API Gateway for centralized routing. #Java #SpringBoot #Microservices #Kafka #BackendDevelopment #EventDrivenArchitecture #SoftwareEngineering #LearningInPublic #JavaDeveloper #100DaysOfCode
Running User & Notification Services with Kafka in Java
More Relevant Posts
-
🚀 Day 37 – Java Backend Journey | Service Communication 🔹 What I learned today Today I explored how microservices communicate with each other, which is a key part of building distributed systems. 🔹 Types of Service Communication ✔ 1️⃣ Synchronous Communication (REST APIs) Services communicate using HTTP requests and wait for a response. Example: User Service → Order Service (REST API call) • Uses: RestTemplate / WebClient • Immediate response required ✔ 2️⃣ Asynchronous Communication (Event-Driven / Kafka) Services communicate by sending events without waiting for a response. Example: User Service → Kafka → Notification Service • Uses: Kafka / Message Brokers • No direct dependency between services 🔹 What I practiced • Understanding when to use REST vs Kafka • How services interact in real-world systems • Importance of decoupling services 🔹 REST vs Kafka • REST → Simple, direct communication • Kafka → Scalable, event-driven communication 🔹 What I understood • Synchronous calls can create tight coupling • Asynchronous communication improves scalability • Choosing the right communication style is important 🔹 Key takeaway Service communication is the backbone of microservices, and using the right approach (REST or Kafka) helps build efficient, scalable, and loosely coupled systems. 📌 Next step: Implement service-to-service communication using REST and Kafka in real projects. #Java #SpringBoot #Microservices #Kafka #RESTAPI #BackendDevelopment #SoftwareEngineering #LearningInPublic #JavaDeveloper #100DaysOfCode
To view or add a comment, sign in
-
🚀 Day 26 – Java Backend Journey | Producing UserCreated Event Today I practiced implementing a real-world event-driven use case by producing a UserCreated event whenever a new user is created. 🔹 What I practiced today I integrated Kafka with my User Service and configured it to publish an event after a user is successfully created. 🔹 What is UserCreated Event? A UserCreated event is triggered when: 👉 A new user is added to the system 👉 An event message is sent to Kafka 👉 Other services (like Notification Service) can consume it 🔹 Implementation Approach 1️⃣ Create user using API 2️⃣ Save user in database 3️⃣ Produce event to Kafka topic 🔹 Example Code public User createUser(User user) { User savedUser = userRepository.save(user); // Publish event to Kafka kafkaTemplate.send("user-topic", "User created with ID: " + savedUser.getId()); return savedUser; } 🔹 Event Flow User Service → Kafka Topic → Other Services • User is created • Event is published • Other services can react to it 🔹 What I learned • How to integrate Kafka Producer in Spring Boot • How events are published after DB operations • Basics of event-driven communication • How services can be loosely coupled using events 🔹 Why this is important Producing events like UserCreated is a key concept in: ✔ Microservices architecture ✔ Notification systems ✔ Real-time processing systems 🔹 Key takeaway Event production allows backend systems to communicate asynchronously, making applications more scalable, flexible, and efficient. 📌 Next step: Implement Kafka Consumer to handle UserCreated events. #Java #SpringBoot #Kafka #EventDrivenArchitecture #BackendDevelopment #Microservices #SoftwareEngineering #LearningInPublic #JavaDeveloper #100DaysOfCode
To view or add a comment, sign in
-
Java vs Go: Key Learnings from a POC Recently explored a POC comparing Java and Go to understand how they perform across modern backend use cases. Here are some key takeaways: 🔹 Concurrency & Performance Go’s lightweight goroutines make handling high concurrency simple and efficient. Java, with JVM optimizations and multithreading, continues to deliver strong, stable performance at scale. 🔹 Development Experience Java offers a mature ecosystem with frameworks like Spring Boot that accelerate enterprise development. Go keeps things minimal and straightforward, reducing complexity and boilerplate. 🔹 Resource Utilization Go is generally more memory-efficient and faster to start. Java consumes more resources but provides powerful tooling and flexibility for complex systems. 🔹 Ecosystem & Use Cases Java remains dominant in enterprise applications with a vast ecosystem. Go is a strong choice for cloud-native, microservices, and high-throughput systems. Final Thought: There’s no one-size-fits-all answer, both languages are powerful in their own space. The right choice depends on the problem you’re solving. Curious to hear others’ experiences with Java vs Go! #Java #GoLang #BackendEngineering #Microservices #Performance #Cloud #SoftwareEngineering #TechPOC #ReleaseManagement #SeniorDeveloper #FullStackDeveloper #SoftwareEngineering #SystemDesign #ContinuousDelivery #EngineeringExcellence #APIs #SpringBoot #EngineeringDecisions
To view or add a comment, sign in
-
-
🚀 Day 30 – Java Backend Journey | Producing UserCreated Event Today I implemented a real-world event-driven feature by producing a UserCreated event whenever a new user is created in the system. 🔹 What I practiced today I integrated Kafka Producer into my Spring Boot application and triggered an event after successfully saving a user to the database. 🔹 What is UserCreated Event? A UserCreated event represents: 👉 A new user has been successfully created 👉 An event is published to Kafka 👉 Other services can react to this event asynchronously 🔹 Implementation Flow 1️⃣ Client sends request to create user 2️⃣ User is saved in database 3️⃣ Event is published to Kafka topic 🔹 Event Flow User Service → Kafka Topic → Other Services • User created • Event produced • Consumers process the event 🔹 What I learned • How to integrate Kafka Producer in Spring Boot • How to publish events after database operations • Basics of event-driven communication • Importance of asynchronous processing 🔹 Why this matters Producing events like UserCreated is essential in: ✔ Microservices communication ✔ Notification systems ✔ Real-time workflows 🔹 Key takeaway Event production enables backend systems to communicate efficiently and asynchronously, making applications more scalable and loosely coupled. 📌 Next step: Enhance events with structured payload (JSON) and schema design. #Java #SpringBoot #Kafka #EventDrivenArchitecture #BackendDevelopment #Microservices #SoftwareEngineering #LearningInPublic #JavaDeveloper #100DaysOfCode
To view or add a comment, sign in
-
-
🧩 Monolith vs Microservices – What Should You Choose? As a Java developer, I’ve worked with both monolithic and microservices-based architectures, and here’s my perspective: 🔹 Monolithic Architecture Simple to develop and deploy Easier for small teams Good for early-stage projects 🔹 Microservices Architecture Better scalability Independent deployments More flexible for large systems ⚠️ Challenges in Microservices: Increased complexity Requires proper service communication Needs monitoring and logging setup 💡 My Take: Start with a well-structured monolith, and move to microservices only when the system demands scalability. ⚙️ Tech Context: Java, Spring Boot, REST APIs Understanding when to use each architecture is more important than blindly following trends. #Java #SpringBoot #Microservices #SystemDesign #SoftwareArchitecture
To view or add a comment, sign in
-
🚀 Day 35 – Java Backend Journey | Consuming User Events from Kafka Today I focused on consuming user-related events from Kafka, continuing my work on event-driven architecture. 🔹 What I practiced today I implemented a Kafka Consumer to listen to UserCreated events and process them in a separate service. 🔹 What is Event Consumption? Event consumption means: 👉 Listening to events from a Kafka topic 👉 Processing the data asynchronously 👉 Triggering actions based on the event 🔹 Implementation Used @KafkaListener to consume events: see the image... 🔹 Event Flow User Service → Kafka Topic → Consumer Service • Event is produced • Consumer listens to topic • Event is processed 🔹 What I learned • How Kafka consumers listen to events • Asynchronous processing of messages • Role of consumer groups • How services react to events independently 🔹 Why this is important ✔ Enables real-time processing ✔ Decouples services ✔ Improves scalability ✔ Core concept in microservices 🔹 Key takeaway Consuming events from Kafka allows backend systems to react dynamically and asynchronously, making them more scalable and efficient. 📌 Next step: Process events with business logic and integrate with other services. #Java #SpringBoot #Kafka #BackendDevelopment #Microservices #EventDrivenArchitecture #SoftwareEngineering #LearningInPublic #JavaDeveloper #100DaysOfCode
To view or add a comment, sign in
-
-
After 10+ years in Java backend development, one thing stands out clearly: building microservices is easy, but building maintainable and scalable microservices is the real challenge. A good backend service is not just about writing APIs in Spring Boot. It is about defining the right boundaries, handling failures properly, designing for observability, managing data carefully, and making systems easier to scale and support over time. Clean code is important, but clean architecture and strong engineering decisions make the biggest difference in enterprise applications. #Java #SpringBoot #Microservices #BackendDevelopment #SoftwareArchitecture #RESTAPI #JavaDeveloper Building Maintainable Java Microservices Spring Boot | REST APIs | Kafka | AWS
To view or add a comment, sign in
-
-
🚀 Day 34 – Java Backend Journey | Creating Notification Service Today I worked on building a Notification Service as part of my event-driven architecture using Kafka. 🔹 What I practiced today I created a separate Notification Service that listens to the UserCreated event and performs an action (like sending a notification). 🔹 What is Notification Service? A Notification Service is responsible for: 👉 Listening to events (e.g., UserCreated) 👉 Processing them independently 👉 Sending notifications (Email / SMS / Logs) 🔹 Implementation Used Kafka Consumer to listen for events: see the image for the implementation 🔹 Event Flow User Service → Kafka → Notification Service • User is created • Event is published • Notification service consumes event • Sends notification 🔹 What I learned • How to create a separate consumer service • How services communicate using Kafka events • Importance of loose coupling between services • Basics of microservices communication 🔹 Why this is important ✔ Decouples notification logic from main service ✔ Improves scalability ✔ Enables asynchronous processing ✔ Common pattern in real-world systems 🔹 Key takeaway Notification services are a core part of event-driven architectures, allowing systems to react to events without tightly coupling services. 📌 Next step: Enhance notification service with email integration and error handling. #Java #SpringBoot #Kafka #Microservices #EventDrivenArchitecture #BackendDevelopment #SoftwareEngineering #LearningInPublic #JavaDeveloper #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 27 – Java Backend Journey | Kafka Consumer for UserCreated Event Today I implemented a Kafka Consumer to handle the UserCreated event, completing the basic flow of event-driven communication between services. 🔹 What I practiced today After producing the UserCreated event, I created a consumer service to listen to the Kafka topic and process incoming messages. 🔹 What is a Kafka Consumer? A Kafka Consumer: 👉 Subscribes to a topic 👉 Listens for incoming events 👉 Processes the data asynchronously 🔹 Implementation I used @KafkaListener to consume messages from the topic. @KafkaListener(topics = "user-topic", groupId = "group-1") public void consume(String message) { System.out.println("Received event: " + message); } 🔹 Event Flow User Service → Kafka Topic → Consumer Service • User is created • Event is published • Consumer receives and processes it 🔹 What I learned • How to implement Kafka Consumer in Spring Boot • How services listen to events asynchronously • Importance of consumer groups • Basics of event processing 🔹 Real-world use case When a user is created: ✔ Send welcome email ✔ Trigger notification service ✔ Log user activity All handled by consumers without affecting the main service. 🔹 Key takeaway Kafka Consumers enable backend systems to react to events in real time, making applications more scalable, decoupled, and efficient. 📌 Next step: Implement error handling and retries in Kafka consumers. #Java #SpringBoot #Kafka #EventDrivenArchitecture #BackendDevelopment #Microservices #SoftwareEngineering #LearningInPublic #JavaDeveloper #100DaysOfCode
To view or add a comment, sign in
-
Why write boilerplate client code when your API model can generate it? Smithy Java client code generation is now generally available, enabling developers to build type-safe, protocol-agnostic Java clients directly from Smithy models. The framework automatically generates serialization, protocol handling, and request/response lifecycles, eliminating manual coding overhead. Built on Java 21 virtual threads, Smithy Java offers protocol flexibility, runtime dynamic clients, and shape-based code generation-keeping API definitions and implementations synchronized as services evolve. #AWS #Cloud #Java #APIDesign #Smithy #DeveloperTools #CloudNative #Microservices Read more: https://lnkd.in/dwuQ2J4P
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development