From 86c2c1b5f904965aca99faca4fcf81f505148f8b Mon Sep 17 00:00:00 2001 From: Dries Samyn Date: Fri, 29 Sep 2023 09:03:38 +0100 Subject: [PATCH 1/2] Create new topic for flow processor scheduled tasks. --- .../src/main/java/net/corda/schema/Schemas.java | 4 ++++ .../src/main/resources/net/corda/schema/ScheduledTask.yaml | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/data/topic-schema/src/main/java/net/corda/schema/Schemas.java b/data/topic-schema/src/main/java/net/corda/schema/Schemas.java index 33d6590895..22405ac75c 100644 --- a/data/topic-schema/src/main/java/net/corda/schema/Schemas.java +++ b/data/topic-schema/src/main/java/net/corda/schema/Schemas.java @@ -268,6 +268,10 @@ public static final class ScheduledTask { private ScheduledTask() {} public static final String SCHEDULED_TASK_DB_PROCESSOR = "scheduled.task.db.processor"; + public static final String SCHEDULED_TASK_NAME_DB_PROCESSOR = "deduplication-table-clean-up-task"; public static final String SCHEDULED_TASK_MAPPER_PROCESSOR = "scheduled.task.mapper.processor"; + public static final String SCHEDULED_TASK_TOPIC_FLOW_PROCESSOR = "scheduled.task.flow.processor"; + public static final String SCHEDULED_TASK_NAME_SESSION_TIMEOUT = "flow-session-timout"; + } } diff --git a/data/topic-schema/src/main/resources/net/corda/schema/ScheduledTask.yaml b/data/topic-schema/src/main/resources/net/corda/schema/ScheduledTask.yaml index fa45e6401c..7a095d9faa 100644 --- a/data/topic-schema/src/main/resources/net/corda/schema/ScheduledTask.yaml +++ b/data/topic-schema/src/main/resources/net/corda/schema/ScheduledTask.yaml @@ -11,3 +11,9 @@ topics: - flowMapper producers: - db + ScheduledTaskFlowProcessorTopic: + name: scheduled.task.flow.processor + consumers: + - flow + producers: + - db From 91217f0fb363320cce6a330ba77073c952adec20 Mon Sep 17 00:00:00 2001 From: Dries Samyn Date: Fri, 29 Sep 2023 09:57:58 +0100 Subject: [PATCH 2/2] Fix Unit test --- data/topic-schema/src/main/java/net/corda/schema/Schemas.java | 2 ++ .../src/test/kotlin/net/corda/schema/SchemaTests.kt | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/data/topic-schema/src/main/java/net/corda/schema/Schemas.java b/data/topic-schema/src/main/java/net/corda/schema/Schemas.java index 22405ac75c..bf3608479d 100644 --- a/data/topic-schema/src/main/java/net/corda/schema/Schemas.java +++ b/data/topic-schema/src/main/java/net/corda/schema/Schemas.java @@ -267,7 +267,9 @@ private VirtualNode() { public static final class ScheduledTask { private ScheduledTask() {} + // TODO - duplicated to ease migration from first to second. First can be removed once integrated with runtime-os public static final String SCHEDULED_TASK_DB_PROCESSOR = "scheduled.task.db.processor"; + public static final String SCHEDULED_TASK_TOPIC_DB_PROCESSOR = "scheduled.task.db.processor"; public static final String SCHEDULED_TASK_NAME_DB_PROCESSOR = "deduplication-table-clean-up-task"; public static final String SCHEDULED_TASK_MAPPER_PROCESSOR = "scheduled.task.mapper.processor"; public static final String SCHEDULED_TASK_TOPIC_FLOW_PROCESSOR = "scheduled.task.flow.processor"; diff --git a/data/topic-schema/src/test/kotlin/net/corda/schema/SchemaTests.kt b/data/topic-schema/src/test/kotlin/net/corda/schema/SchemaTests.kt index 2cc3a013fc..01b32f108a 100644 --- a/data/topic-schema/src/test/kotlin/net/corda/schema/SchemaTests.kt +++ b/data/topic-schema/src/test/kotlin/net/corda/schema/SchemaTests.kt @@ -75,9 +75,9 @@ class SchemaTests { yamlFileData.forEach { (fileName: String, topics: Map>) -> println("Testing: $fileName") val potentialClass = fileName.substringBeforeLast(".") - val yamlTopicNames = topics["topics"]!!.toMap().map { it.value["name"] } + val yamlTopicNames = topics["topics"]!!.toMap().map { it.value["name"].toString() } val kotlinTopicNames = memberMap[potentialClass] - assertThat(yamlTopicNames).containsExactlyInAnyOrderElementsOf(kotlinTopicNames) + assertThat(kotlinTopicNames).containsAll(yamlTopicNames) } } }