https://github.com/smallrye/smallrye-reactive-messaging
SmallRye Reactive Messaging
https://github.com/smallrye/smallrye-reactive-messaging
kafka messaging microprofile reactive
Last synced: 8 months ago
JSON representation
SmallRye Reactive Messaging
- Host: GitHub
- URL: https://github.com/smallrye/smallrye-reactive-messaging
- Owner: smallrye
- License: apache-2.0
- Created: 2018-10-15T17:36:05.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2025-04-11T21:05:56.000Z (9 months ago)
- Last Synced: 2025-04-13T00:37:26.690Z (9 months ago)
- Topics: kafka, messaging, microprofile, reactive
- Language: Java
- Homepage: http://www.smallrye.io/smallrye-reactive-messaging/
- Size: 59.9 MB
- Stars: 248
- Watchers: 12
- Forks: 184
- Open Issues: 105
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://search.maven.org/search?q=a:smallrye-reactive-messaging)
[](https://github.com/smallrye/smallrye-reactive-messaging/actions)
[](http://www.apache.org/licenses/LICENSE-2.0)
# Implementation of the MicroProfile Reactive Messaging specification
This project is an implementation of the (next to be) [Eclipse MicroProfile Reactive Messaging](https://github.com/eclipse/microprofile-reactive-messaging) specification - a CDI
extension to build event-driven microservices and data streaming applications. It provides support for:
* [Apache Kafka](https://kafka.apache.org/)
* [MQTT](http://mqtt.org/)
* [AMQP](https://www.amqp.org/) 1.0
* [Apache Camel](https://camel.apache.org/)
* And more!
It also provides a way to inject _streams_ into CDI beans, and so link your [Reactive Messaging streams](https://github.com/eclipse/microprofile-reactive-streams-operators)
into [CDI](http://www.cdi-spec.org/) beans,or [JAX-RS](https://github.com/eclipse-ee4j/jaxrs-api) resources.
## Branches
* main - 4.x development stream. Uses Vert.x 4.x, Microprofile 5.x, Mutiny 2.x and Jakarta 9
* 3.x - Previous development stream. Uses Vert.x 4.x and Microprofile 4.x
* 2.x - Not under development anymore. Uses Vert.x 3.x and Microprofile 3.x
## Getting started
### Prerequisites
See [PREREQUISITES.md](PREREQUISITES.md) for details.
The build process requires Apache Maven and Java 11+ and can be performed using:
```bash
mvn clean install
```
### How to start
The best way to start is to look at the `examples/quickstart` project. It's a Maven project listing the minimal set of
dependencies and containing a single class:
```java
package io.smallrye.reactive.messaging.quickstart;
import org.eclipse.microprofile.reactive.messaging.Incoming;
import org.eclipse.microprofile.reactive.messaging.Outgoing;
import org.eclipse.microprofile.reactive.streams.operators.PublisherBuilder;
import org.eclipse.microprofile.reactive.streams.operators.ReactiveStreams;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.se.SeContainerInitializer;
@ApplicationScoped
public class QuickStart {
public static void main(String[] args) {
SeContainerInitializer.newInstance().initialize();
}
@Outgoing("source")
public PublisherBuilder source() {
return ReactiveStreams.of("hello", "with", "SmallRye", "reactive", "message");
}
@Incoming("source")
@Outgoing("processed-a")
public String toUpperCase(String payload) {
return payload.toUpperCase();
}
@Incoming("processed-a")
@Outgoing("processed-b")
public PublisherBuilder filter(PublisherBuilder input) {
return input.filter(item -> item.length() > 4);
}
@Incoming("processed-b")
public void sink(String word) {
System.out.println(">> " + word);
}
}
```
Run the project with: `mvn compile exec:java -Dexec.mainClass=io.smallrye.reactive.messaging.quickstart.QuickStart`:
```bash
>> HELLO
>> SMALLRYE
>> REACTIVE
>> MESSAGE
```
## Built With
* [Eclipse Vert.x](https://vertx.io/)
* [SmallRye Mutiny](https://github.com/smallrye/smallrye-mutiny)
* [SmallRye Reactive Stream Operators](https://github.com/smallrye/smallrye-reactive-streams-operators) (any implementation would work)
* [Weld](https://weld.cdi-spec.org/) (any implementation would work)
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details, and the process for submitting pull requests.
## Sponsors
The project is sponsored by [Red Hat](https://www.redhat.com).
## License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.