Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kpavlov/spring-reactive-messaging
Reactive messaging SQS producer/consumer inspired by Spring Messaging and Spring Integration, implemented using Project Reactor.
https://github.com/kpavlov/spring-reactive-messaging
flux kotlin reactive-programming spring sqs-consumer sqs-publisher
Last synced: 12 days ago
JSON representation
Reactive messaging SQS producer/consumer inspired by Spring Messaging and Spring Integration, implemented using Project Reactor.
- Host: GitHub
- URL: https://github.com/kpavlov/spring-reactive-messaging
- Owner: kpavlov
- Created: 2022-10-10T06:59:41.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-11T06:55:42.000Z (about 2 years ago)
- Last Synced: 2024-12-08T12:25:15.750Z (about 1 month ago)
- Topics: flux, kotlin, reactive-programming, spring, sqs-consumer, sqs-publisher
- Language: Kotlin
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# spring-reactive-messaging
[![Build with Maven](https://github.com/kpavlov/spring-reactive-messaging/actions/workflows/build.yaml/badge.svg)](https://github.com/kpavlov/spring-reactive-messaging/actions/workflows/build.yaml)
Reactive producer/consumer components
inspired by [Spring Messaging](https://docs.spring.io/spring-boot/docs/current/reference/html/messaging.html)
and [Spring Integration](https://spring.io/projects/spring-integration),
implemented using [Project Reactor](https://projectreactor.io/).## Motivation
[Spring Integration](https://spring.io/projects/spring-integration) provides a framework for connecting to messaging
systems,
but there is no support for [AWS SQS](https://aws.amazon.com/sqs/).
Also, [Spring Messaging](https://docs.spring.io/spring-boot/docs/current/reference/html/messaging.html) has synchronous
API which is not designed
for Reactive Streams.So, my immediate goal is to implement reactive message producer and consumer
with a functionality similar to Spring Integration.## Features
* Common abstractions
- [ReactiveMessageHandler](src/main/kotlin/me/kpavlov/messaging/ReactiveMessageHandler.kt) - a reactive version
of [MessageHandler](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/messaging/MessageHandler.html)
interface.
- [ReactiveAcknowledgmentCallback](src/main/kotlin/me/kpavlov/messaging/ReactiveAcknowledgmentCallback.kt) - a
reactive version
of [AcknowledgmentCallback](https://docs.spring.io/spring-integration/docs/current/api/org/springframework/integration/acks/AcknowledgmentCallback.html)
interface.
The class is compatible with its synchronous counterparty.
- [MessageConsumerTemplate](src/main/kotlin/me/kpavlov/messaging/MessageConsumerTemplate.kt) - supports starting
and stopping message consumption as a reaction
on [AvailabilityChangeEvent](https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/availability/AvailabilityChangeEvent.html)* [AWS SQS](https://aws.amazon.com/sqs/) Support
- Reactive [Message Consumer](src/main/kotlin/me/kpavlov/messaging/sqs/consumer/SqsMessageConsumer.kt).
It supports:
- backpressure
- rate limited sqs pooling
- SQS batching
- stopping and starting
on [AvailabilityChangeEvent](https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/availability/AvailabilityChangeEvent.html)- [SqsPublisher](src/main/kotlin/me/kpavlov/messaging/sqs/publisher/SqsPublisher.kt)
## Links
- ["Processing SQS Messages using Spring Boot and Project Reactor"](http://www.java-allandsundry.com/2020/03/processing-sqs-messages-using-spring.html)
- Even more simple SQS Listener: ["How to Setup a Reactive SQS Listener Using the AWS SDK and Spring Boot"](https://nickolasfisher.com/blog/How-to-Setup-a-Reactive-SQS-Listener-Using-the-AWS-SDK-and-Spring-Boot)