adjust / rmq

Message queue system written in Go and backed by Redis
MIT License
1.57k stars 206 forks source link

Getting rmq fails: wrapper.rawClient.FlushDb undefined #71

Closed rverton closed 4 years ago

rverton commented 5 years ago

Hi, I am running Go 1.13.1 here (go version go1.13.1 darwin/amd64). When getting/downloading rmq, I get an error that wrapper.rawClient.FlushDb is not defined. I guess it's because something in the redis lib changed.

$ go get github.com/adjust/rmq
# github.com/adjust/rmq
/Users/robin/go/src/github.com/adjust/rmq/redis_wrapper.go:85:19: wrapper.rawClient.FlushDb undefined (type *redis.Client has no field or method FlushDb)

If there is anything else you need from me, just let me know.

Thanks, Robin

wellle commented 5 years ago

Thanks for reporting!

Looks like they renamed the function from FlushDb to FlushDB in https://github.com/go-redis/redis/commit/f1ed2ad288902494728179ad178e4c7925ba4aee.

We'll look into fixing this here 👍

wellle commented 5 years ago

@rverton: So actually the issue is a bit different. rmq still uses https://github.com/golang/dep, and in our https://github.com/adjust/rmq/blob/master/Gopkg.toml file we declare that rmq expects go-redis version 6.9.2.

You seem to be using go-redis master, which contains the breaking change mentioned above. We will probably add go module support for rmq later #67.

For now I'd suggest you try using go-redis version 6.9.2 and then rmq should work.

Please let me know if that works for you. Thanks!

toni-moreno commented 4 years ago

Hello, Here the same error. first. @wellle , and after doing git checkout 6.9.2 to the go-redis lib this happens when trying to run the producer.go example

vant@mypc:~/$ go run main.go 
2020/03/07 08:29:59 rmq redis error is not nil redis: can't marshal []string (consider implementing encoding.BinaryMarshaler)
panic: rmq redis error is not nil redis: can't marshal []string (consider implementing encoding.BinaryMarshaler)

goroutine 1 [running]:
log.Panicf(0x687fd8, 0x1d, 0xc0000d1dd8, 0x1, 0x1)
    /usr/local/go/src/log/log.go:345 +0xc0
github.com/adjust/rmq.checkErr(...)
    /home/vant/go/src/github.com/adjust/rmq/redis_wrapper.go:96
github.com/adjust/rmq.RedisWrapper.LPush(0xc0000b00f0, 0xc0000fe020, 0x1b, 0xc000012020, 0x1, 0x1, 0xc000012020)
    /home/vant/go/src/github.com/adjust/rmq/redis_wrapper.go:37 +0x15e
github.com/adjust/rmq.(*redisQueue).Publish(0xc000100000, 0xc000012020, 0x1, 0x1, 0x1)
    /home/vant/go/src/github.com/adjust/rmq/queue.go:97 +0x6a
main.main()
    /home/vant/proyectos/tokio/task_queue_poc/rmq/example/producer/main.go:24 +0x228
exit status 2

There is any way to fix this error?

fmd97 commented 4 years ago

same error

wellle commented 4 years ago

@toni-moreno @fmd97: I just merged #76 (thanks to @hishamkaram!). Can you try again? Thanks!

fmd97 commented 4 years ago

@wellle everything is fine now, thanks !

wellle commented 4 years ago

Thanks for checking, I'll close the issue 👍