diff --git a/README.md b/README.md index 998e080..5905ed7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@
-![version 0.4.1](https://img.shields.io/badge/version-0.4.1-black?labelColor=black&style=flat-square) ![jdk 17](https://img.shields.io/badge/minimum_jdk-17-orange?labelColor=black&style=flat-square) ![load-test](https://img.shields.io/badge/load%20test%2010%2C000%2C000-success-brightgreen?labelColor=black&style=flat-square) +![version 0.4.2](https://img.shields.io/badge/version-0.4.2-black?labelColor=black&style=flat-square) ![jdk 17](https://img.shields.io/badge/minimum_jdk-17-orange?labelColor=black&style=flat-square) ![load-test](https://img.shields.io/badge/load%20test%2010%2C000%2C000-success-brightgreen?labelColor=black&style=flat-square) ![redis--stream](https://img.shields.io/badge/-redis--stream-da2020?style=flat-square&logo=Redis&logoColor=white) **TPS(6,000)** on my Macbook air m2(default options). _[link](#Test1-TPS)_ @@ -89,13 +89,13 @@ class OrderService(private val orderOrchestrator: Orchestrator { // - return orchestratorFactory.create("orderOrchestrator") + return orchestratorFactory.create("orderOrchestrator") .start( orchestrate = { order -> // its order type // Do your bussiness logic @@ -125,7 +125,7 @@ class OrchestratorConfigurer { throw IllegalArgumentException("Oops! Something went wrong..") }, rollback = { request -> - ... + // ... } ) } diff --git a/gradle.properties b/gradle.properties index 19bc5ad..741959b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ kotlin.code.style=official ### Project ### group=org.rooftopmsa -version=0.4.1 +version=0.4.2 compatibility=17 ### Sonarcloud ### diff --git a/src/main/kotlin/org/rooftop/netx/api/Orchestrator.kt b/src/main/kotlin/org/rooftop/netx/api/Orchestrator.kt index ed6032f..b09c83a 100644 --- a/src/main/kotlin/org/rooftop/netx/api/Orchestrator.kt +++ b/src/main/kotlin/org/rooftop/netx/api/Orchestrator.kt @@ -26,9 +26,9 @@ import reactor.core.publisher.Mono * * } * - * class OrderOrchestratorConfigurer { - * - * private val orchestratorFactory = OrchestratorFactory.instance() + * class OrderOrchestratorConfigurer( + * private val orchestratorFactory: OrchestratorFactory, + * ){ * * fun orderOrchestrator(): Orchestrator { * return orchestratorFactory.create("orderOrchestrator") diff --git a/src/main/kotlin/org/rooftop/netx/engine/listen/AbstractOrchestrateListener.kt b/src/main/kotlin/org/rooftop/netx/engine/listen/AbstractOrchestrateListener.kt index bcf6761..5c62f99 100644 --- a/src/main/kotlin/org/rooftop/netx/engine/listen/AbstractOrchestrateListener.kt +++ b/src/main/kotlin/org/rooftop/netx/engine/listen/AbstractOrchestrateListener.kt @@ -1,6 +1,9 @@ package org.rooftop.netx.engine.listen -import org.rooftop.netx.api.* +import org.rooftop.netx.api.Context +import org.rooftop.netx.api.SagaEvent +import org.rooftop.netx.api.SagaManager +import org.rooftop.netx.api.TypeReference import org.rooftop.netx.core.Codec import org.rooftop.netx.engine.OrchestrateEvent import org.rooftop.netx.engine.RequestHolder @@ -64,17 +67,18 @@ internal abstract class AbstractOrchestrateListener internal c } .flatMap { (request, event) -> command(request, event) } .setNextCastableType() + .toOrchestrateEvent() + .map { + sagaEvent.setNextEvent(it) + } .doOnError { + it.printStackTrace() rollback( sagaEvent.id, it, sagaEvent.decodeEvent(OrchestrateEvent::class) ) } - .toOrchestrateEvent() - .map { - sagaEvent.setNextEvent(it) - } } protected open fun command(request: T, event: OrchestrateEvent): Mono> {