reugn / go-streams

A lightweight stream processing library for Go

Home Page:https://pkg.go.dev/github.com/reugn/go-streams

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Two questions about redis stream

jeven2016 opened this issue · comments

commented

Hi, developer,

So glad the redis stream is supported right now and I appreciate your effort very much.
This morning I read your code and try to figure out how to refactor my code, but I'm still confused about the following questions.
Could you can take a look when you are free?

  1. why no ack message sent after the message is transferred into the internal chan?
  2. how to avoid the messages in the internal chan of Source/Sink being discarded? Say the internal chan of RedisSource/RedisSink still has many messages that hadn't been consumed, but the program unfortunately needs to exit , how to handle such scenario?

Thanks again

The NewStreamSource constructor has a *redis.XReadGroupArgs parameter. It contains the NoAck field that specifies the NOACK subcommand of the Redis XREADGROUP command. Set this value to true to add a NOACK argument and acknowledge messages later in the pipeline using redisClient.XAck.