Sha256: bacd77bdf8215056806e88e5057ee7bac08f833c14243533c19d4c37ae1031b5
Contents?: true
Size: 1.42 KB
Versions: 8
Compression:
Stored size: 1.42 KB
Contents
# frozen_string_literal: true module Karafka module Routing module Features class ActiveJob < Base # Rules around using ActiveJob routing - basically you need to have ActiveJob available # in order to be able to use active job routing class Contract < Contracts::Base configure do |config| config.error_messages = YAML.safe_load( File.read( File.join(Karafka.gem_root, 'config', 'errors.yml') ) ).fetch('en').fetch('validations').fetch('topic') end virtual do |data, errors| next unless errors.empty? next unless data[:active_job][:active] # One should not define active job jobs without ActiveJob being available for usage next if Object.const_defined?('ActiveJob::Base') [[%i[consumer], :active_job_missing]] end # ActiveJob needs to always run with manual offset management # Automatic offset management cannot work with ActiveJob. Otherwise we could mark as # consumed jobs that did not run because of shutdown. virtual do |data, errors| next unless errors.empty? next unless data[:active_job][:active] next if data[:manual_offset_management][:active] [[%i[manual_offset_management], :must_be_enabled]] end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems