Does the specific position in the stack matter? I tried this in a plugin.rb and it seemed to add the middleware
class BreakEverythingMiddleware
def call(worker, job, queue)
puts "The middleware worked!"
raise "THE MIDDLEWARE WORKED"
end
end
Sidekiq.default_configuration.server_middleware { |chain| chain.add BreakEverythingMiddleware }