Microservices Patterns
API Gateway
API gateways are one of most important patterns in the microservices architecture which will act as the signle entry point to the system.
I have implemented API gateway based on Netflix Zuul 1 and Spring Cloud Gateway. Neflix Zuul 1 is based on blocking flow while the Spring Cloud Gateway is implemented on Netty and is a non-blocking gateway that notably increases the performance.
Inbound API Gateway
This project is a special case of API gateway for the Iranian Instant Payment (IIP) project. It is implemented based on Netflix Zuul 1. The gateway exposes REST endpoints to the clinets. It receives requests and publish them to the Apache Kafka using Zuul filters.
Source code of the project is available from here
Apache Kafka/MQ Communication
In order to prevent performance decreament in microservices architecture, utilizing asynchronous communication besides synchronous communications is an essential way. I have implemented communication in microservices through Apache Kafka and IBM MQ.
Apache Kafka’s source code is available from here
IBM MQ’s source code is available from here
Redis Sentinel
Redis Sentinel provides high availability for Redis. In practical terms this means that using Sentinel you can create a Redis deployment that resists without human intervention certain kinds of failures.
I implemented Redis sentinel as a pattern for distributed configuration for our services.
Source code of the project is available from here
Security with OIDC
I implemented security pattern for microservices using Keycloak. It provides OpenID Connect (OIDC) a thin layer on the top of OAuth2.
Technologies/Languages Used
Technology | Usage |
---|---|
Java is used for developing backend services | |
Spring Boot framework is used for developing backend services based on microservices architecture | |
Spring Cloud Gateway for implementing API Gateway, Spring Security for security concerns, and Spring Data JPA for dealing with database. | |
IBM MQ is a message queue which is used for exchanging messages between Socket IO client and banks themselves | |
Apache Kafka is a streaming platform for exchanging messages between mail and tweet servies. | |
Keycloak acts as the authentication and authorization service for the system. It is based on OpenID Connect and OAuth2 | |
Redis is used for implementing distributed configuration services. | |
Docker is used for virtualization and containerizing services, including backend and frontend services. | |
Git is used for version control |
Project information
- Category: Web
- Client: Informatics Services Corporation (ISC)
- Project date: Fall 208 - Now
Project Description
Implementation of microservices common patterns, including API gateway, async communication, redis sentinel, and security through OCID.