Reactive CQRS ES lib

Library to handle reactive CQRS commands and events

License

License

Categories

Categories

React User Interface Web Frameworks
GroupId

GroupId

io.github.yasiekz
ArtifactId

ArtifactId

reactive-cqrs-es-lib
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Reactive CQRS ES lib
Library to handle reactive CQRS commands and events
Project URL

Project URL

https://github.com/yasiekz/reactive-cqrs-es-lib
Source Code Management

Source Code Management

https://github.com/yasiekz/reactive-cqrs-es-lib

Download reactive-cqrs-es-lib

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.yasiekz/reactive-cqrs-es-lib/ -->
<dependency>
    <groupId>io.github.yasiekz</groupId>
    <artifactId>reactive-cqrs-es-lib</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.yasiekz/reactive-cqrs-es-lib/
implementation 'io.github.yasiekz:reactive-cqrs-es-lib:1.0.0'
// https://jarcasting.com/artifacts/io.github.yasiekz/reactive-cqrs-es-lib/
implementation ("io.github.yasiekz:reactive-cqrs-es-lib:1.0.0")
'io.github.yasiekz:reactive-cqrs-es-lib:jar:1.0.0'
<dependency org="io.github.yasiekz" name="reactive-cqrs-es-lib" rev="1.0.0">
  <artifact name="reactive-cqrs-es-lib" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.yasiekz', module='reactive-cqrs-es-lib', version='1.0.0')
)
libraryDependencies += "io.github.yasiekz" % "reactive-cqrs-es-lib" % "1.0.0"
[io.github.yasiekz/reactive-cqrs-es-lib "1.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.springframework : spring-context jar 5.1.7.RELEASE
io.projectreactor : reactor-core jar 3.2.9.RELEASE

test (3)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter jar 5.4.0
org.mockito : mockito-core jar 2.28.2
io.projectreactor : reactor-test jar 3.2.9.RELEASE

Project Modules

There are no modules declared in this project.

Build Status codecov

Reactive CQRS + ES lib

This is simple lib which adds reactive command handling classes to your springboot app

Key features:

  • dispatches command to reactive handlers

Scheduled functionality

  • Event bus
  • Command bus with handler that could return event
  • automatically apply event on bus

Usage

Import lib

With maven

<dependency>
  <groupId>io.github.yasiekz</groupId>
  <artifactId>reactive-cqrs-es-lib</artifactId>
  <version>1.0.0</version>
</dependency>

With gradle

repositories {
    mavenCentral()
}

dependencies {
    implementation 'io.github.yasiekz:reactive-cqrs-es-lib:1.0.0'
}
Register bean in @Configuration class
@Configuration
public class CqrsConfiguration {
    
    @Bean
    public CommandDispatcher createSimpleCommandBus(List<SimpleCommandHandler> handlers) {
        return new SimpleCommandBus(handlers);
    }
}
Create some commands
import io.github.yasiekz.reactive.cqrses.command.Command;

public class DummyCommand extends Command {
    // some data here with getters
}

Important Commands should be immutable!

Create handler for Command
package io.github.yasiekz.reactive.cqrses.command.SimpleCommandHandler;

import reactor.core.publisher.Mono;

public class DummyCommandHandler implements SimpleCommandHandler<DummyCommand> {

    @Override
    public Mono<Void> handle(final DummyCommand command) {
        // do something with command using reactive flow
    }
}

Local run

Requirements

  • Java 11 to build project
  • Spring boot 2.1.x

Run tests

./gradlew check

Versions

Version
1.0.0