Code Monkey home page Code Monkey logo

smallrye-reactive-messaging's Introduction

Maven Central Continuous Integration Build License

Implementation of the MicroProfile Reactive Messaging specification

This project is an implementation of the (next to be) Eclipse MicroProfile Reactive Messaging specification - a CDI extension to build event-driven microservices and data streaming applications. It provides support for:

It also provides a way to inject streams into CDI beans, and so link your Reactive Messaging streams into CDI beans,or JAX-RS resources.

Branches

  • main - 3.x 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 for details.

The build process requires Apache Maven and Java 8+ and can be performed using:

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:

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 javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.se.SeContainerInitializer;

@ApplicationScoped
public class QuickStart {

  public static void main(String[] args) {
    SeContainerInitializer.newInstance().initialize();
  }


  @Outgoing("source")
  public PublisherBuilder<String> 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<String> filter(PublisherBuilder<String> 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:

>> HELLO
>> SMALLRYE
>> REACTIVE
>> MESSAGE

Built With

Contributing

Please read CONTRIBUTING.md for details, and the process for submitting pull requests.

Sponsors

The project is sponsored by Red Hat.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

smallrye-reactive-messaging's People

Contributors

cescoffier avatar dependabot-preview[bot] avatar dependabot[bot] avatar ozangunalp avatar kenfinnigan avatar dependabot-support avatar smallrye-ci avatar misl avatar kdubb avatar ladicek avatar phillip-kruger avatar pcasaes avatar kabir avatar azquelt avatar geoand avatar loicmathieu avatar dometec avatar cdmikechen avatar radcortez avatar matzew avatar emily-jiang avatar newportd avatar jponge avatar eye0fra avatar gemmellr avatar michalszynkiewicz avatar nderwin avatar torgge avatar wgancarz avatar mkouba avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.