From 210553e089d8b64e2ea8b8c05d07242d967f487a Mon Sep 17 00:00:00 2001 From: Moti Asayag Date: Thu, 15 Feb 2024 15:11:41 +0200 Subject: [PATCH] Add property to ensure Data Index readiness By adding a property kogito.events.processdefinitions.errors.propagate to the workflow's managed properties, the workflow will be restarted if failed to communicate with the Data Index. Signed-off-by: Moti Asayag --- controllers/platform/services/properties.go | 1 + .../common/constants/platform_services.go | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/controllers/platform/services/properties.go b/controllers/platform/services/properties.go index c541f5b04..a8ed9a144 100644 --- a/controllers/platform/services/properties.go +++ b/controllers/platform/services/properties.go @@ -165,6 +165,7 @@ func GenerateDataIndexWorkflowProperties(workflow *operatorapi.SonataFlow, platf di := NewDataIndexHandler(platform) if workflow != nil && !profiles.IsDevProfile(workflow) && di.IsServiceEnabled() { props.Set(constants.KogitoProcessDefinitionsEventsEnabled, "true") + props.Set(constants.KogitoProcessDefinitionsErrorsPropagated, "true") props.Set(constants.KogitoProcessInstancesEventsEnabled, "true") props.Set(constants.KogitoDataIndexHealthCheckEnabled, "true") di := NewDataIndexHandler(platform) diff --git a/controllers/profiles/common/constants/platform_services.go b/controllers/profiles/common/constants/platform_services.go index e0f249273..8134cf4fb 100644 --- a/controllers/profiles/common/constants/platform_services.go +++ b/controllers/profiles/common/constants/platform_services.go @@ -34,14 +34,15 @@ const ( JobServiceDataSourceReactiveURL = "quarkus.datasource.reactive.url" JobServiceJobEventsPath = "/v2/jobs/events" - KogitoProcessEventsProtocol = "http" - KogitoProcessInstancesEventsURL = "mp.messaging.outgoing.kogito-processinstances-events.url" - KogitoProcessInstancesEventsEnabled = "kogito.events.processinstances.enabled" - KogitoProcessInstancesEventsPath = "/processes" - KogitoProcessDefinitionsEventsURL = "mp.messaging.outgoing.kogito-processdefinitions-events.url" - KogitoProcessDefinitionsEventsEnabled = "kogito.events.processdefinitions.enabled" - KogitoProcessDefinitionsEventsPath = "/definitions" - KogitoUserTasksEventsEnabled = "kogito.events.usertasks.enabled" + KogitoProcessEventsProtocol = "http" + KogitoProcessInstancesEventsURL = "mp.messaging.outgoing.kogito-processinstances-events.url" + KogitoProcessInstancesEventsEnabled = "kogito.events.processinstances.enabled" + KogitoProcessInstancesEventsPath = "/processes" + KogitoProcessDefinitionsEventsURL = "mp.messaging.outgoing.kogito-processdefinitions-events.url" + KogitoProcessDefinitionsEventsEnabled = "kogito.events.processdefinitions.enabled" + KogitoProcessDefinitionsErrorsPropagated = "kogito.events.processdefinitions.errors.propagate" + KogitoProcessDefinitionsEventsPath = "/definitions" + KogitoUserTasksEventsEnabled = "kogito.events.usertasks.enabled" // KogitoDataIndexHealthCheckEnabled configures if a workflow must check for the data index availability as part // of its start health check. KogitoDataIndexHealthCheckEnabled = "kogito.data-index.health-enabled"