Recent Posts (spring cloud)
Dynamic Message Delays in RabbitMQ Without Plugins
- By Ercan
- 01/11/2025
Delayed messaging is a common requirement in distributed systems: scheduling retries, deferring notifications, or throttling workloads. RabbitMQ provides built-in support for message expiration and dead-lettering, but most tutorials rely on queue-level TTL. This approach has a major limitation: changing the TTL requires creating a new queue with updated arguments. In real-world systems, however, the required delay may vary over time. Sometimes you need 5 seconds, sometimes 30 seconds, sometimes longer. Re-creating queues at runtime is not practical, and relying on external plugins (like rab..
Redis Pub/Sub Explained with a Real-World Example
- By Ercan
- 29/10/2025
Real-time communication between distributed services is a common challenge in modern applications. Traditional approaches, such as polling the database or cache on each request, introduce latency, network overhead, and scalability issues. To tackle this, Redis Pub/Sub provides a push-based notification mechanism that allows instances to stay in sync instantly and efficiently. To illustrate this concept, we implemented a feature flag synchronization project in Spring Boot. While feature flags serve as our example scenario, the core lesson is about Redis Pub/Sub architecture and its advan..
Understanding OSIV in Spring Boot — Convenience or Hidden Bottleneck?
- By Ercan
- 29/10/2025
Spring Boot enables Open Session in View (OSIV) by default, allowing lazy-loaded entities to be accessed even after a transaction has ended. While this behavior simplifies development and prevents common exceptions, it can quietly turn into a performance bottleneck in production. In this article, we’ll explore: How OSIV works under the hood Why it’s helpful for developers What risks it introduces in real-world systems How to measure its performance impact TL;DR: If you want to skip the explanation and dive straight into the code, check out the full implementation on G..
Building Scalable gRPC Microservices with Spring Cloud: Eureka vs Consul
- By Ercan
- 28/10/2025
Modern microservices architectures demand scalable, resilient service discovery. In this post, I’ll walk you through a real-world implementation using Spring Boot, Spring Cloud, and gRPC, comparing two popular service registries: Eureka and Consul. Architecture Overview This project is structured as a multi-module Maven application, each module serving a distinct role: config-server: Centralized configuration using Spring Cloud Config. grpc-lib: Contains the gRPC service definition (hello.proto) and generated stubs. grpc-server: Implements the HelloService gRPC service. grpc-..
String Boot Hexagonal Architecture Example
- By Ercan
- 25/10/2025
Architectural concepts like ports, adapters, domain, infrastructure frequently feel abstract when you first read about them. To move from theory to intuition I built a small, multi-module Spring Boot project: a calculator that performs addition, subtraction, multiplication and division, and logs every calculation to a database. The point of this project is not complex business logic — it’s to show how Hexagonal Architecture (aka Ports & Adapters) organizes code so the domain remains framework- and I/O-agnostic, while adapters provide concrete interfaces to the outside world (REST, SOAP,..
Spring Boot Bottom-Up SOAP Service Example
- By Ercan
- 22/10/2025
SOAP services are still widely used in enterprise systems and legacy integrations. However, new Spring Boot developers often struggle with WSDL, XSD, and Jakarta namespaces. In this blog, we will create a bottom-up SOAP service where the WSDL is automatically generated from Java classes and annotations. The project uses jaxws-spring-jakarta, a modernized SOAP runtime compatible with Spring Boot 3. TL;DR: If you want to skip the explanation and dive straight into the code, check out the full implementation on GitHub: https://github.com/ercansormaz/soap-producer-bottom-up ..
Spring Boot Command Pattern Example
- By Ercan
- 21/10/2025
The Command Pattern is one of the most versatile and widely used behavioral design patterns. It encapsulates a request as an object, allowing you to parameterize, queue, and execute actions dynamically — all without tightly coupling the caller to the actual logic being executed. In this article, we’ll explore how to apply the Command Pattern in a real-world Spring Boot project, where we execute different text encoding and decoding algorithms such as Caesar, Atbash, and ROT13. This example is designed to be both educational and practical — ideal for developers who want to deeply understan..
Spring Boot Template Method Pattern Example
- By Ercan
- 19/10/2025
Design patterns are timeless tools that bring structure and clarity to software projects. In this post, we’ll explore how to use the Template Method Pattern within a Spring Boot application — through a simple but practical example: an Email Builder API. TL;DR: If you want to skip the explanation and dive straight into the code, check out the full implementation on GitHub: https://github.com/ercansormaz/template-method-pattern What Is the Template Method Pattern? The Template Method Pattern defines the skeleton of an algorithm in a base (abstract) class and allows subclasses to redef..
Spring Boot Rate Limiting Example based on Redis
- By Ercan
- 15/10/2025
Rate limiting is one of the most fundamental building blocks in backend engineering — it protects your system from excessive requests, ensures fair usage, and prevents overload. While there are countless ways to implement it, achieving both accuracy and efficiency in a distributed environment is a more delicate challenge. In this post, I’ll share my hands-on experience building a Redis-based rate limiting system in Spring Boot, comparing five popular algorithms, and highlighting how Lua scripting can significantly improve performance and reliability. Project Overview The project, a..
Spring Boot Iterator Pattern Example
- By Ercan
- 28/09/2025
When working with multiple processing strategies—such as hashing algorithms—it is common to loop through a collection and apply each one. However, directly exposing the collection and iterating outside the component can make the code fragile and tightly coupled. This is where the Iterator Pattern comes into play. TL;DR: If you want to skip the explanation and dive straight into the code, check out the full implementation on GitHub: https://github.com/ercansormaz/iterator-pattern The Use Case: Hashing Text with Multiple Algorithms Our Spring Boot application takes a text input and re..
