From 75b09a70aead3cbc2cc6d2705389b6d1fc490026 Mon Sep 17 00:00:00 2001 From: Nico Korthout Date: Tue, 22 Aug 2023 15:35:44 +0200 Subject: [PATCH] fix: publish message with 1h ttl Messages were published with a TTL of 5 minutes, which means the engine buffers them for 5 minutes. The buffered message is then expected to correlate to a process instance's event later in the chaos experiment. However, in some cases, the chaos experiment takes longer than these 5 minutes. When the message is expired, the chaos experiment can no longer succeed even though it retries for an hour. For example, this occurred in the action: - Should be able to create a process instance and await the message correlation Changing the TTL of the published message fixes this problem by buffering the message for the same duration as the retry period. --- go-chaos/cmd/publish.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go-chaos/cmd/publish.go b/go-chaos/cmd/publish.go index 45ebb1dd1..c072c21ae 100644 --- a/go-chaos/cmd/publish.go +++ b/go-chaos/cmd/publish.go @@ -48,7 +48,7 @@ func AddPublishCmd(rootCmd *cobra.Command, flags *Flags) { internal.LogVerbose("Send message '%s', with correaltion key '%s' (ASCII: %d) ", flags.msgName, correlationKey, int(correlationKey[0])) - messageResponse, err := zbClient.NewPublishMessageCommand().MessageName(flags.msgName).CorrelationKey(correlationKey).TimeToLive(time.Minute * 5).Send(context.TODO()) + messageResponse, err := zbClient.NewPublishMessageCommand().MessageName(flags.msgName).CorrelationKey(correlationKey).TimeToLive(time.Hour * 1).Send(context.TODO()) partitionIdFromKey := internal.ExtractPartitionIdFromKey(messageResponse.Key) internal.LogInfo("Message was sent and returned key %d, which corresponds to partition: %d", messageResponse.Key, partitionIdFromKey)