Reputation: 1556
My rails app has a lot of different kind of jobs which I currently submit to redis through resque. To better manage it I was thinking of running two redis servers and submitting one category of jobs to server1 while other to server2. Can anyone suggest how to use resque in rails to submit jobs of Type1 to Redis1 while Type2 jobs to Redis2 ?
Upvotes: 1
Views: 157
Reputation: 1010
Of course you can use different redis db file for different jobs by using different redis url when open connection, like this:
Resque.redis = Redis.connect(url:'redis://localhost:6379/1') #connect to db1
Resque.redis = Redis.connect(url:'redis://localhost:6379/2') #connect to db2
But I don't think it's a good practice on this case. You should consider Sidekiq and set up different queues to process different types of jobs. You can check sidekiq's options on how to set up different queue names. Then you can easily track those jobs with sidekiq's web interface.
Upvotes: 1