Open siredwin opened 5 years ago
Temporary Fix! I just checked out version 1.5.5 and it works. Something is wrong with the Mongo Fixes!
@siredwin Can you try defining the database in mongodb config: https://github.com/RichardKnop/machinery/blob/master/v1/config/config.go#L63
Instead in the connection string? I think the new mongodb driver works differently compared to old mgo driver (not maintained anymore). It might also be required to define username/password in connection string.
It would be better to use latest version if you can make it work.
I will probably use the old version to finish this update, then look in to the new official mongo version.
Sounds good, if you also want to contribute to mongodb backend in the codebase, feel free. It could use some improvements. @siredwin
I realized that the config was not done for the new version. But the old connection string still works on the new version(not sure if the database needs to be separate, or can be parsed). So it should not be hard to implement it. You should probably leave the old mongo in there and add a new backend for the official mongo, then phase it out when fully implemented.
I have the correct settings from yml. The server even starts with the following message:
GOROOT=/usr/local/go GOPATH=/home/edwin/IdeaProjects/gowork:/usr/local/go/src /usr/local/go/bin/go build -o /tmp/APIgo github.com/siredwin/zipperapi INFO: 2019/05/30 15:22:32 file.go:19 Successfully loaded config from file config.yml INFO: 2019/05/30 15:22:32 worker.go:46 Launching a worker with the following settings: INFO: 2019/05/30 15:22:32 worker.go:47 - Broker: amqp://guest:guest@localhost:5672 INFO: 2019/05/30 15:22:32 worker.go:49 - DefaultQueue: machinery_tasks INFO: 2019/05/30 15:22:32 worker.go:53 - ResultBackend: mongodb://localhost:27017/taskresults INFO: 2019/05/30 15:22:32 worker.go:55 - AMQP: machinery_exchange INFO: 2019/05/30 15:22:32 worker.go:56 - Exchange: machinery_exchange INFO: 2019/05/30 15:22:32 worker.go:57 - ExchangeType: direct INFO: 2019/05/30 15:22:32 worker.go:58 - BindingKey: machinery_task INFO: 2019/05/30 15:22:32 worker.go:59 - PrefetchCount: 30 INFO: 2019/05/30 15:22:32 amqp.go:95 [*] Waiting for messages. To exit press CTRL+C
What is going on? Redis seems to work fine from the same YML. The mongo examples seem to work just fine.