I have a sidekiq installation in ruby running, and I would like to enqueue jobs from a Scala / Java system. How can I do this? Here is my worker:
class MyWorker
include Sidekiq::Worker
def perform(param)
puts "processing #{param}"
# ...
end
end
I tried to use jesque, but it is not working. Here is the jesque code I am trying to use:
val config = new ConfigBuilder().build();
val job = new Job("MyWorker", Array("my param"))
val client = new ClientImpl(config);
client.enqueue("default", job);
client.end();
Make sure you are using the same namespace in both ruby and java:
To configure namespace in Jesque, use:
val config = new ConfigBuilder().withNamespace("you_namespace").build()
To configure namespace in ruby, create sidekiq.rb inside config/inititalizers
dir:
Sidekiq.configure_client do |config|
config.redis = { :namespace => 'you_namespace' }
end