Questions tagged [go-redis]

59 questions
1
vote
0 answers

How to fix the issue of multiple go threads along with multiple redis connections?

My application serves a large number of domains. Some domains have unexpectedly high traffic sometimes. To handle their traffic on Backend (microservices architecture built in Golang), I setup Redis Rate Limiter along with the cache in the gateway…
KhiladiBhaiyya
  • 633
  • 1
  • 14
  • 43
1
vote
0 answers

Setting value in redis does not work - stuck on instruction

I want to implement a simple code, to save and retrieve some data from a local redis database running in docker. My code to get and set the data is: package main import ( "context" "fmt" "time" _ "github.com/lib/pq" …
1
vote
0 answers

Redis is not showing as a dependency in Elastic apm

I am using Elastic apm to monitor my go application.I use gorilla mux framework and redis db.I have integrated elastic apm with my code but I am not sure how to add redis as a dependency in elastic apm.Can someone help me with this please? I have…
1
vote
0 answers

Go redis ForEachMaster with scan cursor is not returning all the keys

I have a scenario where I have to read x number of keys (10000 in my case) from redis, process it before retrieving the next batch and I have to do this for each master node. I am using a sync.Map cursor with client as key and cursor as value to…
1
vote
1 answer

How to use ZAddArgs in Go

I am using https://github.com/redis/go-redis/ package. I am trying to use GT option of zadd. I found a unit test in commands_test.go that uses ZAddArgs method to use the GT option: // Test only the GT+LT options. added, err := client.ZAddArgs(ctx,…
Problem Solver
  • 385
  • 1
  • 4
  • 11
1
vote
0 answers

ReadTimeout value used in the FailoverOptions for redis.NewFailoverClient to connect to a redis sentinel doesn't seem to have an effect. Why?

Expected Behavior If the read operation is taking more time than the ReadTimeout value, it should return an error. Current Behavior ReadTimeout exceeds, but no error is returned. Steps to Reproduce Connect to a redis sentinel with a ReadTimeout…
1
vote
1 answer

go-redis HGETALL protobuf message

Hi has anyone tried storing redis hash as proto marshalled and unmarshall and retrieve in struct? I am facing issue in that. Doing below but not able to get desired result defining an interface Execution HGETALL and trying to get result in above…
1
vote
1 answer

go-redis maxRetries doesn't work with redis pipeline

I am trying to use maxRetries option of go-redis client. package main import ( "context" "fmt" "log" "time" "github.com/go-redis/redis/v8" ) func main() { db := redis.NewUniversalClient(&redis.UniversalOptions{ …
wonder
  • 885
  • 1
  • 18
  • 32
1
vote
0 answers

Go-Redis | Redis Pipeline: Empty Pipeline Object and No Values on running pipeline.Exec()

queueConfig := config.GetConfig().Queue address := net.JoinHostPort(queueConfig.Redis.Host, queueConfig.Redis.Port) provider.redis = redis.NewClient(&redis.Options{ Addr: address, Password: queueConfig.Redis.Password, }) client :=…
HellHammer
  • 115
  • 1
  • 9
1
vote
0 answers

xread using go-redis in sentinel is failing

We are using github.com/go-redis/redis/v8 to read from Redis streams. Redis server is managed by a sentinel and the client is built as follows: client := redis.NewFailoverClient(&redis.FailoverOptions{ MasterName: …
1
vote
0 answers

Better approach for Redis Client with multiple subscriber

I am new to golang. Trying to to use redis channel subscription for multiple subscribers. I am using below code in main(). Just wanted to know that is it a good approach to use Redis Client for multiple subscriber. Is there any better approach? can…
ppb
  • 2,299
  • 4
  • 43
  • 75
1
vote
1 answer

After certain load of GEOADD & BRPOP, Redis/Docker responds with errors

I am using go-redis to connect to Redis server running on docker desktop while running my go app straight on my mac. This my client setup: package redis import ( "fmt" "os" "github.com/go-redis/redis/v8" ) var redisClient…
Sami Al-Subhi
  • 4,406
  • 9
  • 39
  • 66
1
vote
1 answer

Atomically Execute commands across Redis Data Structures

I want to execute some redis commands atomically (HDel, SADD, HSet etc). I see the Watch feature in the go-redis to implement transactions , however since I am not going to modify the value of a key i.e use SET,GET etc , does it make sense to use…
user3679686
  • 516
  • 1
  • 6
  • 20
1
vote
0 answers

Unable to connect to redis master with tls from go app using go-redis pkg

For the past two weeks I am trying to set up (locally) redis and my go microservice to communicate using TLS. I use docker compose to up all of the needed containers - redis master, redis slave, redis sentinel and go application that uses go-redis…
dimitar.d
  • 645
  • 1
  • 6
  • 18
1
vote
0 answers

Golang elasticache cleint to Redis client

I am creating an elasticache client using below snippet import( "github.com/aws/aws-sdk-go/service/elasticache" "github.com/go-redis/redis" ) // Create a ElastiCache client from just a session. s, err := session.NewSession(&aws.Config{Region:…