From 67195b7eb7ebae94748172a0d507e68ec4f70246 Mon Sep 17 00:00:00 2001 From: Gilles Barbier Date: Thu, 24 Oct 2024 09:40:57 +0200 Subject: [PATCH 1/6] display avro-encoding data when using `toString()` method. This is useful for internal logging. We still do not display it in cloudevent --- .../kotlin/io/infinitic/common/serDe/SerializedData.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/infinitic-common/src/main/kotlin/io/infinitic/common/serDe/SerializedData.kt b/infinitic-common/src/main/kotlin/io/infinitic/common/serDe/SerializedData.kt index ed0cb372c..3d2614803 100644 --- a/infinitic-common/src/main/kotlin/io/infinitic/common/serDe/SerializedData.kt +++ b/infinitic-common/src/main/kotlin/io/infinitic/common/serDe/SerializedData.kt @@ -166,14 +166,17 @@ data class SerializedData( fun toJson() = json.parseToJsonElement(toJsonString()) - fun toJsonString(): String = when (dataType) { + fun toJsonString(encodeAvro: Boolean = true): String = when (dataType) { SerializedDataType.NULL -> "null" SerializedDataType.JSON, SerializedDataType.JSON_JACKSON, SerializedDataType.JSON_KOTLIN -> String(bytes, Charsets.UTF_8) SerializedDataType.AVRO_WITH_SCHEMA -> JsonPrimitive( - Base64.getEncoder().encodeToString(bytes), + when (encodeAvro) { + true -> Base64.getEncoder().encodeToString(bytes) + false -> decodeAvroWithSchemaFingerprint().toString() + }, ).toString() } @@ -185,7 +188,7 @@ data class SerializedData( /** Readable version */ override fun toString() = mapOf( - "bytes" to toJsonString().replace("\n", ""), + "bytes" to toJsonString(false).replace("\n", ""), "type" to dataType, "meta" to meta.mapValues { String(it.value) }, ).toString() From babc58dfc0d5a1f121652b9031fc2cc8c91120ab Mon Sep 17 00:00:00 2001 From: Gilles Barbier Date: Thu, 24 Oct 2024 13:50:55 +0200 Subject: [PATCH 2/6] Fix the case where the same signal is waited multiple times due to an OR operator --- .../common/workflows/data/steps/Step.kt | 40 +- .../workflows/WorkflowUserException.kt | 4 - .../io/infinitic/serDe/SerDeJavaTest.java | 18 +- .../src/test/kotlin/io/infinitic/Test.kt | 2 +- .../tests/channels/ChannelWorkflowTests.kt | 402 +++++++++--------- .../tests/channels/ChannelsWorkflow.kt | 17 + .../tests/deferred/DeferredWorkflowTests.kt | 5 +- .../workflowTask/WorkflowDispatcherImpl.kt | 10 +- 8 files changed, 238 insertions(+), 260 deletions(-) diff --git a/infinitic-common/src/main/kotlin/io/infinitic/common/workflows/data/steps/Step.kt b/infinitic-common/src/main/kotlin/io/infinitic/common/workflows/data/steps/Step.kt index 04eb67c85..1de5a7f25 100644 --- a/infinitic-common/src/main/kotlin/io/infinitic/common/workflows/data/steps/Step.kt +++ b/infinitic-common/src/main/kotlin/io/infinitic/common/workflows/data/steps/Step.kt @@ -38,7 +38,6 @@ import io.infinitic.common.workflows.data.commands.CommandStatus.Unknown import io.infinitic.common.workflows.data.commands.PastCommand import io.infinitic.common.workflows.data.commands.ReceiveSignalPastCommand import io.infinitic.common.workflows.data.workflowTasks.WorkflowTaskIndex -import io.infinitic.exceptions.workflows.OutOfBoundAwaitException import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.Transient @@ -64,9 +63,6 @@ sealed class Step { // increase wait index and update current status abstract fun nextAwaitIndex() - // check wait index is valid - abstract fun checkAwaitIndex() - /** hash provides a unique hash linked to the structure of the step (excluding commandStatus) */ abstract fun hash(): StepHash @@ -139,24 +135,18 @@ sealed class Step { is StepStatus.Completed -> true } - override fun checkAwaitIndex() { - // user is asking more than the limit, we consider it as a failure - if (commandStatuses != null && - commandStatusLimit != null && - awaitIndex >= commandStatusLimit!!) { - throw OutOfBoundAwaitException - } - } - override fun nextAwaitIndex() { - awaitIndex++ - - // update commandStatus if needed if (commandStatuses != null) { - // update current status - commandStatus = commandStatuses!!.firstOrNull { - (it is Completed) && (it.returnIndex == awaitIndex) - } ?: Ongoing + // if there is no limit, or there is a limit but not yet reached + if (commandStatusLimit == null || awaitIndex + 1 < commandStatusLimit!!) { + awaitIndex++ + + // update commandStatus if needed + // update current status + commandStatus = commandStatuses!!.firstOrNull { + (it is Completed) && (it.returnIndex == awaitIndex) + } ?: Ongoing + } } } @@ -214,7 +204,7 @@ sealed class Step { is StepStatus.Completed -> status.returnValue.deserialize( returnValueType, returnValueJsonViewClass, - ) + ).also { nextAwaitIndex() } else -> thisShouldNotHappen(status.toString()) } @@ -235,10 +225,6 @@ sealed class Step { override fun isTerminatedAt(index: WorkflowTaskIndex) = steps.all { it.isTerminatedAt(index) } - override fun checkAwaitIndex() { - steps.map { it.checkAwaitIndex() } - } - override fun nextAwaitIndex() { steps.map { it.nextAwaitIndex() } } @@ -300,10 +286,6 @@ sealed class Step { override fun isTerminatedAt(index: WorkflowTaskIndex) = steps.any { it.isTerminatedAt(index) } - override fun checkAwaitIndex() { - steps.map { it.checkAwaitIndex() } - } - override fun nextAwaitIndex() { steps.map { it.nextAwaitIndex() } } diff --git a/infinitic-common/src/main/kotlin/io/infinitic/exceptions/workflows/WorkflowUserException.kt b/infinitic-common/src/main/kotlin/io/infinitic/exceptions/workflows/WorkflowUserException.kt index 757307fc9..96a938c4e 100644 --- a/infinitic-common/src/main/kotlin/io/infinitic/exceptions/workflows/WorkflowUserException.kt +++ b/infinitic-common/src/main/kotlin/io/infinitic/exceptions/workflows/WorkflowUserException.kt @@ -39,10 +39,6 @@ data object MultipleCustomIdException : WorkflowUserException(msg = "", help = " private fun readResolve(): Any = MultipleCustomIdException } -data object OutOfBoundAwaitException : WorkflowUserException(msg = "", help = "") { - private fun readResolve(): Any = OutOfBoundAwaitException -} - class NonIdempotentChannelGetterException(workflow: String, method: String) : WorkflowUserException( msg = "in workflow $workflow, method $method should return the same object when called multiple times", diff --git a/infinitic-common/src/test/java/io/infinitic/serDe/SerDeJavaTest.java b/infinitic-common/src/test/java/io/infinitic/serDe/SerDeJavaTest.java index 3489cdd1c..bff58715e 100644 --- a/infinitic-common/src/test/java/io/infinitic/serDe/SerDeJavaTest.java +++ b/infinitic-common/src/test/java/io/infinitic/serDe/SerDeJavaTest.java @@ -52,7 +52,7 @@ public void objectShouldBeDeserializableEvenWithMoreProperties() { Pojo1 val1 = new Pojo1("42", 42, JType.TYPE_1); Pojo2 val2 = new Pojo2("42", 42); SerializedData original = SerializedData.encode(val1, Pojo1.class, null); - SerializedData data = original.copy(original.toJsonString().replace("Pojo1", "Pojo2").getBytes(), original.getDataType(), original.getMeta()); + SerializedData data = original.copy(original.toJsonString(false).replace("Pojo1", "Pojo2").getBytes(), original.getDataType(), original.getMeta()); Assertions.assertEquals(val2, data.decode(Pojo2.class, null)); } @@ -62,7 +62,7 @@ public void objectShouldBeDeserializableEvenWithLessProperties() { Pojo1 val1 = new Pojo1("42", 42, JType.TYPE_1); Pojo2 val2 = new Pojo2("42", 42); SerializedData original = SerializedData.encode(val2, Pojo2.class, null); - SerializedData data = original.copy(original.toJsonString().replace("Pojo2", "Pojo1").getBytes(), original.getDataType(), original.getMeta()); + SerializedData data = original.copy(original.toJsonString(false).replace("Pojo2", "Pojo1").getBytes(), original.getDataType(), original.getMeta()); Assertions.assertEquals(val1, data.decode(Pojo1.class, null)); } @@ -102,18 +102,4 @@ public void ListOfSerializableObjectShouldBeSerializableDeserializableWithType() Assertions.assertEquals(pojos, data.decode(null, null)); } - -// @Test -// public void ListOfSerializableObjectShouldBeSerializableDeserializableWithTypeTest() { -// SerializedData data = new SerializedData(""" -// {"foo":"42","bar":42,"type":"TYPE_1"} -// """.getBytes(), -// SerializedDataType.JSON, -// new HashMap<>() -// ); -// -// Pojo1 pojoa = new Pojo1("42", 42, JType.TYPE_1); -// -// Assertions.assertEquals(pojoa, data.decode(typeOf>(), null)); -// } } diff --git a/infinitic-tests/src/test/kotlin/io/infinitic/Test.kt b/infinitic-tests/src/test/kotlin/io/infinitic/Test.kt index f4c0962b3..c151f095b 100644 --- a/infinitic-tests/src/test/kotlin/io/infinitic/Test.kt +++ b/infinitic-tests/src/test/kotlin/io/infinitic/Test.kt @@ -122,7 +122,7 @@ internal suspend fun InfiniticWorker.getWorkflowState( object ProjectConfig : AbstractProjectConfig() { // each test should not be longer than 5s - override val timeout = 5000.milliseconds + override val timeout = 10000.milliseconds override suspend fun beforeProject() { Listener.clear() diff --git a/infinitic-tests/src/test/kotlin/io/infinitic/tests/channels/ChannelWorkflowTests.kt b/infinitic-tests/src/test/kotlin/io/infinitic/tests/channels/ChannelWorkflowTests.kt index 6f053aaed..8d8fadce7 100644 --- a/infinitic-tests/src/test/kotlin/io/infinitic/tests/channels/ChannelWorkflowTests.kt +++ b/infinitic-tests/src/test/kotlin/io/infinitic/tests/channels/ChannelWorkflowTests.kt @@ -24,287 +24,287 @@ package io.infinitic.tests.channels import io.infinitic.Test import io.infinitic.common.fixtures.later -import io.infinitic.exceptions.WorkflowFailedException -import io.infinitic.exceptions.WorkflowTaskFailedException -import io.infinitic.exceptions.workflows.OutOfBoundAwaitException import io.infinitic.utils.Obj1 import io.infinitic.utils.Obj2 -import io.kotest.assertions.throwables.shouldThrow +import io.kotest.assertions.throwables.shouldNotThrowAny import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.shouldBe import kotlinx.coroutines.delay +import kotlin.time.Duration.Companion.seconds -internal class ChannelWorkflowTests : - StringSpec( - { - val client = Test.client +internal class ChannelWorkflowTests : StringSpec( + { + val client = Test.client - val channelsWorkflow = - client.newWorkflow(ChannelsWorkflow::class.java, tags = setOf("foo", "bar")) + val channelsWorkflow = + client.newWorkflow(ChannelsWorkflow::class.java, tags = setOf("foo", "bar")) - "Waiting for event, sent after dispatched" { - val deferred = client.dispatch(channelsWorkflow::channel1) + "Waiting for event, sent after dispatched".config(timeout = 30.seconds) { + val deferred = client.dispatch(channelsWorkflow::channel1) - later { - client.getWorkflowById( - ChannelsWorkflow::class.java, - deferred.id, - ).channelStrA.send("test") - } - - deferred.await() shouldBe "test" + later { + client.getWorkflowById( + ChannelsWorkflow::class.java, + deferred.id, + ).channelStrA.send("test") } - "Waiting for event, sent by id" { - val deferred = client.dispatch(channelsWorkflow::channel1) + deferred.await() shouldBe "test" + } - later { - client.getWorkflowById( - ChannelsWorkflow::class.java, - deferred.id, - ).channelStrA.send("test") - } + "Waiting for event, sent by id" { + val deferred = client.dispatch(channelsWorkflow::channel1) - deferred.await() shouldBe "test" + later { + client.getWorkflowById( + ChannelsWorkflow::class.java, + deferred.id, + ).channelStrA.send("test") } - "Waiting for event, sent by tag" { - val deferred = client.dispatch(channelsWorkflow::channel1) + deferred.await() shouldBe "test" + } - later { - client.getWorkflowByTag( - ChannelsWorkflow::class.java, - "foo", - ).channelStrA.send("test") - } + "Waiting for event, sent by tag" { + val deferred = client.dispatch(channelsWorkflow::channel1) - deferred.await() shouldBe "test" + later { + client.getWorkflowByTag( + ChannelsWorkflow::class.java, + "foo", + ).channelStrA.send("test") } - "Waiting for event, sent to the right channel" { - val deferred = client.dispatch(channelsWorkflow::channel2) + deferred.await() shouldBe "test" + } - client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - .channelStrA.send("test") + "Waiting for event, sent to the right channel" { + val deferred = client.dispatch(channelsWorkflow::channel2) - deferred.await() shouldBe "test" - } + client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + .channelStrA.send("test") - "Waiting for event but sent to the wrong channel" { - val deferred = client.dispatch(channelsWorkflow::channel2) + deferred.await() shouldBe "test" + } - client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - .channelStrB.send("test") + "Waiting for event but sent to the wrong channel" { + val deferred = client.dispatch(channelsWorkflow::channel2) - deferred.await() shouldBe "Instant" - } + client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + .channelStrB.send("test") - "Event is discarded if sent before waiting for it" { - val deferred = client.dispatch(channelsWorkflow::channel3) + deferred.await() shouldBe "Instant" + } - later(10) { - client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - .channelStrA.send("test") - } + "Event is discarded if sent before waiting for it" { + val deferred = client.dispatch(channelsWorkflow::channel3) - deferred.await() shouldBe "Instant" + later(10) { + client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + .channelStrA.send("test") } - "Waiting for Obj event" { - val obj1 = Obj1("foo", 42) - val deferred = client.dispatch(channelsWorkflow::channel4) + deferred.await() shouldBe "Instant" + } - later { - client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id).channelObj.send(obj1) - } + "Waiting for Obj event" { + val obj1 = Obj1("foo", 42) + val deferred = client.dispatch(channelsWorkflow::channel4) - deferred.await() shouldBe obj1 + later { + client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id).channelObj.send(obj1) } - "Waiting for filtered event using jsonPath only" { - val obj1a = Obj1("oof", 12) - val obj1b = Obj1("foo", 12) - val deferred = client.dispatch(channelsWorkflow::channel4bis) + deferred.await() shouldBe obj1 + } - later { - val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - w.channelObj.send(obj1a) - w.channelObj.send(obj1b) - } + "Waiting for filtered event using jsonPath only" { + val obj1a = Obj1("oof", 12) + val obj1b = Obj1("foo", 12) + val deferred = client.dispatch(channelsWorkflow::channel4bis) - deferred.await() shouldBe obj1b + later { + val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + w.channelObj.send(obj1a) + w.channelObj.send(obj1b) } - "Waiting for filtered event using using jsonPath and criteria" { - val obj1a = Obj1("oof", 12) - val obj1b = Obj1("foo", 12) - val deferred = client.dispatch(channelsWorkflow::channel4ter) + deferred.await() shouldBe obj1b + } - later { - val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - w.channelObj.send(obj1a) - w.channelObj.send(obj1b) - } + "Waiting for filtered event using using jsonPath and criteria" { + val obj1a = Obj1("oof", 12) + val obj1b = Obj1("foo", 12) + val deferred = client.dispatch(channelsWorkflow::channel4ter) - deferred.await() shouldBe obj1b + later { + val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + w.channelObj.send(obj1a) + w.channelObj.send(obj1b) } - "Waiting for event of specific type" { - val obj1 = Obj1("foo", 42) - val obj2 = Obj2("foo", 42) - val deferred = client.dispatch(channelsWorkflow::channel5) + deferred.await() shouldBe obj1b + } - later { - val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - w.channelObj.send(obj2) - w.channelObj.send(obj1) - } + "Waiting for event of specific type" { + val obj1 = Obj1("foo", 42) + val obj2 = Obj2("foo", 42) + val deferred = client.dispatch(channelsWorkflow::channel5) - deferred.await() shouldBe obj1 + later { + val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + w.channelObj.send(obj2) + w.channelObj.send(obj1) } - "Waiting event of specific type filtered using jsonPath only" { - val obj1 = Obj1("foo", 42) - val obj2 = Obj2("foo", 42) - val obj3 = Obj1("oof", 42) - val deferred = client.dispatch(channelsWorkflow::channel5bis) + deferred.await() shouldBe obj1 + } - later { - val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - w.channelObj.send(obj3) - w.channelObj.send(obj2) - w.channelObj.send(obj1) - } + "Waiting event of specific type filtered using jsonPath only" { + val obj1 = Obj1("foo", 42) + val obj2 = Obj2("foo", 42) + val obj3 = Obj1("oof", 42) + val deferred = client.dispatch(channelsWorkflow::channel5bis) - deferred.await() shouldBe obj1 + later { + val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + w.channelObj.send(obj3) + w.channelObj.send(obj2) + w.channelObj.send(obj1) } - "Waiting event of specific type filtered using jsonPath and criteria" { - val obj1 = Obj1("foo", 42) - val obj2 = Obj2("foo", 42) - val obj3 = Obj1("oof", 42) - val deferred = client.dispatch(channelsWorkflow::channel5ter) + deferred.await() shouldBe obj1 + } - later { - val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - w.channelObj.send(obj3) - w.channelObj.send(obj2) - w.channelObj.send(obj1) - } + "Waiting event of specific type filtered using jsonPath and criteria" { + val obj1 = Obj1("foo", 42) + val obj2 = Obj2("foo", 42) + val obj3 = Obj1("oof", 42) + val deferred = client.dispatch(channelsWorkflow::channel5ter) - deferred.await() shouldBe obj1 + later { + val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + w.channelObj.send(obj3) + w.channelObj.send(obj2) + w.channelObj.send(obj1) } - "Waiting for 2 events of specific types presented in wrong order" { - val obj1 = Obj1("foo", 6) - val obj2 = Obj2("bar", 7) - val deferred = client.dispatch(channelsWorkflow::channel6) + deferred.await() shouldBe obj1 + } - later { - val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - w.channelObj.send(obj2) - w.channelObj.send(obj1) - } + "Waiting for 2 events of specific types presented in wrong order" { + val obj1 = Obj1("foo", 6) + val obj2 = Obj2("bar", 7) + val deferred = client.dispatch(channelsWorkflow::channel6) - deferred.await() shouldBe "foobar42" + later { + val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + w.channelObj.send(obj2) + w.channelObj.send(obj1) } - "Waiting for 2 events of specific types filtered using jsonPath and criteria presented in wrong order" { - val obj1 = Obj1("foo", 5) - val obj2 = Obj2("bar", 6) - val obj3 = Obj2("foo", 7) - val deferred = client.dispatch(channelsWorkflow::channel6bis) + deferred.await() shouldBe "foobar42" + } - later { - val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - w.channelObj.send(obj2) - w.channelObj.send(obj1) - w.channelObj.send(obj3) - } + "Waiting for 2 events of specific types filtered using jsonPath and criteria presented in wrong order" { + val obj1 = Obj1("foo", 5) + val obj2 = Obj2("bar", 6) + val obj3 = Obj2("foo", 7) + val deferred = client.dispatch(channelsWorkflow::channel6bis) - deferred.await() shouldBe "foofoo35" + later { + val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + w.channelObj.send(obj2) + w.channelObj.send(obj1) + w.channelObj.send(obj3) } - "Waiting for multiple events on same deferred" { - val deferred = client.dispatch(channelsWorkflow::channel7, 3) + deferred.await() shouldBe "foofoo35" + } - later { - val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - w.channelStrA.send("a") - w.channelStrA.send("b") - w.channelStrA.send("c") - } + "Waiting for multiple events on same deferred" { + val deferred = client.dispatch(channelsWorkflow::channel7, 3) - deferred.await() shouldBe "abc" + later { + val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + w.channelStrA.send("a") + w.channelStrA.send("b") + w.channelStrA.send("c") } - "Waiting for multiple events on same deferred, client being late" { - val deferred = client.dispatch(channelsWorkflow::channel7, 3, 3) + deferred.await() shouldBe "abc" + } - later { - val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - delay(300) - w.channelStrA.send("a") - delay(300) - w.channelStrA.send("b") - delay(300) - w.channelStrA.send("c") - } + "Waiting for multiple events on same deferred, client being late" { + val deferred = client.dispatch(channelsWorkflow::channel7, 3, 3) - deferred.await() shouldBe "abc" + later { + val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + delay(300) + w.channelStrA.send("a") + delay(300) + w.channelStrA.send("b") + delay(300) + w.channelStrA.send("c") } - "Waiting for a lot of events events on same deferred" { - val count = 20 - val deferred = client.dispatch(channelsWorkflow::channel7, count) + deferred.await() shouldBe "abc" + } - val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - later { repeat(count) { w.channelStrA.send("a") } } + "Waiting for a lot of events events on same deferred" { + val count = 20 + val deferred = client.dispatch(channelsWorkflow::channel7, count) - deferred.await() shouldBe "a".repeat(count) - } + val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + later { repeat(count) { w.channelStrA.send("a") } } - "Waiting for more signals than anticipated throw a OutOfBoundAwaitException" { - val count = 2 - val deferred = client.dispatch(channelsWorkflow::channel7, count, 1) + deferred.await() shouldBe "a".repeat(count) + } - val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - later { repeat(count) { w.channelStrA.send("a") } } + "Waiting for more signals than anticipated should not throw and repeat last value" { + val deferred = client.dispatch(channelsWorkflow::channel7, 3, 2) - val error = shouldThrow { deferred.await() } - (error.deferredException as WorkflowTaskFailedException).workerException.name shouldBe - OutOfBoundAwaitException::class.java.name + val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + later { + w.channelStrA.send("a") + w.channelStrA.send("b") + w.channelStrA.send("c") } - "Waiting for more signals than anticipated throw a OutOfBoundAwaitException, client being late" { - val count = 2 - val deferred = client.dispatch(channelsWorkflow::channel7, count, 1) - - val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) - later { - repeat(count) { - delay(300) - w.channelStrA.send("a") - } - } + shouldNotThrowAny { deferred.await() } shouldBe "abb" + } - val error = shouldThrow { deferred.await() } + "Waiting for more signals than anticipated should not throw and repeat last value, client being late" { + val deferred = client.dispatch(channelsWorkflow::channel7, 3, 2) - (error.deferredException as WorkflowTaskFailedException).workerException.name shouldBe - OutOfBoundAwaitException::class.java.name + val w = client.getWorkflowById(ChannelsWorkflow::class.java, deferred.id) + later { + delay(100) + w.channelStrA.send("a") + delay(100) + w.channelStrA.send("b") + delay(100) + w.channelStrA.send("c") } - "testing isCompleted" { - val deferred = client.dispatch(channelsWorkflow::channel8) + shouldNotThrowAny { deferred.await() } shouldBe "abb" + } - later(0) { - client.getWorkflowById( - ChannelsWorkflow::class.java, - deferred.id, - ).channelStrA.send("test") - } + "testing isCompleted" { + val deferred = client.dispatch(channelsWorkflow::channel8) - deferred.await() shouldBe "falsetruefalse" + later(0) { + client.getWorkflowById( + ChannelsWorkflow::class.java, + deferred.id, + ).channelStrA.send("test") } - }, - ) + + deferred.await() shouldBe "falsetruefalse" + } + + "testing multiple incomplete await on a channel" { + channelsWorkflow.channel9() shouldBe "ok" + } + }, +) diff --git a/infinitic-tests/src/test/kotlin/io/infinitic/tests/channels/ChannelsWorkflow.kt b/infinitic-tests/src/test/kotlin/io/infinitic/tests/channels/ChannelsWorkflow.kt index f1bc7a9c0..c52690567 100644 --- a/infinitic-tests/src/test/kotlin/io/infinitic/tests/channels/ChannelsWorkflow.kt +++ b/infinitic-tests/src/test/kotlin/io/infinitic/tests/channels/ChannelsWorkflow.kt @@ -67,6 +67,8 @@ interface ChannelsWorkflow { fun channel7(count: Int, max: Int? = null): String fun channel8(): String + + fun channel9(): String } @Suppress("unused") @@ -217,4 +219,19 @@ class ChannelsWorkflowImpl : Workflow(), ChannelsWorkflow { return out } + + override fun channel9(): String { + val deferred: Deferred = channelStrA.receive(1) + + repeat(2) { + val timer = timer(Duration.ofMillis(10)) + + or(deferred, timer).await() + + if (deferred.isCompleted()) { + return "nok" + } + } + return "ok" + } } diff --git a/infinitic-tests/src/test/kotlin/io/infinitic/tests/deferred/DeferredWorkflowTests.kt b/infinitic-tests/src/test/kotlin/io/infinitic/tests/deferred/DeferredWorkflowTests.kt index 84eaaa8a9..90ff7e0e2 100644 --- a/infinitic-tests/src/test/kotlin/io/infinitic/tests/deferred/DeferredWorkflowTests.kt +++ b/infinitic-tests/src/test/kotlin/io/infinitic/tests/deferred/DeferredWorkflowTests.kt @@ -27,6 +27,7 @@ import io.infinitic.utils.UtilWorkflow import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.collections.shouldBeIn import io.kotest.matchers.shouldBe +import kotlin.time.Duration.Companion.seconds internal class DeferredWorkflowTests : StringSpec( @@ -37,7 +38,9 @@ internal class DeferredWorkflowTests : client.newWorkflow(DeferredWorkflow::class.java, tags = setOf("foo", "bar")) val utilWorkflow = client.newWorkflow(UtilWorkflow::class.java) - "Simple Sequential Workflow" { deferredWorkflow.seq1() shouldBe "123" } + "Simple Sequential Workflow".config(timeout = 30.seconds) { + deferredWorkflow.seq1() shouldBe "123" + } "Wait for a dispatched Workflow" { val deferred = client.dispatch(deferredWorkflow::await, 200L) diff --git a/infinitic-workflow-task/src/main/kotlin/io/infinitic/workflows/workflowTask/WorkflowDispatcherImpl.kt b/infinitic-workflow-task/src/main/kotlin/io/infinitic/workflows/workflowTask/WorkflowDispatcherImpl.kt index 3f4d66517..af339b7ed 100644 --- a/infinitic-workflow-task/src/main/kotlin/io/infinitic/workflows/workflowTask/WorkflowDispatcherImpl.kt +++ b/infinitic-workflow-task/src/main/kotlin/io/infinitic/workflows/workflowTask/WorkflowDispatcherImpl.kt @@ -177,9 +177,7 @@ internal class WorkflowDispatcherImpl( // create a new step val newStep = NewStep(step = deferred.step, stepPosition = positionInMethod) - - deferred.step.checkAwaitIndex() - + val result = when (val pastStep = getSimilarPastStep(newStep)) { // this step is not found in the history null -> { @@ -215,9 +213,7 @@ internal class WorkflowDispatcherImpl( // return deferred value when (stepStatus) { - is Waiting -> { - thisShouldNotHappen() - } + is Waiting -> thisShouldNotHappen() is Unknown -> { // workflowTaskIndex is now the one where this deferred was unknowing @@ -271,8 +267,6 @@ internal class WorkflowDispatcherImpl( } } - deferred.step.nextAwaitIndex() - return result } From 64287d897b7618a7d2950671e91223a9c2593623 Mon Sep 17 00:00:00 2001 From: Gilles Barbier Date: Thu, 24 Oct 2024 13:57:22 +0200 Subject: [PATCH 3/6] upgrade Infinitic to 0.16.1 --- buildSrc/src/main/kotlin/Ci.kt | 2 +- .../schemasclientEnvelope-0.16.1.avsc | 466 +++++ .../schemasdelegatedTaskData-0.16.1.avsc | 55 + .../schemasserviceEventEnvelope-0.16.1.avsc | 444 +++++ ...schemasserviceExecutorEnvelope-0.16.1.avsc | 164 ++ .../schemasserviceTagEnvelope-0.16.1.avsc | 238 +++ .../schemasworkflowCmdEnvelope-0.16.1.avsc | 466 +++++ .../schemasworkflowEngineEnvelope-0.16.1.avsc | 1085 +++++++++++ .../schemasworkflowEventEnvelope-0.16.1.avsc | 1023 ++++++++++ .../schemasworkflowState-0.16.1.avsc | 1684 +++++++++++++++++ .../schemasworkflowTagEnvelope-0.16.1.avsc | 457 +++++ .../schemasworkflowTaskParameters-0.16.1.avsc | 833 ++++++++ ...schemasworkflowTaskReturnValue-0.16.1.avsc | 699 +++++++ infinitic-common/src/main/resources/versions | 1 + 14 files changed, 7616 insertions(+), 1 deletion(-) create mode 100644 infinitic-common/src/main/resources/schemasclientEnvelope-0.16.1.avsc create mode 100644 infinitic-common/src/main/resources/schemasdelegatedTaskData-0.16.1.avsc create mode 100644 infinitic-common/src/main/resources/schemasserviceEventEnvelope-0.16.1.avsc create mode 100644 infinitic-common/src/main/resources/schemasserviceExecutorEnvelope-0.16.1.avsc create mode 100644 infinitic-common/src/main/resources/schemasserviceTagEnvelope-0.16.1.avsc create mode 100644 infinitic-common/src/main/resources/schemasworkflowCmdEnvelope-0.16.1.avsc create mode 100644 infinitic-common/src/main/resources/schemasworkflowEngineEnvelope-0.16.1.avsc create mode 100644 infinitic-common/src/main/resources/schemasworkflowEventEnvelope-0.16.1.avsc create mode 100644 infinitic-common/src/main/resources/schemasworkflowState-0.16.1.avsc create mode 100644 infinitic-common/src/main/resources/schemasworkflowTagEnvelope-0.16.1.avsc create mode 100644 infinitic-common/src/main/resources/schemasworkflowTaskParameters-0.16.1.avsc create mode 100644 infinitic-common/src/main/resources/schemasworkflowTaskReturnValue-0.16.1.avsc diff --git a/buildSrc/src/main/kotlin/Ci.kt b/buildSrc/src/main/kotlin/Ci.kt index ea908cec4..1874e95a4 100644 --- a/buildSrc/src/main/kotlin/Ci.kt +++ b/buildSrc/src/main/kotlin/Ci.kt @@ -25,7 +25,7 @@ object Ci { private const val SNAPSHOT = "-SNAPSHOT" // base version number - private const val BASE = "0.16.0" + private const val BASE = "0.16.1" // GitHub run number private val githubRunNumber = System.getenv("GITHUB_RUN_NUMBER") diff --git a/infinitic-common/src/main/resources/schemasclientEnvelope-0.16.1.avsc b/infinitic-common/src/main/resources/schemasclientEnvelope-0.16.1.avsc new file mode 100644 index 000000000..c5f6f0d0c --- /dev/null +++ b/infinitic-common/src/main/resources/schemasclientEnvelope-0.16.1.avsc @@ -0,0 +1,466 @@ +{ + "type" : "record", + "name" : "ClientEnvelope", + "namespace" : "io.infinitic.common.clients.messages", + "fields" : [ { + "name" : "clientName", + "type" : "string" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "ClientMessageType", + "symbols" : [ "TASK_COMPLETED", "TASK_CANCELED", "TASK_FAILED", "TASK_IDS_PER_TAG", "UNKNOWN_WORKFLOW", "WORKFLOW_COMPLETED", "WORKFLOW_CANCELED", "WORKFLOW_FAILED", "WORKFLOW_TIMED_OUT", "WORKFLOW_ALREADY_COMPLETED", "WORKFLOW_IDS_PER_TAG" ] + } + }, { + "name" : "taskCompleted", + "type" : [ "null", { + "type" : "record", + "name" : "TaskCompleted", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "recipientName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "taskReturnValue", + "type" : { + "type" : "record", + "name" : "SerializedData", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "bytes", + "type" : "bytes" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "SerializedDataType", + "symbols" : [ "NULL", "AVRO_WITH_SCHEMA", "JSON", "JSON_JACKSON", "JSON_KOTLIN" ] + } + }, { + "name" : "meta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + }, { + "name" : "taskMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } ] + }, { + "name" : "taskCanceled", + "type" : [ "null", { + "type" : "record", + "name" : "TaskCanceled", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "recipientName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "taskFailed", + "type" : [ "null", { + "type" : "record", + "name" : "TaskFailed", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "recipientName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "cause", + "type" : { + "type" : "record", + "name" : "WorkerError", + "namespace" : "io.infinitic.tasks.executor", + "fields" : [ { + "name" : "workerName", + "type" : "string" + }, { + "name" : "name", + "type" : "string" + }, { + "name" : "message", + "type" : [ "null", "string" ] + }, { + "name" : "stackTraceToString", + "type" : "string" + }, { + "name" : "cause", + "type" : [ "null", "WorkerError" ] + } ] + } + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "taskIdsByTag", + "type" : [ "null", { + "type" : "record", + "name" : "TaskIdsByTag", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "recipientName", + "type" : "string" + }, { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskTag", + "type" : "string" + }, { + "name" : "taskIds", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "workflowCompleted", + "type" : [ "null", { + "type" : "record", + "name" : "MethodCompleted", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "recipientName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "methodReturnValue", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "workflowCanceled", + "type" : [ "null", { + "type" : "record", + "name" : "MethodCanceled", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "recipientName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "workflowFailed", + "type" : [ "null", { + "type" : "record", + "name" : "MethodFailed", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "recipientName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "cause", + "type" : [ { + "type" : "record", + "name" : "CanceledTaskError", + "namespace" : "", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "CanceledWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + }, { + "type" : "record", + "name" : "FailedTaskError", + "namespace" : "", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "cause", + "type" : "io.infinitic.tasks.executor.WorkerError" + } ] + }, { + "type" : "record", + "name" : "FailedWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "deferredError", + "type" : [ "CanceledTaskError", "CanceledWorkflowError", "FailedTaskError", "FailedWorkflowError", { + "type" : "record", + "name" : "FailedWorkflowTaskError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowTaskId", + "type" : "string" + }, { + "name" : "cause", + "type" : "io.infinitic.tasks.executor.WorkerError" + } ] + }, { + "type" : "record", + "name" : "TimedOutTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "TimedOutWorkflowError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + }, { + "type" : "record", + "name" : "UnknownTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "taskId", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "UnknownWorkflowError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + } ] + } ] + }, "FailedWorkflowTaskError", "TimedOutTaskError", "TimedOutWorkflowError", "UnknownTaskError", "UnknownWorkflowError" ] + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "workflowTimedOut", + "type" : [ "null", { + "type" : "record", + "name" : "MethodTimedOut", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "recipientName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ], + "default" : null + }, { + "name" : "unknownWorkflow", + "type" : [ "null", { + "type" : "record", + "name" : "MethodRunUnknown", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "recipientName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "methodAlreadyCompleted", + "type" : [ "null", { + "type" : "record", + "name" : "MethodAlreadyCompleted", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "recipientName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "workflowIdsByTag", + "type" : [ "null", { + "type" : "record", + "name" : "WorkflowIdsByTag", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "recipientName", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowTag", + "type" : "string" + }, { + "name" : "workflowIds", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + } ] +} \ No newline at end of file diff --git a/infinitic-common/src/main/resources/schemasdelegatedTaskData-0.16.1.avsc b/infinitic-common/src/main/resources/schemasdelegatedTaskData-0.16.1.avsc new file mode 100644 index 000000000..c9b34cd86 --- /dev/null +++ b/infinitic-common/src/main/resources/schemasdelegatedTaskData-0.16.1.avsc @@ -0,0 +1,55 @@ +{ + "type" : "record", + "name" : "DelegatedTaskData", + "namespace" : "io.infinitic.tasks", + "fields" : [ { + "name" : "serviceName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "requester", + "type" : [ { + "type" : "record", + "name" : "ClientRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "clientName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "WorkflowRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + } ] + } ] + }, { + "name" : "clientWaiting", + "type" : [ "null", "boolean" ] + }, { + "name" : "taskMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] +} \ No newline at end of file diff --git a/infinitic-common/src/main/resources/schemasserviceEventEnvelope-0.16.1.avsc b/infinitic-common/src/main/resources/schemasserviceEventEnvelope-0.16.1.avsc new file mode 100644 index 000000000..49561923f --- /dev/null +++ b/infinitic-common/src/main/resources/schemasserviceEventEnvelope-0.16.1.avsc @@ -0,0 +1,444 @@ +{ + "type" : "record", + "name" : "TaskEventEnvelope", + "namespace" : "io.infinitic.tasks.events", + "fields" : [ { + "name" : "serviceName", + "type" : "string" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "ServiceEventMessageType", + "symbols" : [ "TASK_STARTED", "TASK_RETRIED", "TASK_FAILED", "TASK_COMPLETED" ] + } + }, { + "name" : "taskStartedEvent", + "type" : [ "null", { + "type" : "record", + "name" : "TaskStartedEvent", + "fields" : [ { + "name" : "version", + "type" : "string" + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "serviceName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "taskRetrySequence", + "type" : "int" + }, { + "name" : "taskRetryIndex", + "type" : "int" + }, { + "name" : "requester", + "type" : [ { + "type" : "record", + "name" : "ClientRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "clientName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "WorkflowRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + } ] + } ] + }, { + "name" : "clientWaiting", + "type" : [ "null", "boolean" ] + }, { + "name" : "taskTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "taskMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } ] + }, { + "name" : "taskRetried", + "type" : [ "null", { + "type" : "record", + "name" : "TaskRetriedEvent", + "fields" : [ { + "name" : "version", + "type" : "string" + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "serviceName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "taskRetrySequence", + "type" : "int" + }, { + "name" : "taskRetryIndex", + "type" : "int" + }, { + "name" : "requester", + "type" : [ "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ] + }, { + "name" : "clientWaiting", + "type" : [ "null", "boolean" ] + }, { + "name" : "taskTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "taskMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "taskRetryDelay", + "type" : "long" + }, { + "name" : "lastError", + "type" : { + "type" : "record", + "name" : "WorkerError", + "namespace" : "io.infinitic.tasks.executor", + "fields" : [ { + "name" : "workerName", + "type" : "string" + }, { + "name" : "name", + "type" : "string" + }, { + "name" : "message", + "type" : [ "null", "string" ] + }, { + "name" : "stackTraceToString", + "type" : "string" + }, { + "name" : "cause", + "type" : [ "null", "WorkerError" ] + } ] + } + } ] + } ] + }, { + "name" : "taskFailedEvent", + "type" : [ "null", { + "type" : "record", + "name" : "TaskFailedEvent", + "fields" : [ { + "name" : "version", + "type" : "string" + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "serviceName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "taskRetrySequence", + "type" : "int" + }, { + "name" : "taskRetryIndex", + "type" : "int" + }, { + "name" : "requester", + "type" : [ "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ] + }, { + "name" : "clientWaiting", + "type" : [ "null", "boolean" ] + }, { + "name" : "taskTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "taskMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "executionError", + "type" : "io.infinitic.tasks.executor.WorkerError" + }, { + "name" : "deferredError", + "type" : [ "null", { + "type" : "record", + "name" : "CanceledTaskError", + "namespace" : "", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "CanceledWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + }, { + "type" : "record", + "name" : "FailedTaskError", + "namespace" : "", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "cause", + "type" : "io.infinitic.tasks.executor.WorkerError" + } ] + }, { + "type" : "record", + "name" : "FailedWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "deferredError", + "type" : [ "CanceledTaskError", "CanceledWorkflowError", "FailedTaskError", "FailedWorkflowError", { + "type" : "record", + "name" : "FailedWorkflowTaskError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowTaskId", + "type" : "string" + }, { + "name" : "cause", + "type" : "io.infinitic.tasks.executor.WorkerError" + } ] + }, { + "type" : "record", + "name" : "TimedOutTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "TimedOutWorkflowError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + }, { + "type" : "record", + "name" : "UnknownTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "taskId", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "UnknownWorkflowError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + } ] + } ] + }, "FailedWorkflowTaskError", "TimedOutTaskError", "TimedOutWorkflowError", "UnknownTaskError", "UnknownWorkflowError" ] + } ] + } ] + }, { + "name" : "taskCompletedEvent", + "type" : [ "null", { + "type" : "record", + "name" : "TaskCompletedEvent", + "fields" : [ { + "name" : "version", + "type" : "string" + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "serviceName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "taskRetrySequence", + "type" : "int" + }, { + "name" : "taskRetryIndex", + "type" : "int" + }, { + "name" : "requester", + "type" : [ "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ] + }, { + "name" : "clientWaiting", + "type" : [ "null", "boolean" ] + }, { + "name" : "taskTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "taskMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "isDelegated", + "type" : "boolean" + }, { + "name" : "returnValue", + "type" : { + "type" : "record", + "name" : "SerializedData", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "bytes", + "type" : "bytes" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "SerializedDataType", + "symbols" : [ "NULL", "AVRO_WITH_SCHEMA", "JSON", "JSON_JACKSON", "JSON_KOTLIN" ] + } + }, { + "name" : "meta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + } ] + } ] + } ] +} \ No newline at end of file diff --git a/infinitic-common/src/main/resources/schemasserviceExecutorEnvelope-0.16.1.avsc b/infinitic-common/src/main/resources/schemasserviceExecutorEnvelope-0.16.1.avsc new file mode 100644 index 000000000..e2e3f8c98 --- /dev/null +++ b/infinitic-common/src/main/resources/schemasserviceExecutorEnvelope-0.16.1.avsc @@ -0,0 +1,164 @@ +{ + "type" : "record", + "name" : "TaskExecutorEnvelope", + "namespace" : "io.infinitic.tasks.executor", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "TaskExecutorMessageType", + "symbols" : [ "EXECUTE_TASK" ] + } + }, { + "name" : "executeTask", + "type" : [ "null", { + "type" : "record", + "name" : "ExecuteTask", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "taskRetrySequence", + "type" : "int" + }, { + "name" : "taskRetryIndex", + "type" : "int" + }, { + "name" : "requester", + "type" : [ "null", { + "type" : "record", + "name" : "ClientRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "clientName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "WorkflowRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + } ] + } ], + "default" : null + }, { + "name" : "workflowName", + "type" : [ "null", "string" ] + }, { + "name" : "workflowId", + "type" : [ "null", "string" ] + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "taskTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "taskMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "clientWaiting", + "type" : "boolean" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : { + "type" : "record", + "name" : "SerializedData", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "bytes", + "type" : "bytes" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "SerializedDataType", + "symbols" : [ "NULL", "AVRO_WITH_SCHEMA", "JSON", "JSON_JACKSON", "JSON_KOTLIN" ] + } + }, { + "name" : "meta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + } + }, { + "name" : "lastError", + "type" : [ "null", { + "type" : "record", + "name" : "WorkerError", + "fields" : [ { + "name" : "workerName", + "type" : "string" + }, { + "name" : "name", + "type" : "string" + }, { + "name" : "message", + "type" : [ "null", "string" ] + }, { + "name" : "stackTraceToString", + "type" : "string" + }, { + "name" : "cause", + "type" : [ "null", "WorkerError" ] + } ] + } ] + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + } ] + } ] + } ] +} \ No newline at end of file diff --git a/infinitic-common/src/main/resources/schemasserviceTagEnvelope-0.16.1.avsc b/infinitic-common/src/main/resources/schemasserviceTagEnvelope-0.16.1.avsc new file mode 100644 index 000000000..8ecf6b2e2 --- /dev/null +++ b/infinitic-common/src/main/resources/schemasserviceTagEnvelope-0.16.1.avsc @@ -0,0 +1,238 @@ +{ + "type" : "record", + "name" : "TaskTagEnvelope", + "namespace" : "io.infinitic.tasks.tag", + "fields" : [ { + "name" : "name", + "type" : "string" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "TaskTagMessageType", + "symbols" : [ "GET_TASK_IDS_BY_TAG", "ADD_TAG_TO_TASK", "REMOVE_TAG_FROM_TASK", "CANCEL_TASK_BY_TAG", "RETRY_TASK_BY_TAG", "SET_ASYNC_TASK_DATA", "COMPLETE_ASYNC_TASK" ] + } + }, { + "name" : "addTagToTask", + "type" : [ "null", { + "type" : "record", + "name" : "AddTagToTask", + "fields" : [ { + "name" : "taskId", + "type" : "string" + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskTag", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "removeTagFromTask", + "type" : [ "null", { + "type" : "record", + "name" : "RemoveTagFromTask", + "fields" : [ { + "name" : "taskId", + "type" : "string" + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskTag", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "cancelTaskByTag", + "type" : [ "null", { + "type" : "record", + "name" : "CancelTaskByTag", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskTag", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "retryTaskByTag", + "type" : [ "null", { + "type" : "record", + "name" : "RetryTaskByTag", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskTag", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "getTaskIdsByTag", + "type" : [ "null", { + "type" : "record", + "name" : "GetTaskIdsByTag", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskTag", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "setDelegatedTaskData", + "type" : [ "null", { + "type" : "record", + "name" : "SetDelegatedTaskData", + "fields" : [ { + "name" : "delegatedTaskData", + "type" : { + "type" : "record", + "name" : "DelegatedTaskData", + "namespace" : "io.infinitic.tasks", + "fields" : [ { + "name" : "serviceName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "requester", + "type" : [ { + "type" : "record", + "name" : "ClientRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "clientName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "WorkflowRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + } ] + } ] + }, { + "name" : "clientWaiting", + "type" : [ "null", "boolean" ] + }, { + "name" : "taskMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "serviceName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ], + "default" : null + }, { + "name" : "completeDelegatedTask", + "type" : [ "null", { + "type" : "record", + "name" : "CompleteDelegatedTask", + "fields" : [ { + "name" : "returnValue", + "type" : { + "type" : "record", + "name" : "SerializedData", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "bytes", + "type" : "bytes" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "SerializedDataType", + "symbols" : [ "NULL", "AVRO_WITH_SCHEMA", "JSON", "JSON_JACKSON", "JSON_KOTLIN" ] + } + }, { + "name" : "meta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "serviceName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ], + "default" : null + } ] +} \ No newline at end of file diff --git a/infinitic-common/src/main/resources/schemasworkflowCmdEnvelope-0.16.1.avsc b/infinitic-common/src/main/resources/schemasworkflowCmdEnvelope-0.16.1.avsc new file mode 100644 index 000000000..99ecfd32e --- /dev/null +++ b/infinitic-common/src/main/resources/schemasworkflowCmdEnvelope-0.16.1.avsc @@ -0,0 +1,466 @@ +{ + "type" : "record", + "name" : "WorkflowCmdEnvelope", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "WorkflowCmdMessageType", + "symbols" : [ "WAIT_WORKFLOW", "CANCEL_WORKFLOW", "RETRY_WORKFLOW_TASK", "RETRY_TASKS", "COMPLETE_TIMERS", "COMPLETE_WORKFLOW", "SEND_SIGNAL", "DISPATCH_WORKFLOW", "DISPATCH_METHOD" ] + } + }, { + "name" : "dispatchWorkflow", + "type" : [ "null", { + "type" : "record", + "name" : "DispatchWorkflow", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : { + "type" : "record", + "name" : "SerializedData", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "bytes", + "type" : "bytes" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "SerializedDataType", + "symbols" : [ "NULL", "AVRO_WITH_SCHEMA", "JSON", "JSON_JACKSON", "JSON_KOTLIN" ] + } + }, { + "name" : "meta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + } + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "workflowTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "workflowTaskId", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "clientWaiting", + "type" : "boolean" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "parentWorkflowName", + "type" : [ "null", "string" ] + }, { + "name" : "parentWorkflowId", + "type" : [ "null", "string" ] + }, { + "name" : "parentMethodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "requester", + "type" : [ "null", { + "type" : "record", + "name" : "ClientRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "clientName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "WorkflowRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + } ] + } ], + "default" : null + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + }, { + "name" : "dispatchMethod", + "type" : [ "null", { + "type" : "record", + "name" : "DispatchMethod", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "parentWorkflowId", + "type" : [ "null", "string" ] + }, { + "name" : "parentWorkflowName", + "type" : [ "null", "string" ] + }, { + "name" : "parentMethodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + }, { + "name" : "clientWaiting", + "type" : "boolean" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + }, { + "name" : "waitWorkflow", + "type" : [ "null", { + "type" : "record", + "name" : "WaitWorkflow", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ] + }, { + "name" : "cancelWorkflow", + "type" : [ "null", { + "type" : "record", + "name" : "CancelWorkflow", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "reason", + "type" : { + "type" : "enum", + "name" : "WorkflowCancellationReason", + "namespace" : "io.infinitic.workflows.data", + "symbols" : [ "CANCELED_BY_CLIENT", "CANCELED_BY_PARENT" ] + } + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ] + }, { + "name" : "retryWorkflowTask", + "type" : [ "null", { + "type" : "record", + "name" : "RetryWorkflowTask", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ] + }, { + "name" : "retryTasks", + "type" : [ "null", { + "type" : "record", + "name" : "RetryTasks", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "taskId", + "type" : [ "null", "string" ] + }, { + "name" : "taskStatus", + "type" : [ "null", { + "type" : "enum", + "name" : "DeferredStatus", + "namespace" : "io.infinitic.workflows", + "symbols" : [ "ONGOING", "UNKNOWN", "CANCELED", "FAILED", "COMPLETED", "TIMED_OUT" ] + } ] + }, { + "name" : "taskName", + "type" : [ "null", "string" ] + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ] + }, { + "name" : "completeTimers", + "type" : [ "null", { + "type" : "record", + "name" : "CompleteTimers", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ] + }, { + "name" : "completeWorkflow", + "type" : [ "null", { + "type" : "record", + "name" : "CompleteWorkflow", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowReturnValue", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ] + }, { + "name" : "sendSignal", + "type" : [ "null", { + "type" : "record", + "name" : "SendSignal", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "channelName", + "type" : "string" + }, { + "name" : "channelSignalId", + "type" : "string" + }, { + "name" : "channelSignal", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "channelSignalTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ] + } ] +} \ No newline at end of file diff --git a/infinitic-common/src/main/resources/schemasworkflowEngineEnvelope-0.16.1.avsc b/infinitic-common/src/main/resources/schemasworkflowEngineEnvelope-0.16.1.avsc new file mode 100644 index 000000000..39eef2219 --- /dev/null +++ b/infinitic-common/src/main/resources/schemasworkflowEngineEnvelope-0.16.1.avsc @@ -0,0 +1,1085 @@ +{ + "type" : "record", + "name" : "WorkflowEngineEnvelope", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "WorkflowEngineMessageType", + "symbols" : [ "WAIT_WORKFLOW", "CANCEL_WORKFLOW", "RETRY_WORKFLOW_TASK", "RETRY_TASKS", "COMPLETE_TIMERS", "COMPLETE_WORKFLOW", "SEND_SIGNAL", "DISPATCH_WORKFLOW", "DISPATCH_METHOD", "TIMER_COMPLETED", "CHILD_WORKFLOW_UNKNOWN", "CHILD_WORKFLOW_CANCELED", "CHILD_WORKFLOW_FAILED", "CHILD_WORKFLOW_TIMED_OUT", "CHILD_WORKFLOW_COMPLETED", "TASK_CANCELED", "TASK_TIMED_OUT", "TASK_FAILED", "TASK_COMPLETED" ] + } + }, { + "name" : "dispatchWorkflow", + "type" : [ "null", { + "type" : "record", + "name" : "DispatchWorkflow", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : { + "type" : "record", + "name" : "SerializedData", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "bytes", + "type" : "bytes" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "SerializedDataType", + "symbols" : [ "NULL", "AVRO_WITH_SCHEMA", "JSON", "JSON_JACKSON", "JSON_KOTLIN" ] + } + }, { + "name" : "meta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + } + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "workflowTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "workflowTaskId", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "clientWaiting", + "type" : "boolean" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "parentWorkflowName", + "type" : [ "null", "string" ] + }, { + "name" : "parentWorkflowId", + "type" : [ "null", "string" ] + }, { + "name" : "parentMethodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "requester", + "type" : [ "null", { + "type" : "record", + "name" : "ClientRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "clientName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "WorkflowRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + } ] + } ], + "default" : null + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + }, { + "name" : "dispatchMethod", + "type" : [ "null", { + "type" : "record", + "name" : "DispatchMethod", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "parentWorkflowId", + "type" : [ "null", "string" ] + }, { + "name" : "parentWorkflowName", + "type" : [ "null", "string" ] + }, { + "name" : "parentMethodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + }, { + "name" : "clientWaiting", + "type" : "boolean" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + }, { + "name" : "waitWorkflow", + "type" : [ "null", { + "type" : "record", + "name" : "WaitWorkflow", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ] + }, { + "name" : "cancelWorkflow", + "type" : [ "null", { + "type" : "record", + "name" : "CancelWorkflow", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "reason", + "type" : { + "type" : "enum", + "name" : "WorkflowCancellationReason", + "namespace" : "io.infinitic.workflows.data", + "symbols" : [ "CANCELED_BY_CLIENT", "CANCELED_BY_PARENT" ] + } + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ] + }, { + "name" : "retryWorkflowTask", + "type" : [ "null", { + "type" : "record", + "name" : "RetryWorkflowTask", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ] + }, { + "name" : "retryTasks", + "type" : [ "null", { + "type" : "record", + "name" : "RetryTasks", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "taskId", + "type" : [ "null", "string" ] + }, { + "name" : "taskStatus", + "type" : [ "null", { + "type" : "enum", + "name" : "DeferredStatus", + "namespace" : "io.infinitic.workflows", + "symbols" : [ "ONGOING", "UNKNOWN", "CANCELED", "FAILED", "COMPLETED", "TIMED_OUT" ] + } ] + }, { + "name" : "taskName", + "type" : [ "null", "string" ] + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ] + }, { + "name" : "completeTimers", + "type" : [ "null", { + "type" : "record", + "name" : "CompleteTimers", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ], + "default" : null + }, { + "name" : "completeWorkflow", + "type" : [ "null", { + "type" : "record", + "name" : "CompleteWorkflow", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowReturnValue", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ] + }, { + "name" : "sendSignal", + "type" : [ "null", { + "type" : "record", + "name" : "SendSignal", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "channelName", + "type" : "string" + }, { + "name" : "channelSignalId", + "type" : "string" + }, { + "name" : "channelSignal", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "channelSignalTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ] + }, { + "name" : "timerCompleted", + "type" : [ "null", { + "type" : "record", + "name" : "TimerCompleted", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "timerId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + }, { + "name" : "childMethodUnknown", + "type" : [ "null", { + "type" : "record", + "name" : "ChildMethodUnknown", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "childUnknownWorkflowError", + "type" : { + "type" : "record", + "name" : "UnknownWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + }, { + "name" : "childMethodCanceled", + "type" : [ "null", { + "type" : "record", + "name" : "ChildMethodCanceled", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "childCanceledWorkflowError", + "type" : { + "type" : "record", + "name" : "CanceledWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + }, { + "name" : "childMethodTimedOut", + "type" : [ "null", { + "type" : "record", + "name" : "ChildMethodTimedOut", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "childMethodTimedOutError", + "type" : { + "type" : "record", + "name" : "TimedOutWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ], + "default" : null + }, { + "name" : "childMethodFailed", + "type" : [ "null", { + "type" : "record", + "name" : "ChildMethodFailed", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "childFailedWorkflowError", + "type" : { + "type" : "record", + "name" : "FailedWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "deferredError", + "type" : [ { + "type" : "record", + "name" : "CanceledTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + } ] + }, "CanceledWorkflowError", { + "type" : "record", + "name" : "FailedTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "cause", + "type" : { + "type" : "record", + "name" : "WorkerError", + "namespace" : "io.infinitic.tasks.executor", + "fields" : [ { + "name" : "workerName", + "type" : "string" + }, { + "name" : "name", + "type" : "string" + }, { + "name" : "message", + "type" : [ "null", "string" ] + }, { + "name" : "stackTraceToString", + "type" : "string" + }, { + "name" : "cause", + "type" : [ "null", "WorkerError" ] + } ] + } + } ] + }, "FailedWorkflowError", { + "type" : "record", + "name" : "FailedWorkflowTaskError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowTaskId", + "type" : "string" + }, { + "name" : "cause", + "type" : "io.infinitic.tasks.executor.WorkerError" + } ] + }, { + "type" : "record", + "name" : "TimedOutTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + } ] + }, "TimedOutWorkflowError", { + "type" : "record", + "name" : "UnknownTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "taskId", + "type" : "string" + } ] + }, "UnknownWorkflowError" ] + } ] + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + }, { + "name" : "childMethodCompleted", + "type" : [ "null", { + "type" : "record", + "name" : "ChildMethodCompleted", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "childWorkflowReturnValue", + "type" : { + "type" : "record", + "name" : "WorkflowReturnValue", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "returnValue", + "type" : "io.infinitic.data.SerializedData" + } ] + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + }, { + "name" : "taskCanceled", + "type" : [ "null", { + "type" : "record", + "name" : "TaskCanceled", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "canceledTaskError", + "type" : "CanceledTaskError" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + }, { + "name" : "taskTimedOut", + "type" : [ "null", { + "type" : "record", + "name" : "TaskTimedOut", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "taskTimedOutError", + "type" : "TimedOutTaskError" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ], + "default" : null + }, { + "name" : "taskFailed", + "type" : [ "null", { + "type" : "record", + "name" : "TaskFailed", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "failedTaskError", + "type" : "FailedTaskError" + }, { + "name" : "deferredError", + "type" : [ "null", "CanceledTaskError", "CanceledWorkflowError", "FailedTaskError", "FailedWorkflowError", "FailedWorkflowTaskError", "TimedOutTaskError", "TimedOutWorkflowError", "UnknownTaskError", "UnknownWorkflowError" ] + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + }, { + "name" : "taskCompleted", + "type" : [ "null", { + "type" : "record", + "name" : "TaskCompleted", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "taskReturnValue", + "type" : { + "type" : "record", + "name" : "TaskReturnValue", + "namespace" : "io.infinitic.tasks.data", + "fields" : [ { + "name" : "taskId", + "type" : "string" + }, { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "taskMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "returnValue", + "type" : "io.infinitic.data.SerializedData" + } ] + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + } ] +} \ No newline at end of file diff --git a/infinitic-common/src/main/resources/schemasworkflowEventEnvelope-0.16.1.avsc b/infinitic-common/src/main/resources/schemasworkflowEventEnvelope-0.16.1.avsc new file mode 100644 index 000000000..66841e7bf --- /dev/null +++ b/infinitic-common/src/main/resources/schemasworkflowEventEnvelope-0.16.1.avsc @@ -0,0 +1,1023 @@ +{ + "type" : "record", + "name" : "WorkflowEventEnvelope", + "namespace" : "io.infinitic.workflows.events", + "fields" : [ { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "WorkflowEventMessageType", + "symbols" : [ "WORKFLOW_COMPLETED", "WORKFLOW_CANCELED", "METHOD_DISPATCHED", "METHOD_COMPLETED", "METHOD_FAILED", "METHOD_CANCELED", "METHOD_TIMED_OUT", "TASK_DISPATCHED", "REMOTE_METHOD_DISPATCHED", "TIMER_DISPATCHED", "REMOTE_SIGNAL_DISPATCHED", "SIGNAL_RECEIVED", "SIGNAL_DISCARDED" ] + } + }, { + "name" : "workflowCompletedEvent", + "type" : [ "null", { + "type" : "record", + "name" : "WorkflowCompletedEvent", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "workflowCanceledEvent", + "type" : [ "null", { + "type" : "record", + "name" : "WorkflowCanceledEvent", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "methodDispatchedEvent", + "type" : [ "null", { + "type" : "record", + "name" : "MethodCommandedEvent", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : { + "type" : "record", + "name" : "SerializedData", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "bytes", + "type" : "bytes" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "SerializedDataType", + "symbols" : [ "NULL", "AVRO_WITH_SCHEMA", "JSON", "JSON_JACKSON", "JSON_KOTLIN" ] + } + }, { + "name" : "meta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + } + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "requester", + "type" : [ { + "type" : "record", + "name" : "ClientRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "clientName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "WorkflowRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + } ] + } ] + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "methodCompletedEvent", + "type" : [ "null", { + "type" : "record", + "name" : "MethodCompletedEvent", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + }, { + "name" : "awaitingRequesters", + "type" : { + "type" : "array", + "items" : [ "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ] + } + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "returnValue", + "type" : "io.infinitic.data.SerializedData" + } ] + } ] + }, { + "name" : "methodFailedEvent", + "type" : [ "null", { + "type" : "record", + "name" : "MethodFailedEvent", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + }, { + "name" : "awaitingRequesters", + "type" : { + "type" : "array", + "items" : [ "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ] + } + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "deferredError", + "type" : [ { + "type" : "record", + "name" : "CanceledTaskError", + "namespace" : "", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "CanceledWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + }, { + "type" : "record", + "name" : "FailedTaskError", + "namespace" : "", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "cause", + "type" : { + "type" : "record", + "name" : "WorkerError", + "namespace" : "io.infinitic.tasks.executor", + "fields" : [ { + "name" : "workerName", + "type" : "string" + }, { + "name" : "name", + "type" : "string" + }, { + "name" : "message", + "type" : [ "null", "string" ] + }, { + "name" : "stackTraceToString", + "type" : "string" + }, { + "name" : "cause", + "type" : [ "null", "WorkerError" ] + } ] + } + } ] + }, { + "type" : "record", + "name" : "FailedWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "deferredError", + "type" : [ "CanceledTaskError", "CanceledWorkflowError", "FailedTaskError", "FailedWorkflowError", { + "type" : "record", + "name" : "FailedWorkflowTaskError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowTaskId", + "type" : "string" + }, { + "name" : "cause", + "type" : "io.infinitic.tasks.executor.WorkerError" + } ] + }, { + "type" : "record", + "name" : "TimedOutTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "TimedOutWorkflowError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + }, { + "type" : "record", + "name" : "UnknownTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "taskId", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "UnknownWorkflowError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + } ] + } ] + }, "FailedWorkflowTaskError", "TimedOutTaskError", "TimedOutWorkflowError", "UnknownTaskError", "UnknownWorkflowError" ] + } ] + } ] + }, { + "name" : "methodCanceledEvent", + "type" : [ "null", { + "type" : "record", + "name" : "MethodCanceledEvent", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + }, { + "name" : "awaitingRequesters", + "type" : { + "type" : "array", + "items" : [ "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ] + } + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "methodTimedOutEvent", + "type" : [ "null", { + "type" : "record", + "name" : "MethodTimedOutEvent", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + }, { + "name" : "awaitingRequesters", + "type" : { + "type" : "array", + "items" : [ "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ] + } + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "taskDispatched", + "type" : [ "null", { + "type" : "record", + "name" : "TaskDispatchedEvent", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "taskDispatched", + "type" : { + "type" : "record", + "name" : "TaskDispatched", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "serviceName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "taskRetrySequence", + "type" : "int" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "taskTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "taskMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "timeoutInstant", + "type" : [ "null", "long" ] + } ] + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "remoteMethodDispatched", + "type" : [ "null", { + "type" : "record", + "name" : "RemoteMethodDispatchedEvent", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "remoteMethodDispatched", + "type" : [ { + "type" : "record", + "name" : "RemoteMethodDispatchedById", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "timeout", + "type" : [ "null", "long" ] + }, { + "name" : "emittedAt", + "type" : "long" + } ] + }, { + "type" : "record", + "name" : "RemoteMethodDispatchedByTag", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "workflowTag", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "timeout", + "type" : [ "null", "long" ] + }, { + "name" : "emittedAt", + "type" : "long" + } ] + }, { + "type" : "record", + "name" : "RemoteWorkflowDispatched", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "workflowTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "timeout", + "type" : [ "null", "long" ] + }, { + "name" : "emittedAt", + "type" : "long" + } ] + }, { + "type" : "record", + "name" : "RemoteWorkflowDispatchedByCustomId", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "customId", + "type" : "string" + }, { + "name" : "workflowTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "timeout", + "type" : [ "null", "long" ] + }, { + "name" : "emittedAt", + "type" : "long" + } ] + } ] + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "timerDispatched", + "type" : [ "null", { + "type" : "record", + "name" : "TimerDispatchedEvent", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "timerDispatched", + "type" : [ { + "type" : "record", + "name" : "DurationTimerDispatched", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "timerId", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : "long" + }, { + "name" : "duration", + "type" : "long" + } ] + }, { + "type" : "record", + "name" : "InstantTimerDispatched", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "timerId", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : "long" + }, { + "name" : "timerInstant", + "type" : "long" + } ] + } ] + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "remoteSignalDispatched", + "type" : [ "null", { + "type" : "record", + "name" : "SignalDispatchedEvent", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "remoteSignalDispatched", + "type" : [ { + "type" : "record", + "name" : "RemoteSignalDispatchedById", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "signalId", + "type" : "string" + }, { + "name" : "signalData", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "channelName", + "type" : "string" + }, { + "name" : "channelTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : "long" + } ] + }, { + "type" : "record", + "name" : "RemoteSignalDispatchedByTag", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "workflowTag", + "type" : "string" + }, { + "name" : "signalId", + "type" : "string" + }, { + "name" : "signalData", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "channelName", + "type" : "string" + }, { + "name" : "channelTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : "long" + } ] + } ] + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "signalDiscarded", + "type" : [ "null", { + "type" : "record", + "name" : "SignalDiscardedEvent", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "signalDiscarded", + "type" : { + "type" : "record", + "name" : "SignalDiscarded", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "signalId", + "type" : "string" + } ] + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "signalReceived", + "type" : [ "null", { + "type" : "record", + "name" : "SignalReceivedEvent", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "signalReceived", + "type" : { + "type" : "record", + "name" : "SignalReceived", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "signalId", + "type" : "string" + } ] + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + } ] +} \ No newline at end of file diff --git a/infinitic-common/src/main/resources/schemasworkflowState-0.16.1.avsc b/infinitic-common/src/main/resources/schemasworkflowState-0.16.1.avsc new file mode 100644 index 000000000..163f2abcd --- /dev/null +++ b/infinitic-common/src/main/resources/schemasworkflowState-0.16.1.avsc @@ -0,0 +1,1684 @@ +{ + "type" : "record", + "name" : "WorkflowState", + "namespace" : "io.infinitic.workflows.engine", + "fields" : [ { + "name" : "lastMessageId", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "runningWorkflowTaskId", + "type" : [ "null", "string" ] + }, { + "name" : "runningMethodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "runningMethodRunPosition", + "type" : [ "null", "int" ] + }, { + "name" : "runningTerminatedCommands", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "runningWorkflowTaskInstant", + "type" : [ "null", "long" ] + }, { + "name" : "workflowTaskIndex", + "type" : "int" + }, { + "name" : "methodRuns", + "type" : { + "type" : "array", + "items" : { + "type" : "record", + "name" : "MethodRun", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "waitingClients", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "requester", + "type" : [ "null", { + "type" : "record", + "name" : "ClientRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "clientName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "WorkflowRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + } ] + } ], + "default" : null + }, { + "name" : "parentWorkflowId", + "type" : [ "null", "string" ] + }, { + "name" : "parentWorkflowName", + "type" : [ "null", "string" ] + }, { + "name" : "parentWorkflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "parentMethodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "parentClientName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : { + "type" : "record", + "name" : "SerializedData", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "bytes", + "type" : "bytes" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "SerializedDataType", + "symbols" : [ "NULL", "AVRO_WITH_SCHEMA", "JSON", "JSON_JACKSON", "JSON_KOTLIN" ] + } + }, { + "name" : "meta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + } + }, { + "name" : "methodReturnValue", + "type" : [ "null", "io.infinitic.data.SerializedData" ] + }, { + "name" : "workflowTaskIndexAtStart", + "type" : "int" + }, { + "name" : "propertiesNameHashAtStart", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "pastCommands", + "type" : { + "type" : "array", + "items" : [ { + "type" : "record", + "name" : "DispatchMethod", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ { + "type" : "record", + "name" : "Canceled", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "canceledDeferredError", + "type" : [ { + "type" : "record", + "name" : "CanceledTaskError", + "namespace" : "", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "CanceledWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + } ] + }, { + "name" : "cancellationWorkflowTaskIndex", + "type" : "int" + } ] + }, { + "type" : "record", + "name" : "Completed", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "returnIndex", + "type" : "int", + "default" : 0 + }, { + "name" : "returnValue", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "completionWorkflowTaskIndex", + "type" : "int" + }, { + "name" : "signalId", + "type" : [ "null", "string" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "Failed", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "failedDeferredError", + "type" : [ { + "type" : "record", + "name" : "FailedTaskError", + "namespace" : "", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "cause", + "type" : { + "type" : "record", + "name" : "WorkerError", + "namespace" : "io.infinitic.tasks.executor", + "fields" : [ { + "name" : "workerName", + "type" : "string" + }, { + "name" : "name", + "type" : "string" + }, { + "name" : "message", + "type" : [ "null", "string" ] + }, { + "name" : "stackTraceToString", + "type" : "string" + }, { + "name" : "cause", + "type" : [ "null", "WorkerError" ] + } ] + } + } ] + }, { + "type" : "record", + "name" : "FailedWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "deferredError", + "type" : [ "CanceledTaskError", "CanceledWorkflowError", "FailedTaskError", "FailedWorkflowError", { + "type" : "record", + "name" : "FailedWorkflowTaskError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowTaskId", + "type" : "string" + }, { + "name" : "cause", + "type" : "io.infinitic.tasks.executor.WorkerError" + } ] + }, { + "type" : "record", + "name" : "TimedOutTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "TimedOutWorkflowError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + }, { + "type" : "record", + "name" : "UnknownTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "taskId", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "UnknownWorkflowError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + } ] + } ] + }, "FailedWorkflowTaskError" ] + }, { + "name" : "failureWorkflowTaskIndex", + "type" : "int" + } ] + }, { + "type" : "record", + "name" : "Ongoing", + "namespace" : "CommandStatus", + "fields" : [ ] + }, { + "type" : "record", + "name" : "TimedOut", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "deferredTimedOutError", + "type" : [ "TimedOutTaskError", "TimedOutWorkflowError" ] + }, { + "name" : "timeoutWorkflowTaskIndex", + "type" : "int" + } ] + }, { + "type" : "record", + "name" : "Unknown", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "unknownDeferredError", + "type" : [ "UnknownTaskError", "UnknownWorkflowError" ] + }, { + "name" : "unknowingWorkflowTaskIndex", + "type" : "int" + } ] + } ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "DispatchMethod", + "namespace" : "Command", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : [ "null", "string" ] + }, { + "name" : "workflowTag", + "type" : [ "null", "string" ] + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameterTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodTimeout", + "type" : [ "null", "long" ], + "default" : null + } ] + } + } ] + }, { + "type" : "record", + "name" : "DispatchTask", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "DispatchTask", + "namespace" : "Command", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameterTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodTimeout", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "taskTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "taskMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + }, { + "name" : "taskRetrySequence", + "type" : "int" + } ] + }, { + "type" : "record", + "name" : "DispatchWorkflow", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "DispatchWorkflow", + "namespace" : "Command", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameterTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodTimeout", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "workflowTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + } ] + }, { + "type" : "record", + "name" : "InlineTask", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "InlineTask", + "namespace" : "Command", + "fields" : [ { + "name" : "task", + "type" : "string" + } ] + } + } ] + }, { + "type" : "record", + "name" : "ReceiveSignal", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "ReceiveSignal", + "namespace" : "Command", + "fields" : [ { + "name" : "channelName", + "type" : "string" + }, { + "name" : "channelSignalType", + "type" : [ "null", "string" ] + }, { + "name" : "channelEventFilter", + "type" : [ "null", { + "type" : "record", + "name" : "ChannelEventFilter", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "jsonPath", + "type" : "string" + }, { + "name" : "filter", + "type" : [ "null", "string" ] + } ] + } ] + }, { + "name" : "receivedSignalLimit", + "type" : [ "int", "null" ], + "default" : 1 + } ] + } + }, { + "name" : "commandStatuses", + "type" : { + "type" : "array", + "items" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, + "default" : [ ] + } ] + }, { + "type" : "record", + "name" : "SendSignal", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "SendSignal", + "namespace" : "Command", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : [ "null", "string" ] + }, { + "name" : "workflowTag", + "type" : [ "null", "string" ] + }, { + "name" : "channelName", + "type" : "string" + }, { + "name" : "channelSignal", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "channelSignalTypes", + "type" : { + "type" : "array", + "items" : "string" + } + } ] + } + } ] + }, { + "type" : "record", + "name" : "StartDurationTimer", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "StartDurationTimer", + "namespace" : "Command", + "fields" : [ { + "name" : "duration", + "type" : "long" + } ] + } + } ] + }, { + "type" : "record", + "name" : "StartInstantTimer", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "StartInstantTimer", + "namespace" : "Command", + "fields" : [ { + "name" : "instant", + "type" : "long" + } ] + } + } ] + } ] + } + }, { + "name" : "pastSteps", + "type" : { + "type" : "array", + "items" : { + "type" : "record", + "name" : "PastStep", + "fields" : [ { + "name" : "stepPosition", + "type" : "int" + }, { + "name" : "step", + "type" : [ { + "type" : "record", + "name" : "And", + "namespace" : "Step", + "fields" : [ { + "name" : "steps", + "type" : { + "type" : "array", + "items" : [ "And", { + "type" : "record", + "name" : "Id", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "awaitIndex", + "type" : "int", + "default" : 0 + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + } ] + }, { + "type" : "record", + "name" : "Or", + "fields" : [ { + "name" : "steps", + "type" : { + "type" : "array", + "items" : [ "And", "Id", "Or" ] + } + } ] + } ] + } + } ] + }, "Step.Id", "Step.Or" ] + }, { + "name" : "stepHash", + "type" : "string" + }, { + "name" : "workflowTaskIndexAtStart", + "type" : "int" + }, { + "name" : "propertiesNameHashAtTermination", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ] + }, { + "name" : "workflowTaskIndexAtTermination", + "type" : [ "null", "int" ] + } ] + } + } + }, { + "name" : "currentStep", + "type" : [ "null", "PastStep" ] + } ] + } + } + }, { + "name" : "receivingChannels", + "type" : { + "type" : "array", + "items" : { + "type" : "record", + "name" : "ReceivingChannel", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "channelName", + "type" : "string" + }, { + "name" : "channelSignalType", + "type" : [ "null", "string" ] + }, { + "name" : "channelEventFilter", + "type" : [ "null", "ChannelEventFilter" ] + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "commandId", + "type" : "string" + }, { + "name" : "receivedSignalLimit", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "receivedSignalCount", + "type" : "int", + "default" : 0 + } ] + } + } + }, { + "name" : "currentPropertiesNameHash", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "propertiesHashValue", + "type" : { + "type" : "map", + "values" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "messagesBuffer", + "type" : { + "type" : "array", + "items" : [ { + "type" : "record", + "name" : "CancelWorkflow", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "reason", + "type" : { + "type" : "enum", + "name" : "WorkflowCancellationReason", + "namespace" : "io.infinitic.workflows.data", + "symbols" : [ "CANCELED_BY_CLIENT", "CANCELED_BY_PARENT" ] + } + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "CompleteTimers", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "CompleteWorkflow", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowReturnValue", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "DispatchMethod", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "parentWorkflowId", + "type" : [ "null", "string" ] + }, { + "name" : "parentWorkflowName", + "type" : [ "null", "string" ] + }, { + "name" : "parentMethodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + }, { + "name" : "clientWaiting", + "type" : "boolean" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "DispatchWorkflow", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "workflowTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "workflowTaskId", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "clientWaiting", + "type" : "boolean" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "parentWorkflowName", + "type" : [ "null", "string" ] + }, { + "name" : "parentWorkflowId", + "type" : [ "null", "string" ] + }, { + "name" : "parentMethodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "ChildMethodCanceled", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "childCanceledWorkflowError", + "type" : "CanceledWorkflowError" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "ChildMethodCompleted", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "childWorkflowReturnValue", + "type" : { + "type" : "record", + "name" : "WorkflowReturnValue", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "returnValue", + "type" : "io.infinitic.data.SerializedData" + } ] + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "ChildMethodFailed", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "childFailedWorkflowError", + "type" : "FailedWorkflowError" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "ChildMethodTimedOut", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "childMethodTimedOutError", + "type" : "TimedOutWorkflowError" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "ChildMethodUnknown", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "childUnknownWorkflowError", + "type" : "UnknownWorkflowError" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "TaskCanceled", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "canceledTaskError", + "type" : "CanceledTaskError" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "TaskCompleted", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "taskReturnValue", + "type" : { + "type" : "record", + "name" : "TaskReturnValue", + "namespace" : "io.infinitic.tasks.data", + "fields" : [ { + "name" : "taskId", + "type" : "string" + }, { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "taskMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "returnValue", + "type" : "io.infinitic.data.SerializedData" + } ] + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "TaskFailed", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "failedTaskError", + "type" : "FailedTaskError" + }, { + "name" : "deferredError", + "type" : [ "null", "CanceledTaskError", "CanceledWorkflowError", "FailedTaskError", "FailedWorkflowError", "FailedWorkflowTaskError", "TimedOutTaskError", "TimedOutWorkflowError", "UnknownTaskError", "UnknownWorkflowError" ] + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "TaskTimedOut", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "taskTimedOutError", + "type" : "TimedOutTaskError" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "TimerCompleted", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "timerId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "RetryTasks", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "taskId", + "type" : [ "null", "string" ] + }, { + "name" : "taskStatus", + "type" : [ "null", { + "type" : "enum", + "name" : "DeferredStatus", + "namespace" : "io.infinitic.workflows", + "symbols" : [ "ONGOING", "UNKNOWN", "CANCELED", "FAILED", "COMPLETED", "TIMED_OUT" ] + } ] + }, { + "name" : "taskName", + "type" : [ "null", "string" ] + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "RetryWorkflowTask", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "SendSignal", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "channelName", + "type" : "string" + }, { + "name" : "channelSignalId", + "type" : "string" + }, { + "name" : "channelSignal", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "channelSignalTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "WaitWorkflow", + "fields" : [ { + "name" : "version", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "messageId", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + } ] + } ] + } + } ] +} \ No newline at end of file diff --git a/infinitic-common/src/main/resources/schemasworkflowTagEnvelope-0.16.1.avsc b/infinitic-common/src/main/resources/schemasworkflowTagEnvelope-0.16.1.avsc new file mode 100644 index 000000000..71ed432ba --- /dev/null +++ b/infinitic-common/src/main/resources/schemasworkflowTagEnvelope-0.16.1.avsc @@ -0,0 +1,457 @@ +{ + "type" : "record", + "name" : "WorkflowTagEnvelope", + "namespace" : "io.infinitic.workflows.tag", + "fields" : [ { + "name" : "name", + "type" : "string" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "WorkflowTagMessageType", + "symbols" : [ "DISPATCH_WORKFLOW_BY_CUSTOM_ID", "DISPATCH_METHOD_BY_TAG", "ADD_TAG_TO_WORKFLOW", "REMOVE_TAG_FROM_WORKFLOW", "SEND_SIGNAL_BY_TAG", "CANCEL_WORKFLOW_BY_TAG", "RETRY_WORKFLOW_TASK_BY_TAG", "RETRY_TASKS_BY_TAG", "COMPLETE_TIMER_BY_TAG", "GET_WORKFLOW_IDS_BY_TAG" ] + } + }, { + "name" : "dispatchWorkflowByCustomId", + "type" : [ "null", { + "type" : "record", + "name" : "DispatchWorkflowByCustomId", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowTag", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : { + "type" : "record", + "name" : "SerializedData", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "bytes", + "type" : "bytes" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "SerializedDataType", + "symbols" : [ "NULL", "AVRO_WITH_SCHEMA", "JSON", "JSON_JACKSON", "JSON_KOTLIN" ] + } + }, { + "name" : "meta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + } + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "methodTimeout", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "workflowTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "parentWorkflowName", + "type" : [ "null", "string" ] + }, { + "name" : "parentWorkflowId", + "type" : [ "null", "string" ] + }, { + "name" : "parentMethodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "requester", + "type" : [ "null", { + "type" : "record", + "name" : "ClientRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "clientName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "WorkflowRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + } ] + } ], + "default" : null + }, { + "name" : "clientWaiting", + "type" : "boolean" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ], + "default" : null + }, { + "name" : "dispatchMethodByTag", + "type" : [ "null", { + "type" : "record", + "name" : "DispatchMethodByTag", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowTag", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "parentWorkflowId", + "type" : [ "null", "string" ] + }, { + "name" : "parentWorkflowName", + "type" : [ "null", "string" ] + }, { + "name" : "parentMethodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + }, { + "name" : "clientWaiting", + "type" : "boolean" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodTimeout", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "addTagToWorkflow", + "type" : [ "null", { + "type" : "record", + "name" : "AddTagToWorkflow", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowTag", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + }, { + "name" : "removeTagFromWorkflow", + "type" : [ "null", { + "type" : "record", + "name" : "RemoveTagFromWorkflow", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowTag", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + }, { + "name" : "sendSignalByTag", + "type" : [ "null", { + "type" : "record", + "name" : "SendSignalByTag", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowTag", + "type" : "string" + }, { + "name" : "channelName", + "type" : "string" + }, { + "name" : "channelSignalId", + "type" : "string" + }, { + "name" : "channelSignal", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "channelSignalTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "emitterWorkflowId", + "type" : [ "null", "string" ] + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "cancelWorkflowByTag", + "type" : [ "null", { + "type" : "record", + "name" : "CancelWorkflowByTag", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowTag", + "type" : "string" + }, { + "name" : "reason", + "type" : { + "type" : "enum", + "name" : "WorkflowCancellationReason", + "namespace" : "io.infinitic.workflows.data", + "symbols" : [ "CANCELED_BY_CLIENT", "CANCELED_BY_PARENT" ] + } + }, { + "name" : "emitterWorkflowId", + "type" : [ "null", "string" ] + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "retryWorkflowTaskByTag", + "type" : [ "null", { + "type" : "record", + "name" : "RetryWorkflowTaskByTag", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowTag", + "type" : "string" + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "retryTasksByTag", + "type" : [ "null", { + "type" : "record", + "name" : "RetryTasksByTag", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowTag", + "type" : "string" + }, { + "name" : "taskId", + "type" : [ "null", "string" ] + }, { + "name" : "taskStatus", + "type" : [ "null", { + "type" : "enum", + "name" : "DeferredStatus", + "namespace" : "io.infinitic.workflows", + "symbols" : [ "ONGOING", "UNKNOWN", "CANCELED", "FAILED", "COMPLETED", "TIMED_OUT" ] + } ] + }, { + "name" : "taskName", + "type" : [ "null", "string" ] + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ] + }, { + "name" : "completeTimersByTag", + "type" : [ "null", { + "type" : "record", + "name" : "CompleteTimersByTag", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowTag", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "requester", + "type" : [ "null", "io.infinitic.data.ClientRequester", "io.infinitic.data.WorkflowRequester" ], + "default" : null + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "emitterName", + "type" : "string" + } ] + } ], + "default" : null + }, { + "name" : "getWorkflowIdsByTag", + "type" : [ "null", { + "type" : "record", + "name" : "GetWorkflowIdsByTag", + "fields" : [ { + "name" : "messageId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowTag", + "type" : "string" + }, { + "name" : "emitterName", + "type" : "string" + }, { + "name" : "emittedAt", + "type" : [ "null", "long" ], + "default" : null + } ] + } ] + } ] +} \ No newline at end of file diff --git a/infinitic-common/src/main/resources/schemasworkflowTaskParameters-0.16.1.avsc b/infinitic-common/src/main/resources/schemasworkflowTaskParameters-0.16.1.avsc new file mode 100644 index 000000000..45de57148 --- /dev/null +++ b/infinitic-common/src/main/resources/schemasworkflowTaskParameters-0.16.1.avsc @@ -0,0 +1,833 @@ +{ + "type" : "record", + "name" : "WorkflowTaskParameters", + "namespace" : "io.infinitic.common.workflows.data.workflowTasks", + "fields" : [ { + "name" : "version", + "type" : "string", + "default" : "0.9.7" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "workflowTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + }, { + "name" : "workflowPropertiesHashValue", + "type" : { + "type" : "map", + "values" : { + "type" : "record", + "name" : "SerializedData", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "bytes", + "type" : "bytes" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "SerializedDataType", + "symbols" : [ "NULL", "AVRO_WITH_SCHEMA", "JSON", "JSON_JACKSON", "JSON_KOTLIN" ] + } + }, { + "name" : "meta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + } + }, { + "name" : "workflowTaskIndex", + "type" : "int" + }, { + "name" : "workflowTaskInstant", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "methodRun", + "type" : { + "type" : "record", + "name" : "MethodRun", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "waitingClients", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "methodRunId", + "type" : "string" + }, { + "name" : "requester", + "type" : [ "null", { + "type" : "record", + "name" : "ClientRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "clientName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "WorkflowRequester", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowVersion", + "type" : [ "null", "int" ] + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : "string" + }, { + "name" : "workflowMethodId", + "type" : "string" + } ] + } ], + "default" : null + }, { + "name" : "parentWorkflowId", + "type" : [ "null", "string" ] + }, { + "name" : "parentWorkflowName", + "type" : [ "null", "string" ] + }, { + "name" : "parentWorkflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "parentMethodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "parentClientName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameterTypes", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ] + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodReturnValue", + "type" : [ "null", "io.infinitic.data.SerializedData" ] + }, { + "name" : "workflowTaskIndexAtStart", + "type" : "int" + }, { + "name" : "propertiesNameHashAtStart", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "pastCommands", + "type" : { + "type" : "array", + "items" : [ { + "type" : "record", + "name" : "DispatchMethod", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ { + "type" : "record", + "name" : "Canceled", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "canceledDeferredError", + "type" : [ { + "type" : "record", + "name" : "CanceledTaskError", + "namespace" : "", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "CanceledWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + } ] + }, { + "name" : "cancellationWorkflowTaskIndex", + "type" : "int" + } ] + }, { + "type" : "record", + "name" : "Completed", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "returnIndex", + "type" : "int", + "default" : 0 + }, { + "name" : "returnValue", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "completionWorkflowTaskIndex", + "type" : "int" + }, { + "name" : "signalId", + "type" : [ "null", "string" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "Failed", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "failedDeferredError", + "type" : [ { + "type" : "record", + "name" : "FailedTaskError", + "namespace" : "", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "cause", + "type" : { + "type" : "record", + "name" : "WorkerError", + "namespace" : "io.infinitic.tasks.executor", + "fields" : [ { + "name" : "workerName", + "type" : "string" + }, { + "name" : "name", + "type" : "string" + }, { + "name" : "message", + "type" : [ "null", "string" ] + }, { + "name" : "stackTraceToString", + "type" : "string" + }, { + "name" : "cause", + "type" : [ "null", "WorkerError" ] + } ] + } + } ] + }, { + "type" : "record", + "name" : "FailedWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "deferredError", + "type" : [ "CanceledTaskError", "CanceledWorkflowError", "FailedTaskError", "FailedWorkflowError", { + "type" : "record", + "name" : "FailedWorkflowTaskError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowTaskId", + "type" : "string" + }, { + "name" : "cause", + "type" : "io.infinitic.tasks.executor.WorkerError" + } ] + }, { + "type" : "record", + "name" : "TimedOutTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "TimedOutWorkflowError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + }, { + "type" : "record", + "name" : "UnknownTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "taskId", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "UnknownWorkflowError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + } ] + } ] + }, "FailedWorkflowTaskError" ] + }, { + "name" : "failureWorkflowTaskIndex", + "type" : "int" + } ] + }, { + "type" : "record", + "name" : "Ongoing", + "namespace" : "CommandStatus", + "fields" : [ ] + }, { + "type" : "record", + "name" : "TimedOut", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "deferredTimedOutError", + "type" : [ "TimedOutTaskError", "TimedOutWorkflowError" ] + }, { + "name" : "timeoutWorkflowTaskIndex", + "type" : "int" + } ] + }, { + "type" : "record", + "name" : "Unknown", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "unknownDeferredError", + "type" : [ "UnknownTaskError", "UnknownWorkflowError" ] + }, { + "name" : "unknowingWorkflowTaskIndex", + "type" : "int" + } ] + } ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "DispatchMethod", + "namespace" : "Command", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : [ "null", "string" ] + }, { + "name" : "workflowTag", + "type" : [ "null", "string" ] + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameterTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodTimeout", + "type" : [ "null", "long" ], + "default" : null + } ] + } + } ] + }, { + "type" : "record", + "name" : "DispatchTask", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "DispatchTask", + "namespace" : "Command", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameterTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodTimeout", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "taskTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "taskMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + }, { + "name" : "taskRetrySequence", + "type" : "int" + } ] + }, { + "type" : "record", + "name" : "DispatchWorkflow", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "DispatchWorkflow", + "namespace" : "Command", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameterTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodTimeout", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "workflowTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + } ] + }, { + "type" : "record", + "name" : "InlineTask", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "InlineTask", + "namespace" : "Command", + "fields" : [ { + "name" : "task", + "type" : "string" + } ] + } + } ] + }, { + "type" : "record", + "name" : "ReceiveSignal", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "ReceiveSignal", + "namespace" : "Command", + "fields" : [ { + "name" : "channelName", + "type" : "string" + }, { + "name" : "channelSignalType", + "type" : [ "null", "string" ] + }, { + "name" : "channelEventFilter", + "type" : [ "null", { + "type" : "record", + "name" : "ChannelEventFilter", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "jsonPath", + "type" : "string" + }, { + "name" : "filter", + "type" : [ "null", "string" ] + } ] + } ] + }, { + "name" : "receivedSignalLimit", + "type" : [ "int", "null" ], + "default" : 1 + } ] + } + }, { + "name" : "commandStatuses", + "type" : { + "type" : "array", + "items" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, + "default" : [ ] + } ] + }, { + "type" : "record", + "name" : "SendSignal", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "SendSignal", + "namespace" : "Command", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : [ "null", "string" ] + }, { + "name" : "workflowTag", + "type" : [ "null", "string" ] + }, { + "name" : "channelName", + "type" : "string" + }, { + "name" : "channelSignal", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "channelSignalTypes", + "type" : { + "type" : "array", + "items" : "string" + } + } ] + } + } ] + }, { + "type" : "record", + "name" : "StartDurationTimer", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "StartDurationTimer", + "namespace" : "Command", + "fields" : [ { + "name" : "duration", + "type" : "long" + } ] + } + } ] + }, { + "type" : "record", + "name" : "StartInstantTimer", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "StartInstantTimer", + "namespace" : "Command", + "fields" : [ { + "name" : "instant", + "type" : "long" + } ] + } + } ] + } ] + } + }, { + "name" : "pastSteps", + "type" : { + "type" : "array", + "items" : { + "type" : "record", + "name" : "PastStep", + "fields" : [ { + "name" : "stepPosition", + "type" : "int" + }, { + "name" : "step", + "type" : [ { + "type" : "record", + "name" : "And", + "namespace" : "Step", + "fields" : [ { + "name" : "steps", + "type" : { + "type" : "array", + "items" : [ "And", { + "type" : "record", + "name" : "Id", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "awaitIndex", + "type" : "int", + "default" : 0 + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + } ] + }, { + "type" : "record", + "name" : "Or", + "fields" : [ { + "name" : "steps", + "type" : { + "type" : "array", + "items" : [ "And", "Id", "Or" ] + } + } ] + } ] + } + } ] + }, "Step.Id", "Step.Or" ] + }, { + "name" : "stepHash", + "type" : "string" + }, { + "name" : "workflowTaskIndexAtStart", + "type" : "int" + }, { + "name" : "propertiesNameHashAtTermination", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ] + }, { + "name" : "workflowTaskIndexAtTermination", + "type" : [ "null", "int" ] + } ] + } + } + }, { + "name" : "currentStep", + "type" : [ "null", "PastStep" ] + } ] + } + }, { + "name" : "emitterName", + "type" : "string" + } ] +} \ No newline at end of file diff --git a/infinitic-common/src/main/resources/schemasworkflowTaskReturnValue-0.16.1.avsc b/infinitic-common/src/main/resources/schemasworkflowTaskReturnValue-0.16.1.avsc new file mode 100644 index 000000000..9c82c3e71 --- /dev/null +++ b/infinitic-common/src/main/resources/schemasworkflowTaskReturnValue-0.16.1.avsc @@ -0,0 +1,699 @@ +{ + "type" : "record", + "name" : "WorkflowTaskReturnValue", + "namespace" : "io.infinitic.common.workflows.data.workflowTasks", + "fields" : [ { + "name" : "version", + "type" : "string", + "default" : "0.9.7" + }, { + "name" : "newCommands", + "type" : { + "type" : "array", + "items" : [ { + "type" : "record", + "name" : "DispatchMethod", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ { + "type" : "record", + "name" : "Canceled", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "canceledDeferredError", + "type" : [ { + "type" : "record", + "name" : "CanceledTaskError", + "namespace" : "", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "CanceledWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + } ] + }, { + "name" : "cancellationWorkflowTaskIndex", + "type" : "int" + } ] + }, { + "type" : "record", + "name" : "Completed", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "returnIndex", + "type" : "int", + "default" : 0 + }, { + "name" : "returnValue", + "type" : { + "type" : "record", + "name" : "SerializedData", + "namespace" : "io.infinitic.data", + "fields" : [ { + "name" : "bytes", + "type" : "bytes" + }, { + "name" : "type", + "type" : { + "type" : "enum", + "name" : "SerializedDataType", + "symbols" : [ "NULL", "AVRO_WITH_SCHEMA", "JSON", "JSON_JACKSON", "JSON_KOTLIN" ] + } + }, { + "name" : "meta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + }, { + "name" : "completionWorkflowTaskIndex", + "type" : "int" + }, { + "name" : "signalId", + "type" : [ "null", "string" ], + "default" : null + } ] + }, { + "type" : "record", + "name" : "Failed", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "failedDeferredError", + "type" : [ { + "type" : "record", + "name" : "FailedTaskError", + "namespace" : "", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "cause", + "type" : { + "type" : "record", + "name" : "WorkerError", + "namespace" : "io.infinitic.tasks.executor", + "fields" : [ { + "name" : "workerName", + "type" : "string" + }, { + "name" : "name", + "type" : "string" + }, { + "name" : "message", + "type" : [ "null", "string" ] + }, { + "name" : "stackTraceToString", + "type" : "string" + }, { + "name" : "cause", + "type" : [ "null", "WorkerError" ] + } ] + } + } ] + }, { + "type" : "record", + "name" : "FailedWorkflowError", + "namespace" : "", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + }, { + "name" : "deferredError", + "type" : [ "CanceledTaskError", "CanceledWorkflowError", "FailedTaskError", "FailedWorkflowError", { + "type" : "record", + "name" : "FailedWorkflowTaskError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowTaskId", + "type" : "string" + }, { + "name" : "cause", + "type" : "io.infinitic.tasks.executor.WorkerError" + } ] + }, { + "type" : "record", + "name" : "TimedOutTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "taskId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "TimedOutWorkflowError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + }, { + "type" : "record", + "name" : "UnknownTaskError", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "taskId", + "type" : "string" + } ] + }, { + "type" : "record", + "name" : "UnknownWorkflowError", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : "string" + }, { + "name" : "workflowMethodName", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "methodRunId", + "type" : [ "null", "string" ] + } ] + } ] + } ] + }, "FailedWorkflowTaskError" ] + }, { + "name" : "failureWorkflowTaskIndex", + "type" : "int" + } ] + }, { + "type" : "record", + "name" : "Ongoing", + "namespace" : "CommandStatus", + "fields" : [ ] + }, { + "type" : "record", + "name" : "TimedOut", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "deferredTimedOutError", + "type" : [ "TimedOutTaskError", "TimedOutWorkflowError" ] + }, { + "name" : "timeoutWorkflowTaskIndex", + "type" : "int" + } ] + }, { + "type" : "record", + "name" : "Unknown", + "namespace" : "CommandStatus", + "fields" : [ { + "name" : "unknownDeferredError", + "type" : [ "UnknownTaskError", "UnknownWorkflowError" ] + }, { + "name" : "unknowingWorkflowTaskIndex", + "type" : "int" + } ] + } ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "DispatchMethod", + "namespace" : "Command", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : [ "null", "string" ] + }, { + "name" : "workflowTag", + "type" : [ "null", "string" ] + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameterTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodTimeout", + "type" : [ "null", "long" ], + "default" : null + } ] + } + } ] + }, { + "type" : "record", + "name" : "DispatchTask", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "DispatchTask", + "namespace" : "Command", + "fields" : [ { + "name" : "taskName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameterTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodTimeout", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "taskTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "taskMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + }, { + "name" : "taskRetrySequence", + "type" : "int" + } ] + }, { + "type" : "record", + "name" : "DispatchWorkflow", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "DispatchWorkflow", + "namespace" : "Command", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "methodName", + "type" : "string" + }, { + "name" : "methodParameterTypes", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "methodParameters", + "type" : { + "type" : "array", + "items" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodTimeout", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "workflowTags", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "workflowMeta", + "type" : { + "type" : "map", + "values" : "bytes" + } + } ] + } + } ] + }, { + "type" : "record", + "name" : "InlineTask", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "InlineTask", + "namespace" : "Command", + "fields" : [ { + "name" : "task", + "type" : "string" + } ] + } + } ] + }, { + "type" : "record", + "name" : "ReceiveSignal", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "ReceiveSignal", + "namespace" : "Command", + "fields" : [ { + "name" : "channelName", + "type" : "string" + }, { + "name" : "channelSignalType", + "type" : [ "null", "string" ] + }, { + "name" : "channelEventFilter", + "type" : [ "null", { + "type" : "record", + "name" : "ChannelEventFilter", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "jsonPath", + "type" : "string" + }, { + "name" : "filter", + "type" : [ "null", "string" ] + } ] + } ] + }, { + "name" : "receivedSignalLimit", + "type" : [ "int", "null" ], + "default" : 1 + } ] + } + }, { + "name" : "commandStatuses", + "type" : { + "type" : "array", + "items" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, + "default" : [ ] + } ] + }, { + "type" : "record", + "name" : "SendSignal", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "SendSignal", + "namespace" : "Command", + "fields" : [ { + "name" : "workflowName", + "type" : "string" + }, { + "name" : "workflowId", + "type" : [ "null", "string" ] + }, { + "name" : "workflowTag", + "type" : [ "null", "string" ] + }, { + "name" : "channelName", + "type" : "string" + }, { + "name" : "channelSignal", + "type" : "io.infinitic.data.SerializedData" + }, { + "name" : "channelSignalTypes", + "type" : { + "type" : "array", + "items" : "string" + } + } ] + } + } ] + }, { + "type" : "record", + "name" : "StartDurationTimer", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "StartDurationTimer", + "namespace" : "Command", + "fields" : [ { + "name" : "duration", + "type" : "long" + } ] + } + } ] + }, { + "type" : "record", + "name" : "StartInstantTimer", + "namespace" : "PastCommand", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "commandPosition", + "type" : "int" + }, { + "name" : "commandSimpleName", + "type" : "string" + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + }, { + "name" : "command", + "type" : { + "type" : "record", + "name" : "StartInstantTimer", + "namespace" : "Command", + "fields" : [ { + "name" : "instant", + "type" : "long" + } ] + } + } ] + } ] + } + }, { + "name" : "newStep", + "type" : [ "null", { + "type" : "record", + "name" : "NewStep", + "namespace" : "io.infinitic.workflows.data", + "fields" : [ { + "name" : "stepId", + "type" : "string" + }, { + "name" : "step", + "type" : [ { + "type" : "record", + "name" : "And", + "namespace" : "Step", + "fields" : [ { + "name" : "steps", + "type" : { + "type" : "array", + "items" : [ "And", { + "type" : "record", + "name" : "Id", + "fields" : [ { + "name" : "commandId", + "type" : "string" + }, { + "name" : "awaitIndex", + "type" : "int", + "default" : 0 + }, { + "name" : "commandStatus", + "type" : [ "CommandStatus.Canceled", "CommandStatus.Completed", "CommandStatus.Failed", "CommandStatus.Ongoing", "CommandStatus.TimedOut", "CommandStatus.Unknown" ] + } ] + }, { + "type" : "record", + "name" : "Or", + "fields" : [ { + "name" : "steps", + "type" : { + "type" : "array", + "items" : [ "And", "Id", "Or" ] + } + } ] + } ] + } + } ] + }, "Step.Id", "Step.Or" ] + }, { + "name" : "stepPosition", + "type" : "int" + } ] + } ] + }, { + "name" : "properties", + "type" : { + "type" : "map", + "values" : "io.infinitic.data.SerializedData" + } + }, { + "name" : "methodReturnValue", + "type" : [ "null", "io.infinitic.data.SerializedData" ] + }, { + "name" : "workflowVersion", + "type" : "int", + "default" : 0 + }, { + "name" : "workflowTaskInstant", + "type" : [ "null", "long" ], + "default" : null + } ] +} \ No newline at end of file diff --git a/infinitic-common/src/main/resources/versions b/infinitic-common/src/main/resources/versions index d2ccd76b0..81d7bc704 100644 --- a/infinitic-common/src/main/resources/versions +++ b/infinitic-common/src/main/resources/versions @@ -33,3 +33,4 @@ 0.14.1 0.15.0 0.16.0 +0.16.1 From 056906e0ef860621d9551a584eb6527a689c3d76 Mon Sep 17 00:00:00 2001 From: Gilles Barbier Date: Thu, 24 Oct 2024 14:28:48 +0200 Subject: [PATCH 4/6] Refactor CI workflow for improved build and testing Consolidate build and test steps into a single job and update actions to their latest versions. Added caching for Gradle packages and enabled publishing of Build Scans for better diagnostics. Adjusted timeout and worker configuration to optimize performance. --- .github/workflows/engine-ci.yml | 34 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/.github/workflows/engine-ci.yml b/.github/workflows/engine-ci.yml index 61812e998..1188d1f46 100644 --- a/.github/workflows/engine-ci.yml +++ b/.github/workflows/engine-ci.yml @@ -26,39 +26,31 @@ on: pull_request: branches: - main - paths: - - ".github/workflows/engine-ci.yml" - - "infinitic-*/**" jobs: - build: + test: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Java 17 - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: java-version: 17 + distribution: 'adopt' - - name: Assemble with Gradle - run: ./gradlew build --no-daemon -x test -x spotlessCheck --parallel --max-workers=8 # <= -d used to debug if needed - timeout-minutes: 5 # max time allocated (useful if some tests hang) - - test: - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Setup Java 17 - uses: actions/setup-java@v1 + - name: Cache Gradle packages + uses: gradle/actions/setup-gradle@v3 with: - java-version: 17 + gradle-version: wrapper + cache-read-only: false - name: Test with Gradle - run: ./gradlew test --no-daemon --parallel --max-workers=8 # <= -d used to debug if needed + run: ./gradlew test --info --scan --no-daemon --parallel --max-workers=$(nproc) # <= -d used to debug if needed timeout-minutes: 12 # max time allocated (useful if some tests hang) + + - name: Publish Build Scan + if: success() + run: echo "Build Scan URL is ${{ steps.build.outputs.build-scan-url }}" From 24284c21c28b8cdf5f529efa6d42feb8aa5d18d0 Mon Sep 17 00:00:00 2001 From: Gilles Barbier Date: Thu, 24 Oct 2024 14:40:03 +0200 Subject: [PATCH 5/6] Changed logging levels in test module to 'info' for better performance in tests. Simplified the Gradle test command in CI by removing unnecessary options. --- .github/workflows/engine-ci.yml | 2 +- infinitic-tests/src/test/resources/simplelogger.properties | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/engine-ci.yml b/.github/workflows/engine-ci.yml index 1188d1f46..63264a066 100644 --- a/.github/workflows/engine-ci.yml +++ b/.github/workflows/engine-ci.yml @@ -48,7 +48,7 @@ jobs: cache-read-only: false - name: Test with Gradle - run: ./gradlew test --info --scan --no-daemon --parallel --max-workers=$(nproc) # <= -d used to debug if needed + run: ./gradlew test --info --scan # <= -d used to debug if needed timeout-minutes: 12 # max time allocated (useful if some tests hang) - name: Publish Build Scan diff --git a/infinitic-tests/src/test/resources/simplelogger.properties b/infinitic-tests/src/test/resources/simplelogger.properties index 72a1f9637..255d57f87 100644 --- a/infinitic-tests/src/test/resources/simplelogger.properties +++ b/infinitic-tests/src/test/resources/simplelogger.properties @@ -9,10 +9,10 @@ org.slf4j.simpleLogger.defaultLogLevel=warn # Logging detail level for a SimpleLogger instance named "xxxxx". # Must be one of ("trace", "debug", "info", "warn", or "error"). # If not specified, the default logging detail level is used. -org.slf4j.simpleLogger.log.io.infinitic.clients.InfiniticClient=debug -org.slf4j.simpleLogger.log.io.infinitic.workers.InfiniticWorker=debug +org.slf4j.simpleLogger.log.io.infinitic.clients.InfiniticClient=info +org.slf4j.simpleLogger.log.io.infinitic.workers.InfiniticWorker=info org.slf4j.simpleLogger.log.io.infinitic.workflows.tag.WorkflowTagEngine=info -org.slf4j.simpleLogger.log.io.infinitic.workflows.engine.WorkflowStateEngine=debug +org.slf4j.simpleLogger.log.io.infinitic.workflows.engine.WorkflowStateEngine=info org.slf4j.simpleLogger.log.io.infinitic.workflows.engine.WorkflowStateCmdHandler=info org.slf4j.simpleLogger.log.io.infinitic.workflows.engine.WorkflowStateEventHandler=info org.slf4j.simpleLogger.log.io.infinitic.workflows.engine.WorkflowStateTimerHandler=info From d671bd6e8a02d3a184674eb2b5e6a7ddfa5352e3 Mon Sep 17 00:00:00 2001 From: Gilles Barbier Date: Thu, 24 Oct 2024 15:08:24 +0200 Subject: [PATCH 6/6] Fix a test in StartConsumingTests.kt --- .../common/transport/consumers/StartConsumingTests.kt | 9 +++++++-- .../src/test/resources/simplelogger.properties | 8 ++++---- .../src/test/resources/simplelogger.properties | 2 +- .../src/test/resources/simplelogger.properties | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/infinitic-common/src/test/kotlin/io/infinitic/common/transport/consumers/StartConsumingTests.kt b/infinitic-common/src/test/kotlin/io/infinitic/common/transport/consumers/StartConsumingTests.kt index 741716072..59f4a9d23 100644 --- a/infinitic-common/src/test/kotlin/io/infinitic/common/transport/consumers/StartConsumingTests.kt +++ b/infinitic-common/src/test/kotlin/io/infinitic/common/transport/consumers/StartConsumingTests.kt @@ -67,11 +67,16 @@ internal class StartConsumingTests : StringSpec( val channel = with(scope) { ErrorConsumer().startConsuming() } // while no error - shouldNotThrowAny { repeat(99) { channel.receive() } } + shouldNotThrowAny { repeat(98) { channel.receive() } } scope.isActive shouldBe true // channel should be close to receive and scope should be canceled - shouldThrow { channel.receive() } + shouldThrow { + // note: the exception is thrown at the 99th receive, + // when the consumer loads an additional item + channel.receive() + channel.receive() + } scope.isActive shouldBe false } } diff --git a/infinitic-common/src/test/resources/simplelogger.properties b/infinitic-common/src/test/resources/simplelogger.properties index 8298b6222..255d57f87 100644 --- a/infinitic-common/src/test/resources/simplelogger.properties +++ b/infinitic-common/src/test/resources/simplelogger.properties @@ -5,14 +5,14 @@ # Default logging detail level for all instances of SimpleLogger. # Must be one of ("trace", "debug", "info", "warn", or "error"). # If not specified, defaults to "info". -org.slf4j.simpleLogger.defaultLogLevel=trace +org.slf4j.simpleLogger.defaultLogLevel=warn # Logging detail level for a SimpleLogger instance named "xxxxx". # Must be one of ("trace", "debug", "info", "warn", or "error"). # If not specified, the default logging detail level is used. -org.slf4j.simpleLogger.log.io.infinitic.clients.InfiniticClient=debug -org.slf4j.simpleLogger.log.io.infinitic.workers.InfiniticWorker=debug +org.slf4j.simpleLogger.log.io.infinitic.clients.InfiniticClient=info +org.slf4j.simpleLogger.log.io.infinitic.workers.InfiniticWorker=info org.slf4j.simpleLogger.log.io.infinitic.workflows.tag.WorkflowTagEngine=info -org.slf4j.simpleLogger.log.io.infinitic.workflows.engine.WorkflowStateEngine=debug +org.slf4j.simpleLogger.log.io.infinitic.workflows.engine.WorkflowStateEngine=info org.slf4j.simpleLogger.log.io.infinitic.workflows.engine.WorkflowStateCmdHandler=info org.slf4j.simpleLogger.log.io.infinitic.workflows.engine.WorkflowStateEventHandler=info org.slf4j.simpleLogger.log.io.infinitic.workflows.engine.WorkflowStateTimerHandler=info diff --git a/infinitic-transport-inMemory/src/test/resources/simplelogger.properties b/infinitic-transport-inMemory/src/test/resources/simplelogger.properties index 61abd000d..8408c305b 100644 --- a/infinitic-transport-inMemory/src/test/resources/simplelogger.properties +++ b/infinitic-transport-inMemory/src/test/resources/simplelogger.properties @@ -5,7 +5,7 @@ # Default logging detail level for all instances of SimpleLogger. # Must be one of ("trace", "debug", "info", "warn", or "error"). # If not specified, defaults to "info". -org.slf4j.simpleLogger.defaultLogLevel=info +org.slf4j.simpleLogger.defaultLogLevel=warn # Set to true if you want the current date and time to be included in output messages. # Default is false, and will output the number of milliseconds elapsed since startup. org.slf4j.simpleLogger.showDateTime=true diff --git a/infinitic-worker/src/test/resources/simplelogger.properties b/infinitic-worker/src/test/resources/simplelogger.properties index fe3fd44f4..8858a8cc1 100644 --- a/infinitic-worker/src/test/resources/simplelogger.properties +++ b/infinitic-worker/src/test/resources/simplelogger.properties @@ -5,7 +5,7 @@ # Default logging detail level for all instances of SimpleLogger. # Must be one of ("trace", "debug", "info", "warn", or "error"). # If not specified, defaults to "info". -org.slf4j.simpleLogger.defaultLogLevel=info +org.slf4j.simpleLogger.defaultLogLevel=warn # Logging detail level for a SimpleLogger instance named "xxxxx". # Must be one of ("trace", "debug", "info", "warn", or "error"). # If not specified, the default logging detail level is used.