-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PublishEvent option failed to set keys TTL #385
Comments
For those components that don't have built-in ttl support, dapr will handle it in runtime. This means dapr will check the TTL and ignore these expired messages. |
@Taction Thx for your reply |
For your situation, you can set |
Try modifying ttlInseconds to ttlInSeconds |
I have the same problem with C# client, when using pubsub with Redis streams: var metadata = new Dictionary<string, string>
but when I'm using state store with Redis it works well: await _daprClient.SaveStateAsync("statestore", "test", 1, metadata: metadata); |
Describe the bug
In use the PublishEvent function , I set the PublishEventOption :
client.PublishEventWithMetadata(map[string]string{"ttlInseconds":"3600"})
But when I check redis :
127.0.0.1:6379> TTL Stop
(integer) -1
clearly failed to set ttl , the value is -1 , but key store success.
And I don't see anything ttl unit test in client/pubsub_test.go
To Reproduce
redis docker version 6.2.5
go version 1.19
github.com/dapr/dapr v1.10.4
github.com/dapr/go-sdk v1.7.0
Hear's full codes:
if err := d.daprClient.PublishEvent(ctx, "redis-pubsub", master.MethodType_Stop.String(), param, client.PublishEventWithMetadata(map[string]string{"ttlInseconds": "3600"})); err != nil { return err }
Expected behavior
The text was updated successfully, but these errors were encountered: