Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is node-resque really compatible with Sidekiq? #311

Closed
pacop opened this issue Dec 14, 2019 · 5 comments
Closed

Is node-resque really compatible with Sidekiq? #311

pacop opened this issue Dec 14, 2019 · 5 comments

Comments

@pacop
Copy link

pacop commented Dec 14, 2019

Hi, just considering using node-resque combined with sidekiq. I am having some problems with the integration, so I am leaving my feedback here:

  • Workers started from node-resque do not show in Sidekiq web. Sidekiq when starting new workers add the name of the worker to the set processes, node-resque doesn't seem like it does. https://github.com/mperham/sidekiq/blob/4deadba37200bf7812109a2d6de2371727b2ee3f/lib/sidekiq/launcher.rb#L133
  • Adding new jobs from node-resque to Sidekiq works fine.
  • Stats shown in Sidekiq Web are correctly updated, both failed and processed jobs.
  • Scheduled jobs from node-resque are not shown in Sidekiq web (Scheduled tab).
  • Scheduled jobs from node-resque requires a worker from node-resque. I add a scheduled job from node-resque using enqueueIn, scheduler is also run in this same process. Sidekiq worker is started and ready to run jobs all the time. After the delay time, nothing happens. To be able to run this job, a worker from node-request must be started.

Please, it would be highly appreciated to document all these caveats (and some others that may exist) in the README for future developers. I don't think that with current features, and caveats between sidekiq and node-resque should be stated that node-resque is API compatible with Sidekiq because it does not.

Node version: 12.2.0
Ruby version: 2.5.0
Sidekiq Version: 6.0.3. I also checked older versions just in case some fully works.
Node-resque version: 6.0.6

@evantahler
Copy link
Member

Hi @pacop!

Thank you for running these checks! It's been a few years since I checked against the ruby versions. We also targeted ruby's resque directly, and at the time, sidekiq advertised compatibility with resque. It makes sense that the normal queues & stats more-or-less work but the trouble lies with the delayed jobs, as the resque-scheduler was never brought into resque's core... so I bet there has been some divergence.

To help with compatibility, if you want to update node-resque's data structures to match Sidekiq, that would be a big help!

@evantahler
Copy link
Member

I've added a note to the readme linking here about the Sidekiq caveats being discussed 39fb6e2

@bleonard
Copy link
Member

TaskRabbit used (and continues to use) node-resque before, during, and after the transition of Ruby apps to Sidekiq, so I feel pretty good about it.

@dorthwein
Copy link

dorthwein commented Jan 8, 2021

I'm having trouble enqueing a sidekiq job from node-resque - is it simlpy a matter of calling await queue.enqueue(que, job, args); and setting the correct que and job? Thanks

UPDATE: So by default sidekiq does not have a name space - if you want to schedule from node-resque to sidekiq besure to pass an empty string to your connection namespace. Example below.

 const queue = new Queue(
    {
      connection: {
        pkg: "ioredis",
        host: "127.0.0.1",
        password: null,
        port: 6379,
        database: 0,
        namespace: "",
        // looping: true,
        // options: {password: 'abc'},
      },
    },
    { ...Jobs }
  );

@evantahler
Copy link
Member

evantahler commented Jan 8, 2021

Thanks for the research @dorthwein! This issue is linked from the Readme, so hopefully this helps others in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants