From 58dbcf92ad91d1f5c2f7f4dfb112f5436b5696c8 Mon Sep 17 00:00:00 2001 From: Bernd Verst Date: Thu, 11 May 2023 16:43:56 -0500 Subject: [PATCH] Makes Redis7 (v9 client) match the Redis6 (v8 client) behavior (#2833) Signed-off-by: Bernd Verst --- bindings/redis/metadata.yaml | 5 ----- internal/component/redis/settings.go | 2 +- internal/component/redis/v9client.go | 1 + 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/bindings/redis/metadata.yaml b/bindings/redis/metadata.yaml index 0ee629624..fd20b1191 100644 --- a/bindings/redis/metadata.yaml +++ b/bindings/redis/metadata.yaml @@ -79,11 +79,6 @@ metadata: "-1" disables backoff. example: "-1" default: "512ms" - - name: maxLenApprox - required: false - type: number - description: | - The approximate maximum length of a stream. - name: failover type: bool required: false diff --git a/internal/component/redis/settings.go b/internal/component/redis/settings.go index 7b761ed78..f71afff8e 100644 --- a/internal/component/redis/settings.go +++ b/internal/component/redis/settings.go @@ -95,7 +95,7 @@ type Settings struct { Concurrency uint `mapstructure:"concurrency" only:"pubsub"` // the max len of stream - MaxLenApprox int64 `mapstructure:"maxLenApprox" only:"bindings"` + MaxLenApprox int64 `mapstructure:"maxLenApprox" only:"pubsub"` } func (s *Settings) Decode(in interface{}) error { diff --git a/internal/component/redis/v9client.go b/internal/component/redis/v9client.go index 3a6a65da2..145e9ea0f 100644 --- a/internal/component/redis/v9client.go +++ b/internal/component/redis/v9client.go @@ -176,6 +176,7 @@ func (c v9Client) XAdd(ctx context.Context, stream string, maxLenApprox int64, v Stream: stream, Values: values, MaxLen: maxLenApprox, + Approx: true, }).Result() }