Introducing Java Library for Backend Microservice Webflux (Reactor-core)
Link github: https://github.com/hoangtien2k3/reactify-core
1. Library Overview
This library is built on the core components of Spring WebFlux and Reactor-Core – two powerful tools supporting reactive programming. With this library, you can easily build asynchronous microservice applications, handling non-linear data streams efficiently.
Highlight features include:
- Full reactive programming support: Stream-based asynchronous data processing.
- High performance optimization: Minimize the number of threads needed and maximize CPU resources.
- Easy scalability: Suitable for microservice systems that require handling large volumes of requests from users.
2. Advantages of the library
High performance and good responsiveness:
Using a non-blocking mechanism, this library can handle thousands of concurrent requests without creating too many threads, which reduces resource load and improves response speed.Easy stream processing:
Reactor-Core provides a powerful API for stream processing, suitable for applications that need to process continuous data such as real-time notification systems, event processing, and big data processing systems.Easy integration with the Spring ecosystem:
The library is designed to work well with components in the Spring ecosystem such as Spring Security, Spring Data R2DBC, helping to build complete applications with less effort.
Setup reactify-core
1. Use annotation @ComponentScan to scan all libraries
@ComponentScan(basePackages = { "com.reactify.*", // add default: com.reactify.* "com.example.myproject" // varies depending on your project }) @SpringBootApplication public class ExampleApplication { public static void main(String[] args) { SpringApplication.run(Example.class, args); } }
2. Config your project file application.yml or application.properties
# spring config spring: main: web-application-type: reactive allow-bean-definition-overriding: true messages: basename: i18n/messages #connect db R2DBC PostgreSQL r2dbc: url: r2dbc:postgresql://localhost:5434/auth username: admin password: admin pool: max-size: 10 initial-size: 5 # Config connect Keycloak security: oauth2: client: provider: oidc: token-uri: ${keycloak.serverUrl}/realms/${keycloak.realm}/protocol/openid-connect/token registration: oidc: client-id: ${keycloak.clientId} client-secret: ${keycloak.clientSecret} authorization-grant-type: ${keycloak.grantType} #password || #client_credentials resourceserver: jwt: jwk-set-uri: ${keycloak.serverUrl}/realms/${keycloak.realm}/protocol/openid-connect/certs keycloak: client-id: ${keycloak.clientId} # Web client config client: #keycloak keycloak: address: http://localhost:8080/realms/ezbuy-server/protocol/openid-connect name: keycloak auth: client-id: ezbuy-client client-secret: mI92QDfvi20tZgFtjpRAPWu8TR6eMHmw #notification notification: internal-oauth: true address: http://localhost:7777/v1/transmission name: notiServiceClient pool: max-size: 100 max-pending-acquire: 100 timeout: read: 60000 write: 1000 # Unauthenticated endpoints config application: http-logging: request: enable: true header: true param: true body: true response: enable: true body: true whiteList: - uri: /v1/auth/generate-otp methods: - POST - uri: /** methods: - OPTIONS - uri: /v1/auth/get-all methods: - GET data: sync-data: limit: 500 #keycloak client config keycloak: clientId: ezbuy-client clientSecret: mI92QDfvi20tZgFtjpRAPWu8TR6eMHmw realm: ezbuy-server serverUrl: http://localhost:8080 grantType: password host: localhost # minio server config minio: bucket: ezbuy-bucket enabled: true baseUrl: http://localhost:9000 publicUrl: http://localhost:9000/ezbuy-bucket accessKey: 4DoaZ0KdzpXdDlVK104t secretKey: nuRiQUIJNVygMOHhmtR4LT1etAa7F8PQOsRGP5oj private: bucket: ezbuy-private
3. After completing the configuration, start running the project.
# Using Maven mvn spring-boot:run # Using Gradle gradle bootRun
4. Refer to the following project, used
reactify-core library for webflux microservice project: keycloak-auth-service
Everyone can give feedback and find errors or improve this library to help develop the community stronger, thank you very much
Have a nice day
The above is the detailed content of Introducing Java Library for Backend Microservice Webflux (Reactor-core). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Troubleshooting and solutions to the company's security software that causes some applications to not function properly. Many companies will deploy security software in order to ensure internal network security. ...

Solutions to convert names to numbers to implement sorting In many application scenarios, users may need to sort in groups, especially in one...

Field mapping processing in system docking often encounters a difficult problem when performing system docking: how to effectively map the interface fields of system A...

When using MyBatis-Plus or other ORM frameworks for database operations, it is often necessary to construct query conditions based on the attribute name of the entity class. If you manually every time...

Start Spring using IntelliJIDEAUltimate version...

Conversion of Java Objects and Arrays: In-depth discussion of the risks and correct methods of cast type conversion Many Java beginners will encounter the conversion of an object into an array...

Detailed explanation of the design of SKU and SPU tables on e-commerce platforms This article will discuss the database design issues of SKU and SPU in e-commerce platforms, especially how to deal with user-defined sales...

How does the Redis caching solution realize the requirements of product ranking list? During the development process, we often need to deal with the requirements of rankings, such as displaying a...
