Module: Karafka

Defined in:
lib/karafka.rb,
lib/karafka/app.rb,
lib/karafka/cli.rb,
lib/karafka/env.rb,
lib/karafka/pro.rb,
lib/karafka/admin.rb,
lib/karafka/swarm.rb,
lib/karafka/errors.rb,
lib/karafka/runner.rb,
lib/karafka/server.rb,
lib/karafka/status.rb,
lib/karafka/process.rb,
lib/karafka/railtie.rb,
lib/karafka/railtie.rb,
lib/karafka/version.rb,
lib/karafka/cli/base.rb,
lib/karafka/cli/help.rb,
lib/karafka/cli/info.rb,
lib/karafka/embedded.rb,
lib/karafka/licenser.rb,
lib/karafka/admin/acl.rb,
lib/karafka/cli/swarm.rb,
lib/karafka/contracts.rb,
lib/karafka/setup/dsl.rb,
lib/karafka/cli/server.rb,
lib/karafka/cli/topics.rb,
lib/karafka/pro/loader.rb,
lib/karafka/swarm/node.rb,
lib/karafka/cli/console.rb,
lib/karafka/cli/install.rb,
lib/karafka/constraints.rb,
lib/karafka/pro/cleaner.rb,
lib/karafka/swarm/pidfd.rb,
lib/karafka/pro/iterator.rb,
lib/karafka/setup/config.rb,
lib/karafka/admin/configs.rb,
lib/karafka/base_consumer.rb,
lib/karafka/helpers/async.rb,
lib/karafka/messages/seek.rb,
lib/karafka/routing/proxy.rb,
lib/karafka/routing/topic.rb,
lib/karafka/swarm/manager.rb,
lib/karafka/contracts/base.rb,
lib/karafka/pro/encryption.rb,
lib/karafka/routing/router.rb,
lib/karafka/routing/topics.rb,
lib/karafka/cli/topics/base.rb,
lib/karafka/cli/topics/plan.rb,
lib/karafka/contracts/topic.rb,
lib/karafka/messages/parser.rb,
lib/karafka/routing/builder.rb,
lib/karafka/cli/topics/align.rb,
lib/karafka/cli/topics/reset.rb,
lib/karafka/connection/proxy.rb,
lib/karafka/contracts/config.rb,
lib/karafka/helpers/colorize.rb,
lib/karafka/messages/message.rb,
lib/karafka/swarm/supervisor.rb,
lib/karafka/cli/topics/create.rb,
lib/karafka/cli/topics/delete.rb,
lib/karafka/connection/client.rb,
lib/karafka/connection/status.rb,
lib/karafka/contracts/routing.rb,
lib/karafka/deserializers/key.rb,
lib/karafka/messages/messages.rb,
lib/karafka/messages/metadata.rb,
lib/karafka/pro/base_consumer.rb,
lib/karafka/processing/result.rb,
lib/karafka/processing/worker.rb,
lib/karafka/cli/topics/migrate.rb,
lib/karafka/connection/manager.rb,
lib/karafka/pro/cleaner/errors.rb,
lib/karafka/pro/contracts/base.rb,
lib/karafka/time_trackers/base.rb,
lib/karafka/time_trackers/poll.rb,
lib/karafka/active_job/consumer.rb,
lib/karafka/connection/listener.rb,
lib/karafka/pro/recurring_tasks.rb,
lib/karafka/processing/executor.rb,
lib/karafka/time_trackers/pause.rb,
lib/karafka/admin/configs/config.rb,
lib/karafka/connection/conductor.rb,
lib/karafka/processing/jobs/base.rb,
lib/karafka/processing/jobs/idle.rb,
lib/karafka/setup/attributes_map.rb,
lib/karafka/active_job/dispatcher.rb,
lib/karafka/deserializers/headers.rb,
lib/karafka/deserializers/payload.rb,
lib/karafka/pro/encryption/cipher.rb,
lib/karafka/pro/encryption/errors.rb,
lib/karafka/pro/iterator/expander.rb,
lib/karafka/processing/jobs/eofed.rb,
lib/karafka/processing/jobs_queue.rb,
lib/karafka/routing/features/base.rb,
lib/karafka/admin/configs/resource.rb,
lib/karafka/cli/topics/repartition.rb,
lib/karafka/instrumentation/logger.rb,
lib/karafka/patches/rdkafka/opaque.rb,
lib/karafka/pro/connection/manager.rb,
lib/karafka/pro/scheduled_messages.rb,
lib/karafka/processing/coordinator.rb,
lib/karafka/processing/partitioner.rb,
lib/karafka/processing/timed_queue.rb,
lib/karafka/routing/consumer_group.rb,
lib/karafka/routing/features/eofed.rb,
lib/karafka/helpers/config_importer.rb,
lib/karafka/helpers/interval_runner.rb,
lib/karafka/helpers/multi_delegator.rb,
lib/karafka/instrumentation/monitor.rb,
lib/karafka/messages/batch_metadata.rb,
lib/karafka/pro/active_job/consumer.rb,
lib/karafka/pro/processing/executor.rb,
lib/karafka/processing/jobs/consume.rb,
lib/karafka/processing/jobs/revoked.rb,
lib/karafka/processing/jobs_builder.rb,
lib/karafka/setup/defaults_injector.rb,
lib/karafka/swarm/liveness_listener.rb,
lib/karafka/contracts/consumer_group.rb,
lib/karafka/patches/rdkafka/bindings.rb,
lib/karafka/pro/iterator/tpl_builder.rb,
lib/karafka/pro/processing/collapser.rb,
lib/karafka/pro/recurring_tasks/task.rb,
lib/karafka/processing/jobs/shutdown.rb,
lib/karafka/processing/workers_batch.rb,
lib/karafka/routing/activity_manager.rb,
lib/karafka/active_job/job_extensions.rb,
lib/karafka/connection/pauses_manager.rb,
lib/karafka/messages/builders/message.rb,
lib/karafka/pro/active_job/dispatcher.rb,
lib/karafka/pro/processing/jobs_queue.rb,
lib/karafka/pro/processing/strategies.rb,
lib/karafka/pro/routing/features/base.rb,
lib/karafka/processing/strategies/dlq.rb,
lib/karafka/processing/strategies/mom.rb,
lib/karafka/connection/listeners_batch.rb,
lib/karafka/connection/messages_buffer.rb,
lib/karafka/messages/builders/messages.rb,
lib/karafka/pro/processing/coordinator.rb,
lib/karafka/pro/processing/partitioner.rb,
lib/karafka/pro/recurring_tasks/errors.rb,
lib/karafka/pro/routing/features/swarm.rb,
lib/karafka/pro/scheduled_messages/day.rb,
lib/karafka/processing/strategies/base.rb,
lib/karafka/routing/subscription_group.rb,
lib/karafka/pro/encryption/setup/config.rb,
lib/karafka/pro/processing/filters/base.rb,
lib/karafka/pro/processing/jobs_builder.rb,
lib/karafka/pro/recurring_tasks/matcher.rb,
lib/karafka/pro/swarm/liveness_listener.rb,
lib/karafka/processing/executors_buffer.rb,
lib/karafka/routing/features/active_job.rb,
lib/karafka/connection/rebalance_manager.rb,
lib/karafka/contracts/server_cli_options.rb,
lib/karafka/pro/cleaner/messages/message.rb,
lib/karafka/pro/processing/jobs/periodic.rb,
lib/karafka/pro/recurring_tasks/consumer.rb,
lib/karafka/pro/recurring_tasks/executor.rb,
lib/karafka/pro/recurring_tasks/listener.rb,
lib/karafka/pro/recurring_tasks/schedule.rb,
lib/karafka/pro/routing/features/pausing.rb,
lib/karafka/pro/scheduled_messages/proxy.rb,
lib/karafka/pro/scheduled_messages/state.rb,
lib/karafka/processing/strategies/aj_mom.rb,
lib/karafka/processing/strategy_selector.rb,
lib/karafka/routing/features/eofed/topic.rb,
lib/karafka/active_job/current_attributes.rb,
lib/karafka/instrumentation/notifications.rb,
lib/karafka/pro/cleaner/messages/messages.rb,
lib/karafka/pro/routing/features/delaying.rb,
lib/karafka/pro/routing/features/expiring.rb,
lib/karafka/pro/routing/features/patterns.rb,
lib/karafka/pro/scheduled_messages/errors.rb,
lib/karafka/processing/schedulers/default.rb,
lib/karafka/processing/strategies/default.rb,
lib/karafka/processing/strategies/dlq_mom.rb,
lib/karafka/routing/features/declaratives.rb,
lib/karafka/routing/features/eofed/config.rb,
lib/karafka/connection/raw_messages_buffer.rb,
lib/karafka/pro/encryption/messages/parser.rb,
lib/karafka/pro/processing/filters/delayer.rb,
lib/karafka/pro/processing/filters/expirer.rb,
lib/karafka/pro/processing/piping/consumer.rb,
lib/karafka/pro/processing/schedulers/base.rb,
lib/karafka/pro/processing/strategies/base.rb,
lib/karafka/pro/recurring_tasks/dispatcher.rb,
lib/karafka/pro/recurring_tasks/serializer.rb,
lib/karafka/pro/routing/features/filtering.rb,
lib/karafka/pro/scheduled_messages/tracker.rb,
lib/karafka/processing/coordinators_buffer.rb,
lib/karafka/processing/expansions_selector.rb,
lib/karafka/routing/features/base/expander.rb,
lib/karafka/routing/features/deserializers.rb,
lib/karafka/active_job/job_options_contract.rb,
lib/karafka/instrumentation/callbacks/error.rb,
lib/karafka/instrumentation/logger_listener.rb,
lib/karafka/pro/encryption/contracts/config.rb,
lib/karafka/pro/routing/features/active_job.rb,
lib/karafka/pro/routing/features/throttling.rb,
lib/karafka/pro/scheduled_messages/consumer.rb,
lib/karafka/messages/builders/batch_metadata.rb,
lib/karafka/pro/contracts/server_cli_options.rb,
lib/karafka/pro/processing/filters/throttler.rb,
lib/karafka/pro/processing/strategies/aj/mom.rb,
lib/karafka/pro/processing/strategies/dlq/vp.rb,
lib/karafka/pro/processing/strategies/ftr/vp.rb,
lib/karafka/pro/processing/strategies/lrj/vp.rb,
lib/karafka/pro/processing/strategies/mom/vp.rb,
lib/karafka/pro/processing/strategy_selector.rb,
lib/karafka/pro/recurring_tasks/deserializer.rb,
lib/karafka/pro/recurring_tasks/setup/config.rb,
lib/karafka/pro/routing/features/swarm/topic.rb,
lib/karafka/pro/scheduled_messages/max_epoch.rb,
lib/karafka/processing/strategies/aj_dlq_mom.rb,
lib/karafka/routing/features/inline_insights.rb,
lib/karafka/pro/processing/schedulers/default.rb,
lib/karafka/pro/processing/strategies/default.rb,
lib/karafka/pro/processing/strategies/dlq/ftr.rb,
lib/karafka/pro/processing/strategies/dlq/lrj.rb,
lib/karafka/pro/processing/strategies/dlq/mom.rb,
lib/karafka/pro/processing/strategies/lrj/ftr.rb,
lib/karafka/pro/processing/strategies/lrj/mom.rb,
lib/karafka/pro/processing/strategies/mom/ftr.rb,
lib/karafka/pro/routing/features/multiplexing.rb,
lib/karafka/pro/routing/features/periodic_job.rb,
lib/karafka/pro/routing/features/swarm/config.rb,
lib/karafka/pro/scheduled_messages/dispatcher.rb,
lib/karafka/pro/scheduled_messages/serializer.rb,
lib/karafka/routing/features/active_job/proxy.rb,
lib/karafka/routing/features/active_job/topic.rb,
lib/karafka/instrumentation/proctitle_listener.rb,
lib/karafka/pro/encryption/messages/middleware.rb,
lib/karafka/pro/processing/expansions_selector.rb,
lib/karafka/pro/recurring_tasks/contracts/task.rb,
lib/karafka/pro/routing/features/pausing/topic.rb,
lib/karafka/processing/inline_insights/tracker.rb,
lib/karafka/routing/features/active_job/config.rb,
lib/karafka/routing/features/dead_letter_queue.rb,
lib/karafka/instrumentation/assignments_tracker.rb,
lib/karafka/instrumentation/callbacks/rebalance.rb,
lib/karafka/pro/active_job/job_options_contract.rb,
lib/karafka/pro/processing/strategies/aj/mom_vp.rb,
lib/karafka/pro/routing/features/delaying/topic.rb,
lib/karafka/pro/routing/features/expiring/topic.rb,
lib/karafka/pro/routing/features/patterns/topic.rb,
lib/karafka/pro/scheduled_messages/daily_buffer.rb,
lib/karafka/pro/scheduled_messages/setup/config.rb,
lib/karafka/processing/inline_insights/consumer.rb,
lib/karafka/processing/inline_insights/listener.rb,
lib/karafka/routing/features/active_job/builder.rb,
lib/karafka/routing/features/declaratives/topic.rb,
lib/karafka/routing/subscription_groups_builder.rb,
lib/karafka/instrumentation/callbacks/statistics.rb,
lib/karafka/pro/connection/multiplexing/listener.rb,
lib/karafka/pro/processing/periodic_job/consumer.rb,
lib/karafka/pro/processing/strategies/aj/dlq_mom.rb,
lib/karafka/pro/processing/strategies/aj/ftr_mom.rb,
lib/karafka/pro/processing/strategies/aj/lrj_mom.rb,
lib/karafka/pro/processing/strategies/dlq/ftr_vp.rb,
lib/karafka/pro/processing/strategies/dlq/lrj_vp.rb,
lib/karafka/pro/processing/strategies/dlq/mom_vp.rb,
lib/karafka/pro/processing/strategies/lrj/ftr_vp.rb,
lib/karafka/pro/processing/strategies/lrj/mom_vp.rb,
lib/karafka/pro/processing/strategies/mom/ftr_vp.rb,
lib/karafka/pro/processing/strategies/vp/default.rb,
lib/karafka/pro/recurring_tasks/contracts/config.rb,
lib/karafka/pro/routing/features/delaying/config.rb,
lib/karafka/pro/routing/features/expiring/config.rb,
lib/karafka/pro/routing/features/filtering/topic.rb,
lib/karafka/pro/routing/features/inline_insights.rb,
lib/karafka/pro/routing/features/offset_metadata.rb,
lib/karafka/pro/routing/features/patterns/config.rb,
lib/karafka/pro/routing/features/patterns/topics.rb,
lib/karafka/pro/routing/features/recurring_tasks.rb,
lib/karafka/routing/features/declaratives/config.rb,
lib/karafka/routing/features/deserializers/topic.rb,
lib/karafka/active_job/current_attributes/loading.rb,
lib/karafka/pro/processing/strategies/dlq/default.rb,
lib/karafka/pro/processing/strategies/dlq/ftr_lrj.rb,
lib/karafka/pro/processing/strategies/dlq/ftr_mom.rb,
lib/karafka/pro/processing/strategies/dlq/lrj_mom.rb,
lib/karafka/pro/processing/strategies/ftr/default.rb,
lib/karafka/pro/processing/strategies/lrj/default.rb,
lib/karafka/pro/processing/strategies/lrj/ftr_mom.rb,
lib/karafka/pro/processing/strategies/mom/default.rb,
lib/karafka/pro/routing/features/filtering/config.rb,
lib/karafka/pro/routing/features/long_running_job.rb,
lib/karafka/pro/routing/features/non_blocking_job.rb,
lib/karafka/pro/routing/features/patterns/builder.rb,
lib/karafka/pro/routing/features/patterns/pattern.rb,
lib/karafka/pro/routing/features/throttling/topic.rb,
lib/karafka/routing/features/deserializers/config.rb,
lib/karafka/instrumentation/vendors/appsignal/base.rb,
lib/karafka/pro/processing/filters/virtual_limiter.rb,
lib/karafka/pro/processing/jobs/eofed_non_blocking.rb,
lib/karafka/pro/processing/offset_metadata/fetcher.rb,
lib/karafka/pro/routing/features/adaptive_iterator.rb,
lib/karafka/pro/routing/features/dead_letter_queue.rb,
lib/karafka/pro/routing/features/patterns/detector.rb,
lib/karafka/pro/routing/features/patterns/patterns.rb,
lib/karafka/pro/routing/features/throttling/config.rb,
lib/karafka/routing/features/eofed/contracts/topic.rb,
lib/karafka/routing/features/inline_insights/topic.rb,
lib/karafka/pro/instrumentation/performance_tracker.rb,
lib/karafka/pro/processing/offset_metadata/consumer.rb,
lib/karafka/pro/processing/offset_metadata/listener.rb,
lib/karafka/pro/processing/strategies/aj/dlq_mom_vp.rb,
lib/karafka/pro/processing/strategies/aj/ftr_mom_vp.rb,
lib/karafka/pro/processing/strategies/aj/lrj_mom_vp.rb,
lib/karafka/pro/routing/features/active_job/builder.rb,
lib/karafka/pro/routing/features/direct_assignments.rb,
lib/karafka/pro/routing/features/multiplexing/proxy.rb,
lib/karafka/pro/routing/features/periodic_job/topic.rb,
lib/karafka/pro/routing/features/scheduled_messages.rb,
lib/karafka/pro/routing/features/virtual_partitions.rb,
lib/karafka/pro/scheduled_messages/contracts/config.rb,
lib/karafka/pro/scheduled_messages/schema_validator.rb,
lib/karafka/routing/features/inline_insights/config.rb,
lib/karafka/instrumentation/vendors/appsignal/client.rb,
lib/karafka/pro/processing/adaptive_iterator/tracker.rb,
lib/karafka/pro/processing/jobs/consume_non_blocking.rb,
lib/karafka/pro/processing/jobs/revoked_non_blocking.rb,
lib/karafka/pro/processing/strategies/aj/dlq_ftr_mom.rb,
lib/karafka/pro/processing/strategies/aj/dlq_lrj_mom.rb,
lib/karafka/pro/processing/strategies/aj/ftr_lrj_mom.rb,
lib/karafka/pro/processing/strategies/dlq/ftr_lrj_vp.rb,
lib/karafka/pro/processing/strategies/dlq/ftr_mom_vp.rb,
lib/karafka/pro/processing/strategies/dlq/lrj_mom_vp.rb,
lib/karafka/pro/processing/strategies/lrj/ftr_mom_vp.rb,
lib/karafka/pro/routing/features/multiplexing/config.rb,
lib/karafka/pro/routing/features/periodic_job/config.rb,
lib/karafka/pro/scheduled_messages/contracts/message.rb,
lib/karafka/routing/features/dead_letter_queue/topic.rb,
lib/karafka/active_job/current_attributes/persistence.rb,
lib/karafka/pro/processing/adaptive_iterator/consumer.rb,
lib/karafka/pro/processing/jobs/periodic_non_blocking.rb,
lib/karafka/pro/processing/strategies/dlq/ftr_lrj_mom.rb,
lib/karafka/routing/features/dead_letter_queue/config.rb,
lib/karafka/routing/features/manual_offset_management.rb,
lib/karafka/pro/processing/coordinators/errors_tracker.rb,
lib/karafka/pro/routing/features/inline_insights/topic.rb,
lib/karafka/pro/routing/features/offset_metadata/topic.rb,
lib/karafka/pro/routing/features/recurring_tasks/proxy.rb,
lib/karafka/pro/routing/features/recurring_tasks/topic.rb,
lib/karafka/pro/routing/features/swarm/contracts/topic.rb,
lib/karafka/pro/processing/coordinators/filters_applier.rb,
lib/karafka/pro/processing/strategies/aj/dlq_ftr_mom_vp.rb,
lib/karafka/pro/processing/strategies/aj/dlq_lrj_mom_vp.rb,
lib/karafka/pro/processing/strategies/aj/ftr_lrj_mom_vp.rb,
lib/karafka/pro/routing/features/inline_insights/config.rb,
lib/karafka/pro/routing/features/long_running_job/topic.rb,
lib/karafka/pro/routing/features/non_blocking_job/topic.rb,
lib/karafka/pro/routing/features/offset_metadata/config.rb,
lib/karafka/pro/routing/features/recurring_tasks/config.rb,
lib/karafka/routing/features/active_job/contracts/topic.rb,
lib/karafka/pro/processing/strategies/aj/dlq_ftr_lrj_mom.rb,
lib/karafka/pro/processing/strategies/dlq/ftr_lrj_mom_vp.rb,
lib/karafka/pro/routing/features/adaptive_iterator/topic.rb,
lib/karafka/pro/routing/features/dead_letter_queue/topic.rb,
lib/karafka/pro/routing/features/long_running_job/config.rb,
lib/karafka/pro/routing/features/patterns/consumer_group.rb,
lib/karafka/pro/routing/features/pausing/contracts/topic.rb,
lib/karafka/pro/routing/features/recurring_tasks/builder.rb,
lib/karafka/pro/routing/features/swarm/contracts/routing.rb,
lib/karafka/pro/scheduled_messages/deserializers/headers.rb,
lib/karafka/pro/scheduled_messages/deserializers/payload.rb,
lib/karafka/pro/routing/features/adaptive_iterator/config.rb,
lib/karafka/pro/routing/features/delaying/contracts/topic.rb,
lib/karafka/pro/routing/features/direct_assignments/topic.rb,
lib/karafka/pro/routing/features/expiring/contracts/topic.rb,
lib/karafka/pro/routing/features/patterns/contracts/topic.rb,
lib/karafka/pro/routing/features/scheduled_messages/proxy.rb,
lib/karafka/pro/routing/features/scheduled_messages/topic.rb,
lib/karafka/pro/routing/features/virtual_partitions/topic.rb,
lib/karafka/routing/features/declaratives/contracts/topic.rb,
lib/karafka/pro/processing/filters/inline_insights_delayer.rb,
lib/karafka/pro/processing/subscription_groups_coordinator.rb,
lib/karafka/pro/routing/features/direct_assignments/config.rb,
lib/karafka/pro/routing/features/filtering/contracts/topic.rb,
lib/karafka/pro/routing/features/scheduled_messages/config.rb,
lib/karafka/pro/routing/features/virtual_partitions/config.rb,
lib/karafka/routing/features/deserializers/contracts/topic.rb,
lib/karafka/instrumentation/vendors/datadog/logger_listener.rb,
lib/karafka/pro/processing/strategies/aj/dlq_ftr_lrj_mom_vp.rb,
lib/karafka/pro/routing/features/patterns/contracts/pattern.rb,
lib/karafka/pro/routing/features/scheduled_messages/builder.rb,
lib/karafka/pro/routing/features/throttling/contracts/topic.rb,
lib/karafka/routing/features/manual_offset_management/topic.rb,
lib/karafka/instrumentation/vendors/datadog/metrics_listener.rb,
lib/karafka/instrumentation/vendors/kubernetes/base_listener.rb,
lib/karafka/routing/features/inline_insights/contracts/topic.rb,
lib/karafka/routing/features/manual_offset_management/config.rb,
lib/karafka/instrumentation/vendors/appsignal/errors_listener.rb,
lib/karafka/pro/routing/features/multiplexing/contracts/topic.rb,
lib/karafka/pro/routing/features/periodic_job/contracts/topic.rb,
lib/karafka/instrumentation/vendors/appsignal/metrics_listener.rb,
lib/karafka/pro/processing/coordinators/virtual_offset_manager.rb,
lib/karafka/routing/features/dead_letter_queue/contracts/topic.rb,
lib/karafka/instrumentation/callbacks/oauthbearer_token_refresh.rb,
lib/karafka/instrumentation/vendors/kubernetes/liveness_listener.rb,
lib/karafka/pro/routing/features/inline_insights/contracts/topic.rb,
lib/karafka/pro/routing/features/multiplexing/subscription_group.rb,
lib/karafka/pro/routing/features/offset_metadata/contracts/topic.rb,
lib/karafka/pro/routing/features/recurring_tasks/contracts/topic.rb,
lib/karafka/pro/routing/features/long_running_job/contracts/topic.rb,
lib/karafka/pro/routing/features/adaptive_iterator/contracts/topic.rb,
lib/karafka/pro/routing/features/dead_letter_queue/contracts/topic.rb,
lib/karafka/pro/routing/features/patterns/contracts/consumer_group.rb,
lib/karafka/pro/routing/features/direct_assignments/contracts/topic.rb,
lib/karafka/pro/routing/features/scheduled_messages/contracts/topic.rb,
lib/karafka/pro/routing/features/virtual_partitions/contracts/topic.rb,
lib/karafka/routing/features/manual_offset_management/contracts/topic.rb,
lib/karafka/instrumentation/vendors/kubernetes/swarm_liveness_listener.rb,
lib/karafka/pro/routing/features/direct_assignments/subscription_group.rb,
lib/karafka/pro/routing/features/multiplexing/subscription_groups_builder.rb,
lib/karafka/pro/routing/features/direct_assignments/contracts/consumer_group.rb,
lib/karafka/pro/routing/features/multiplexing/patches/contracts/consumer_group.rb

Overview

This Karafka component is a Pro component under a commercial license. This Karafka component is NOT licensed under LGPL.

All of the commercial components are present in the lib/karafka/pro directory of this repository and their usage requires commercial license agreement.

Karafka has also commercial-friendly license, commercial support and commercial components.

By sending a pull request to the pro components, you are agreeing to transfer the copyright of your code to Maciej Mensfeld.

Defined Under Namespace

Modules: ActiveJob, Admin, Connection, Constraints, Contracts, Deserializers, Embedded, Errors, Helpers, Instrumentation, Messages, Patches, Pro, Processing, Routing, Setup, Swarm, TimeTrackers Classes: App, BaseConsumer, Cli, Env, Licenser, Process, Railtie, Runner, Server, Status

Constant Summary collapse

VERSION =

Current Karafka version

'2.4.13'

Class Method Summary collapse

Class Method Details

.boot_fileString

Note:

By default it is a file called ‘karafka.rb’ but it can be specified as you wish if you have Karafka that is merged into a Sinatra/Rails app and karafka.rb is taken. It will be used for console/consumers/etc

Returns path to a default file that contains booting procedure etc.

Examples:

Standard only-Karafka case

Karafka.boot_file #=> '/home/app_path/karafka.rb'

Non standard case

KARAFKA_BOOT_FILE='/home/app_path/app.rb'
Karafka.boot_file #=> '/home/app_path/app.rb'

Returns:

  • (String)

    path to a default file that contains booting procedure etc



118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/karafka.rb', line 118

def boot_file
  boot_file = Pathname.new(ENV['KARAFKA_BOOT_FILE'] || File.join(Karafka.root, 'karafka.rb'))

  return boot_file if boot_file.absolute?
  return boot_file if boot_file.to_s == 'false'

  Pathname.new(
    File.expand_path(
      boot_file,
      Karafka.root
    )
  )
end

.core_rootPathname

Returns path to Karafka gem root core.

Returns:

  • (Pathname)

    path to Karafka gem root core



75
76
77
# File 'lib/karafka.rb', line 75

def core_root
  Pathname.new(File.expand_path('karafka', __dir__))
end

.envKarafka::Env

Returns env instance that allows us to check environment.

Returns:

  • (Karafka::Env)

    env instance that allows us to check environment



25
26
27
# File 'lib/karafka.rb', line 25

def env
  @env ||= Env.new
end

.env=(environment) ⇒ Karafka::Env

Returns env instance.

Examples:

Assign new environment to Karafka::App

Karafka::App.env = :production

Parameters:

  • environment (String, Symbol)

    new environment that we want to set

Returns:



33
34
35
# File 'lib/karafka.rb', line 33

def env=(environment)
  env.replace(environment.to_s)
end

.gem_rootPathname

Returns root path of this gem.

Returns:

  • (Pathname)

    root path of this gem



53
54
55
# File 'lib/karafka.rb', line 53

def gem_root
  Pathname.new(File.expand_path('..', __dir__))
end

.loggerLogger

Returns logger that we want to use. Will use ::Karafka::Logger by default.

Returns:

  • (Logger)

    logger that we want to use. Will use ::Karafka::Logger by default



38
39
40
# File 'lib/karafka.rb', line 38

def logger
  @logger ||= App.config.logger
end

.monitor::Karafka::Monitor

Returns monitor that we want to use.

Returns:

  • (::Karafka::Monitor)

    monitor that we want to use



48
49
50
# File 'lib/karafka.rb', line 48

def monitor
  @monitor ||= App.config.monitor
end

.pro?Boolean

Returns true if there is a valid pro token present.

Returns:

  • (Boolean)

    true if there is a valid pro token present



80
81
82
# File 'lib/karafka.rb', line 80

def pro?
  App.config.license.token != false
end

.producerWaterDrop::Producer

Returns waterdrop messages producer.

Returns:

  • (WaterDrop::Producer)

    waterdrop messages producer



43
44
45
# File 'lib/karafka.rb', line 43

def producer
  App.config.producer
end

.rails?Boolean

Note:

We allow users to disable Rails require because having Rails in the Gemfile does not always mean user wants to have it required. User may want to run Karafka without Rails even when having both in the same Gemfile.

Returns Do we run within/with Rails. We use this to initialize Railtie and proxy the console invocation to Rails.

Returns:

  • (Boolean)

    Do we run within/with Rails. We use this to initialize Railtie and proxy the console invocation to Rails



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/karafka.rb', line 90

def rails?
  return @rails if instance_variable_defined?('@rails')

  @rails = Object.const_defined?('Rails::Railtie')

  # If Rails exists we set it immediately based on its presence and return
  return @rails if @rails

  # If rails is not present and user wants us not to force-load it, we return
  return @rails if ENV['KARAFKA_REQUIRE_RAILS'] == 'false'

  # If we should try to require it, we try and if no error, it means its there
  require('rails')

  @rails = true
rescue LoadError
  @rails = false
end

.refresh!Object

We need to be able to overwrite both monitor and logger after the configuration in case they would be changed because those two (with defaults) can be used prior to the setup and their state change should be reflected in the updated setup

This method refreshes the things that might have been altered by the configuration



137
138
139
140
141
142
143
# File 'lib/karafka.rb', line 137

def refresh!
  config = ::Karafka::App.config

  @logger = config.logger
  @producer = config.producer
  @monitor = config.monitor
end

.rootPathname

Returns Karafka app root path (user application path).

Returns:

  • (Pathname)

    Karafka app root path (user application path)



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/karafka.rb', line 58

def root
  # If user points to a different root explicitly, use it
  return Pathname.new(ENV['KARAFKA_ROOT_DIR']) if ENV['KARAFKA_ROOT_DIR']

  # By default we infer the project root from bundler.
  # We cannot use the BUNDLE_GEMFILE env directly because it may be altered by things like
  # ruby-lsp. Instead we always fallback to the most outer Gemfile. In most of the cases, it
  # won't matter but in case of some automatic setup alterations like ruby-lsp, the location
  # from which the project starts may not match the original Gemfile.
  Pathname.new(
    File.dirname(
      Bundler.with_unbundled_env { Bundler.default_gemfile }
    )
  )
end