Adding a task events processing microservice
In the previous section, we produced events regarding our Task Manager application. This enables us to add an application that shall be message-driven. For now, the events
service will consume the data from a Redis stream and print data on the console.
Our code base will be lean and require only the Redis client.
Let’s add the code that will consume the events:
[...] client. XGroupCreateMkStream (ctx, stream, consumerGroup, "0").Result() for { entries, err := client.XReadGroup(ctx, &redis.XReadGroupArgs{ Group: consumerGroup, Consumer: consumer, Streams: []string{stream, ">"}, Count: 1, Block: 0, NoAck: false, }, ).Result() for i := 0; i < len(entries[0].Messages); i++ { messageID := entries[0].Messages[i].ID values := entries[0].Messages[i].Values taskId...