0

The package I use to generate the connection and read the messages is: "github.com/go-redis/redis"

I am trying to declare not to use NOACK when I read events from a group in golang, but when a new event arrives, it leaves this new event as if it had NOACK.

entries, err := redisClient.XReadGroup(&redis.XReadGroupArgs{
    Group:    consumerGroup,
    Consumer: uniqueID,
    Streams: []string{streamSubject, ">"},
    Count:   2,
    Block:   0,
    NoAck:   false,
}).Result()

In this part, I declare how I am reading the messages and declare that I do not use ack.

After that, I send a message from redis-cli

127.0.0.1:6379[1]> XADD charge * taco great
1627519110415

I get from my Golang script

DEBU[0051] Handling new data: {charge [{1627519767943-0 map[taco:great]}]} 

then valid if the message is still in process but appears to be missing.

127.0.0.1:6379[1]> XREADGROUP GROUP group-test bob STREAMS charge 0
1) 1) "charge"
   2) (empty array)
  • if you dont need to ACK `NoAck: true`. I belive the message you list at the end is in the pending list. https://redis.io/commands/xpending can you give it a check ? –  Jul 29 '21 at 06:49
  • see how they consume the noack option at https://github.com/go-redis/redis/blob/7dad93efa2f8ec5a30841aad3eb09e6ec862a918/commands.go#L1864 Also read the doc at https://redis.io/commands/XREADGROUP#:~:text=The%20NOACK%20subcommand –  Jul 29 '21 at 07:04
  • You are right, I was confusing terms. – Andres santiago Jul 30 '21 at 17:27

0 Answers0