karafka 2.5.6 → 2.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/LICENSE-COMM +4 -2
- data/config/locales/pro_errors.yml +1 -0
- data/lib/karafka/admin/replication.rb +36 -4
- data/lib/karafka/errors.rb +3 -1
- data/lib/karafka/helpers/interval_runner.rb +4 -2
- data/lib/karafka/instrumentation/logger_listener.rb +22 -9
- data/lib/karafka/instrumentation/vendors/datadog/logger_listener.rb +6 -1
- data/lib/karafka/messages/builders/batch_metadata.rb +4 -2
- data/lib/karafka/pro/active_job/consumer.rb +8 -0
- data/lib/karafka/pro/active_job/dispatcher.rb +8 -0
- data/lib/karafka/pro/active_job/job_options_contract.rb +8 -0
- data/lib/karafka/pro/admin/recovery/errors.rb +51 -0
- data/lib/karafka/pro/admin/recovery.rb +486 -0
- data/lib/karafka/pro/base_consumer.rb +8 -0
- data/lib/karafka/pro/cleaner/errors.rb +8 -0
- data/lib/karafka/pro/cleaner/messages/message.rb +8 -0
- data/lib/karafka/pro/cleaner/messages/messages.rb +8 -0
- data/lib/karafka/pro/cleaner/messages/metadata.rb +8 -0
- data/lib/karafka/pro/cleaner.rb +8 -0
- data/lib/karafka/pro/cli/contracts/server.rb +8 -0
- data/lib/karafka/pro/cli/parallel_segments/base.rb +8 -0
- data/lib/karafka/pro/cli/parallel_segments/collapse.rb +8 -0
- data/lib/karafka/pro/cli/parallel_segments/distribute.rb +8 -0
- data/lib/karafka/pro/cli/parallel_segments.rb +8 -0
- data/lib/karafka/pro/cli/topics/health.rb +10 -2
- data/lib/karafka/pro/cli/topics.rb +8 -0
- data/lib/karafka/pro/connection/manager.rb +8 -0
- data/lib/karafka/pro/connection/multiplexing/listener.rb +8 -0
- data/lib/karafka/pro/contracts/base.rb +8 -0
- data/lib/karafka/pro/encryption/cipher.rb +8 -0
- data/lib/karafka/pro/encryption/contracts/config.rb +8 -0
- data/lib/karafka/pro/encryption/errors.rb +8 -0
- data/lib/karafka/pro/encryption/messages/middleware.rb +8 -0
- data/lib/karafka/pro/encryption/messages/parser.rb +8 -0
- data/lib/karafka/pro/encryption/setup/config.rb +8 -0
- data/lib/karafka/pro/encryption.rb +8 -0
- data/lib/karafka/pro/instrumentation/performance_tracker.rb +8 -0
- data/lib/karafka/pro/iterator/expander.rb +9 -1
- data/lib/karafka/pro/iterator/tpl_builder.rb +8 -0
- data/lib/karafka/pro/iterator.rb +9 -1
- data/lib/karafka/pro/loader.rb +8 -0
- data/lib/karafka/pro/processing/adaptive_iterator/consumer.rb +8 -0
- data/lib/karafka/pro/processing/adaptive_iterator/tracker.rb +8 -0
- data/lib/karafka/pro/processing/collapser.rb +8 -0
- data/lib/karafka/pro/processing/coordinator.rb +8 -0
- data/lib/karafka/pro/processing/coordinators/errors_tracker.rb +8 -0
- data/lib/karafka/pro/processing/coordinators/filters_applier.rb +8 -0
- data/lib/karafka/pro/processing/coordinators/virtual_offset_manager.rb +25 -7
- data/lib/karafka/pro/processing/executor.rb +8 -0
- data/lib/karafka/pro/processing/expansions_selector.rb +8 -0
- data/lib/karafka/pro/processing/filters/base.rb +8 -0
- data/lib/karafka/pro/processing/filters/delayer.rb +8 -0
- data/lib/karafka/pro/processing/filters/expirer.rb +8 -0
- data/lib/karafka/pro/processing/filters/inline_insights_delayer.rb +8 -0
- data/lib/karafka/pro/processing/filters/throttler.rb +8 -0
- data/lib/karafka/pro/processing/filters/virtual_limiter.rb +8 -0
- data/lib/karafka/pro/processing/jobs/consume_non_blocking.rb +8 -0
- data/lib/karafka/pro/processing/jobs/eofed_non_blocking.rb +8 -0
- data/lib/karafka/pro/processing/jobs/periodic.rb +8 -0
- data/lib/karafka/pro/processing/jobs/periodic_non_blocking.rb +8 -0
- data/lib/karafka/pro/processing/jobs/revoked_non_blocking.rb +8 -0
- data/lib/karafka/pro/processing/jobs_builder.rb +8 -0
- data/lib/karafka/pro/processing/jobs_queue.rb +8 -0
- data/lib/karafka/pro/processing/offset_metadata/consumer.rb +8 -0
- data/lib/karafka/pro/processing/offset_metadata/fetcher.rb +8 -0
- data/lib/karafka/pro/processing/offset_metadata/listener.rb +8 -0
- data/lib/karafka/pro/processing/parallel_segments/filters/base.rb +8 -0
- data/lib/karafka/pro/processing/parallel_segments/filters/default.rb +8 -0
- data/lib/karafka/pro/processing/parallel_segments/filters/mom.rb +8 -0
- data/lib/karafka/pro/processing/partitioner.rb +8 -0
- data/lib/karafka/pro/processing/periodic_job/consumer.rb +8 -0
- data/lib/karafka/pro/processing/piping/consumer.rb +8 -0
- data/lib/karafka/pro/processing/schedulers/base.rb +8 -0
- data/lib/karafka/pro/processing/schedulers/default.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_lrj_mom.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_lrj_mom_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_mom.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_mom_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/dlq_lrj_mom.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/dlq_lrj_mom_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/dlq_mom.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/dlq_mom_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/ftr_lrj_mom.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/ftr_lrj_mom_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/ftr_mom.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/ftr_mom_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/lrj_mom.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/lrj_mom_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/mom.rb +8 -0
- data/lib/karafka/pro/processing/strategies/aj/mom_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/base.rb +8 -0
- data/lib/karafka/pro/processing/strategies/default.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/default.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/ftr.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_mom.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_mom_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/ftr_mom.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/ftr_mom_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/ftr_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/lrj.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/lrj_mom.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/lrj_mom_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/lrj_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/mom.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/mom_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/dlq/vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/ftr/default.rb +8 -0
- data/lib/karafka/pro/processing/strategies/ftr/vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/lrj/default.rb +8 -0
- data/lib/karafka/pro/processing/strategies/lrj/ftr.rb +8 -0
- data/lib/karafka/pro/processing/strategies/lrj/ftr_mom.rb +8 -0
- data/lib/karafka/pro/processing/strategies/lrj/ftr_mom_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/lrj/ftr_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/lrj/mom.rb +8 -0
- data/lib/karafka/pro/processing/strategies/lrj/mom_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/lrj/vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/mom/default.rb +8 -0
- data/lib/karafka/pro/processing/strategies/mom/ftr.rb +8 -0
- data/lib/karafka/pro/processing/strategies/mom/ftr_vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/mom/vp.rb +8 -0
- data/lib/karafka/pro/processing/strategies/vp/default.rb +8 -0
- data/lib/karafka/pro/processing/strategies.rb +8 -0
- data/lib/karafka/pro/processing/strategy_selector.rb +8 -0
- data/lib/karafka/pro/processing/subscription_groups_coordinator.rb +8 -0
- data/lib/karafka/pro/processing/virtual_partitions/distributors/balanced.rb +8 -0
- data/lib/karafka/pro/processing/virtual_partitions/distributors/base.rb +8 -0
- data/lib/karafka/pro/processing/virtual_partitions/distributors/consistent.rb +8 -0
- data/lib/karafka/pro/recurring_tasks/consumer.rb +8 -0
- data/lib/karafka/pro/recurring_tasks/contracts/config.rb +8 -0
- data/lib/karafka/pro/recurring_tasks/contracts/task.rb +8 -0
- data/lib/karafka/pro/recurring_tasks/deserializer.rb +8 -0
- data/lib/karafka/pro/recurring_tasks/dispatcher.rb +8 -0
- data/lib/karafka/pro/recurring_tasks/errors.rb +8 -0
- data/lib/karafka/pro/recurring_tasks/executor.rb +8 -0
- data/lib/karafka/pro/recurring_tasks/listener.rb +8 -0
- data/lib/karafka/pro/recurring_tasks/matcher.rb +8 -0
- data/lib/karafka/pro/recurring_tasks/schedule.rb +8 -0
- data/lib/karafka/pro/recurring_tasks/serializer.rb +8 -0
- data/lib/karafka/pro/recurring_tasks/setup/config.rb +8 -0
- data/lib/karafka/pro/recurring_tasks/task.rb +8 -0
- data/lib/karafka/pro/recurring_tasks.rb +8 -0
- data/lib/karafka/pro/routing/features/active_job/builder.rb +8 -0
- data/lib/karafka/pro/routing/features/active_job.rb +8 -0
- data/lib/karafka/pro/routing/features/adaptive_iterator/config.rb +8 -0
- data/lib/karafka/pro/routing/features/adaptive_iterator/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/adaptive_iterator/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/adaptive_iterator.rb +8 -0
- data/lib/karafka/pro/routing/features/base.rb +8 -0
- data/lib/karafka/pro/routing/features/dead_letter_queue/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/dead_letter_queue/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/dead_letter_queue.rb +8 -0
- data/lib/karafka/pro/routing/features/delaying/config.rb +8 -0
- data/lib/karafka/pro/routing/features/delaying/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/delaying/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/delaying.rb +8 -0
- data/lib/karafka/pro/routing/features/direct_assignments/config.rb +8 -0
- data/lib/karafka/pro/routing/features/direct_assignments/contracts/consumer_group.rb +8 -0
- data/lib/karafka/pro/routing/features/direct_assignments/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/direct_assignments/subscription_group.rb +8 -0
- data/lib/karafka/pro/routing/features/direct_assignments/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/direct_assignments.rb +8 -0
- data/lib/karafka/pro/routing/features/expiring/config.rb +8 -0
- data/lib/karafka/pro/routing/features/expiring/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/expiring/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/expiring.rb +8 -0
- data/lib/karafka/pro/routing/features/filtering/config.rb +8 -0
- data/lib/karafka/pro/routing/features/filtering/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/filtering/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/filtering.rb +8 -0
- data/lib/karafka/pro/routing/features/inline_insights/config.rb +8 -0
- data/lib/karafka/pro/routing/features/inline_insights/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/inline_insights/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/inline_insights.rb +8 -0
- data/lib/karafka/pro/routing/features/long_running_job/config.rb +8 -0
- data/lib/karafka/pro/routing/features/long_running_job/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/long_running_job/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/long_running_job.rb +8 -0
- data/lib/karafka/pro/routing/features/multiplexing/config.rb +8 -0
- data/lib/karafka/pro/routing/features/multiplexing/contracts/routing.rb +81 -0
- data/lib/karafka/pro/routing/features/multiplexing/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/multiplexing/patches/contracts/consumer_group.rb +8 -0
- data/lib/karafka/pro/routing/features/multiplexing/proxy.rb +8 -0
- data/lib/karafka/pro/routing/features/multiplexing/subscription_group.rb +8 -0
- data/lib/karafka/pro/routing/features/multiplexing/subscription_groups_builder.rb +8 -0
- data/lib/karafka/pro/routing/features/multiplexing.rb +17 -2
- data/lib/karafka/pro/routing/features/non_blocking_job/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/non_blocking_job.rb +8 -0
- data/lib/karafka/pro/routing/features/offset_metadata/config.rb +8 -0
- data/lib/karafka/pro/routing/features/offset_metadata/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/offset_metadata/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/offset_metadata.rb +8 -0
- data/lib/karafka/pro/routing/features/parallel_segments/builder.rb +8 -0
- data/lib/karafka/pro/routing/features/parallel_segments/config.rb +8 -0
- data/lib/karafka/pro/routing/features/parallel_segments/consumer_group.rb +8 -0
- data/lib/karafka/pro/routing/features/parallel_segments/contracts/consumer_group.rb +8 -0
- data/lib/karafka/pro/routing/features/parallel_segments/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/parallel_segments.rb +8 -0
- data/lib/karafka/pro/routing/features/patterns/builder.rb +8 -0
- data/lib/karafka/pro/routing/features/patterns/config.rb +8 -0
- data/lib/karafka/pro/routing/features/patterns/consumer_group.rb +8 -0
- data/lib/karafka/pro/routing/features/patterns/contracts/consumer_group.rb +8 -0
- data/lib/karafka/pro/routing/features/patterns/contracts/pattern.rb +8 -0
- data/lib/karafka/pro/routing/features/patterns/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/patterns/detector.rb +8 -0
- data/lib/karafka/pro/routing/features/patterns/pattern.rb +8 -0
- data/lib/karafka/pro/routing/features/patterns/patterns.rb +8 -0
- data/lib/karafka/pro/routing/features/patterns/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/patterns/topics.rb +8 -0
- data/lib/karafka/pro/routing/features/patterns.rb +8 -0
- data/lib/karafka/pro/routing/features/pausing/config.rb +8 -0
- data/lib/karafka/pro/routing/features/pausing/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/pausing/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/pausing.rb +8 -0
- data/lib/karafka/pro/routing/features/periodic_job/config.rb +8 -0
- data/lib/karafka/pro/routing/features/periodic_job/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/periodic_job/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/periodic_job.rb +8 -0
- data/lib/karafka/pro/routing/features/recurring_tasks/builder.rb +8 -0
- data/lib/karafka/pro/routing/features/recurring_tasks/config.rb +8 -0
- data/lib/karafka/pro/routing/features/recurring_tasks/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/recurring_tasks/proxy.rb +8 -0
- data/lib/karafka/pro/routing/features/recurring_tasks/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/recurring_tasks.rb +8 -0
- data/lib/karafka/pro/routing/features/scheduled_messages/builder.rb +8 -0
- data/lib/karafka/pro/routing/features/scheduled_messages/config.rb +8 -0
- data/lib/karafka/pro/routing/features/scheduled_messages/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/scheduled_messages/proxy.rb +8 -0
- data/lib/karafka/pro/routing/features/scheduled_messages/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/scheduled_messages.rb +8 -0
- data/lib/karafka/pro/routing/features/swarm/config.rb +8 -0
- data/lib/karafka/pro/routing/features/swarm/contracts/routing.rb +8 -0
- data/lib/karafka/pro/routing/features/swarm/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/swarm/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/swarm.rb +8 -0
- data/lib/karafka/pro/routing/features/throttling/config.rb +8 -0
- data/lib/karafka/pro/routing/features/throttling/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/throttling/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/throttling.rb +8 -0
- data/lib/karafka/pro/routing/features/virtual_partitions/config.rb +8 -0
- data/lib/karafka/pro/routing/features/virtual_partitions/contracts/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/virtual_partitions/topic.rb +8 -0
- data/lib/karafka/pro/routing/features/virtual_partitions.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/consumer.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/contracts/config.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/contracts/message.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/daily_buffer.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/day.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/deserializers/headers.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/deserializers/payload.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/dispatcher.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/errors.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/max_epoch.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/proxy.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/schema_validator.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/serializer.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/setup/config.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/state.rb +8 -0
- data/lib/karafka/pro/scheduled_messages/tracker.rb +8 -0
- data/lib/karafka/pro/scheduled_messages.rb +8 -0
- data/lib/karafka/pro/swarm/liveness_listener.rb +29 -14
- data/lib/karafka/processing/jobs_queue.rb +10 -0
- data/lib/karafka/server.rb +9 -0
- data/lib/karafka/setup/config_proxy.rb +9 -1
- data/lib/karafka/swarm/liveness_listener.rb +17 -8
- data/lib/karafka/swarm/node.rb +1 -30
- data/lib/karafka/swarm/producer_replacer.rb +110 -0
- data/lib/karafka/swarm/supervisor.rb +3 -0
- data/lib/karafka/version.rb +1 -1
- metadata +6 -2
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
# This software is NOT open source. It is source-available commercial software
|
|
7
7
|
# requiring a paid license for use. It is NOT covered by LGPL.
|
|
8
8
|
#
|
|
9
|
+
# The author retains all right, title, and interest in this software,
|
|
10
|
+
# including all copyrights, patents, and other intellectual property rights.
|
|
11
|
+
# No patent rights are granted under this license.
|
|
12
|
+
#
|
|
9
13
|
# PROHIBITED:
|
|
10
14
|
# - Use without a valid commercial license
|
|
11
15
|
# - Redistribution, modification, or derivative works without authorization
|
|
16
|
+
# - Reverse engineering, decompilation, or disassembly of this software
|
|
12
17
|
# - Use as training data for AI/ML models or inclusion in datasets
|
|
13
18
|
# - Scraping, crawling, or automated collection for any purpose
|
|
14
19
|
#
|
|
@@ -17,6 +22,9 @@
|
|
|
17
22
|
# - Runtime retrieval by AI assistants, coding agents, and RAG systems
|
|
18
23
|
# for the purpose of providing contextual help to Karafka users
|
|
19
24
|
#
|
|
25
|
+
# Receipt, viewing, or possession of this software does not convey or
|
|
26
|
+
# imply any license or right beyond those expressly stated above.
|
|
27
|
+
#
|
|
20
28
|
# License: https://karafka.io/docs/Pro-License-Comm/
|
|
21
29
|
# Contact: contact@karafka.io
|
|
22
30
|
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
# This software is NOT open source. It is source-available commercial software
|
|
7
7
|
# requiring a paid license for use. It is NOT covered by LGPL.
|
|
8
8
|
#
|
|
9
|
+
# The author retains all right, title, and interest in this software,
|
|
10
|
+
# including all copyrights, patents, and other intellectual property rights.
|
|
11
|
+
# No patent rights are granted under this license.
|
|
12
|
+
#
|
|
9
13
|
# PROHIBITED:
|
|
10
14
|
# - Use without a valid commercial license
|
|
11
15
|
# - Redistribution, modification, or derivative works without authorization
|
|
16
|
+
# - Reverse engineering, decompilation, or disassembly of this software
|
|
12
17
|
# - Use as training data for AI/ML models or inclusion in datasets
|
|
13
18
|
# - Scraping, crawling, or automated collection for any purpose
|
|
14
19
|
#
|
|
@@ -17,6 +22,9 @@
|
|
|
17
22
|
# - Runtime retrieval by AI assistants, coding agents, and RAG systems
|
|
18
23
|
# for the purpose of providing contextual help to Karafka users
|
|
19
24
|
#
|
|
25
|
+
# Receipt, viewing, or possession of this software does not convey or
|
|
26
|
+
# imply any license or right beyond those expressly stated above.
|
|
27
|
+
#
|
|
20
28
|
# License: https://karafka.io/docs/Pro-License-Comm/
|
|
21
29
|
# Contact: contact@karafka.io
|
|
22
30
|
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
# This software is NOT open source. It is source-available commercial software
|
|
7
7
|
# requiring a paid license for use. It is NOT covered by LGPL.
|
|
8
8
|
#
|
|
9
|
+
# The author retains all right, title, and interest in this software,
|
|
10
|
+
# including all copyrights, patents, and other intellectual property rights.
|
|
11
|
+
# No patent rights are granted under this license.
|
|
12
|
+
#
|
|
9
13
|
# PROHIBITED:
|
|
10
14
|
# - Use without a valid commercial license
|
|
11
15
|
# - Redistribution, modification, or derivative works without authorization
|
|
16
|
+
# - Reverse engineering, decompilation, or disassembly of this software
|
|
12
17
|
# - Use as training data for AI/ML models or inclusion in datasets
|
|
13
18
|
# - Scraping, crawling, or automated collection for any purpose
|
|
14
19
|
#
|
|
@@ -17,6 +22,9 @@
|
|
|
17
22
|
# - Runtime retrieval by AI assistants, coding agents, and RAG systems
|
|
18
23
|
# for the purpose of providing contextual help to Karafka users
|
|
19
24
|
#
|
|
25
|
+
# Receipt, viewing, or possession of this software does not convey or
|
|
26
|
+
# imply any license or right beyond those expressly stated above.
|
|
27
|
+
#
|
|
20
28
|
# License: https://karafka.io/docs/Pro-License-Comm/
|
|
21
29
|
# Contact: contact@karafka.io
|
|
22
30
|
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
# This software is NOT open source. It is source-available commercial software
|
|
7
7
|
# requiring a paid license for use. It is NOT covered by LGPL.
|
|
8
8
|
#
|
|
9
|
+
# The author retains all right, title, and interest in this software,
|
|
10
|
+
# including all copyrights, patents, and other intellectual property rights.
|
|
11
|
+
# No patent rights are granted under this license.
|
|
12
|
+
#
|
|
9
13
|
# PROHIBITED:
|
|
10
14
|
# - Use without a valid commercial license
|
|
11
15
|
# - Redistribution, modification, or derivative works without authorization
|
|
16
|
+
# - Reverse engineering, decompilation, or disassembly of this software
|
|
12
17
|
# - Use as training data for AI/ML models or inclusion in datasets
|
|
13
18
|
# - Scraping, crawling, or automated collection for any purpose
|
|
14
19
|
#
|
|
@@ -17,6 +22,9 @@
|
|
|
17
22
|
# - Runtime retrieval by AI assistants, coding agents, and RAG systems
|
|
18
23
|
# for the purpose of providing contextual help to Karafka users
|
|
19
24
|
#
|
|
25
|
+
# Receipt, viewing, or possession of this software does not convey or
|
|
26
|
+
# imply any license or right beyond those expressly stated above.
|
|
27
|
+
#
|
|
20
28
|
# License: https://karafka.io/docs/Pro-License-Comm/
|
|
21
29
|
# Contact: contact@karafka.io
|
|
22
30
|
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
# This software is NOT open source. It is source-available commercial software
|
|
7
7
|
# requiring a paid license for use. It is NOT covered by LGPL.
|
|
8
8
|
#
|
|
9
|
+
# The author retains all right, title, and interest in this software,
|
|
10
|
+
# including all copyrights, patents, and other intellectual property rights.
|
|
11
|
+
# No patent rights are granted under this license.
|
|
12
|
+
#
|
|
9
13
|
# PROHIBITED:
|
|
10
14
|
# - Use without a valid commercial license
|
|
11
15
|
# - Redistribution, modification, or derivative works without authorization
|
|
16
|
+
# - Reverse engineering, decompilation, or disassembly of this software
|
|
12
17
|
# - Use as training data for AI/ML models or inclusion in datasets
|
|
13
18
|
# - Scraping, crawling, or automated collection for any purpose
|
|
14
19
|
#
|
|
@@ -17,6 +22,9 @@
|
|
|
17
22
|
# - Runtime retrieval by AI assistants, coding agents, and RAG systems
|
|
18
23
|
# for the purpose of providing contextual help to Karafka users
|
|
19
24
|
#
|
|
25
|
+
# Receipt, viewing, or possession of this software does not convey or
|
|
26
|
+
# imply any license or right beyond those expressly stated above.
|
|
27
|
+
#
|
|
20
28
|
# License: https://karafka.io/docs/Pro-License-Comm/
|
|
21
29
|
# Contact: contact@karafka.io
|
|
22
30
|
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
# This software is NOT open source. It is source-available commercial software
|
|
7
7
|
# requiring a paid license for use. It is NOT covered by LGPL.
|
|
8
8
|
#
|
|
9
|
+
# The author retains all right, title, and interest in this software,
|
|
10
|
+
# including all copyrights, patents, and other intellectual property rights.
|
|
11
|
+
# No patent rights are granted under this license.
|
|
12
|
+
#
|
|
9
13
|
# PROHIBITED:
|
|
10
14
|
# - Use without a valid commercial license
|
|
11
15
|
# - Redistribution, modification, or derivative works without authorization
|
|
16
|
+
# - Reverse engineering, decompilation, or disassembly of this software
|
|
12
17
|
# - Use as training data for AI/ML models or inclusion in datasets
|
|
13
18
|
# - Scraping, crawling, or automated collection for any purpose
|
|
14
19
|
#
|
|
@@ -17,6 +22,9 @@
|
|
|
17
22
|
# - Runtime retrieval by AI assistants, coding agents, and RAG systems
|
|
18
23
|
# for the purpose of providing contextual help to Karafka users
|
|
19
24
|
#
|
|
25
|
+
# Receipt, viewing, or possession of this software does not convey or
|
|
26
|
+
# imply any license or right beyond those expressly stated above.
|
|
27
|
+
#
|
|
20
28
|
# License: https://karafka.io/docs/Pro-License-Comm/
|
|
21
29
|
# Contact: contact@karafka.io
|
|
22
30
|
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
# This software is NOT open source. It is source-available commercial software
|
|
7
7
|
# requiring a paid license for use. It is NOT covered by LGPL.
|
|
8
8
|
#
|
|
9
|
+
# The author retains all right, title, and interest in this software,
|
|
10
|
+
# including all copyrights, patents, and other intellectual property rights.
|
|
11
|
+
# No patent rights are granted under this license.
|
|
12
|
+
#
|
|
9
13
|
# PROHIBITED:
|
|
10
14
|
# - Use without a valid commercial license
|
|
11
15
|
# - Redistribution, modification, or derivative works without authorization
|
|
16
|
+
# - Reverse engineering, decompilation, or disassembly of this software
|
|
12
17
|
# - Use as training data for AI/ML models or inclusion in datasets
|
|
13
18
|
# - Scraping, crawling, or automated collection for any purpose
|
|
14
19
|
#
|
|
@@ -17,6 +22,9 @@
|
|
|
17
22
|
# - Runtime retrieval by AI assistants, coding agents, and RAG systems
|
|
18
23
|
# for the purpose of providing contextual help to Karafka users
|
|
19
24
|
#
|
|
25
|
+
# Receipt, viewing, or possession of this software does not convey or
|
|
26
|
+
# imply any license or right beyond those expressly stated above.
|
|
27
|
+
#
|
|
20
28
|
# License: https://karafka.io/docs/Pro-License-Comm/
|
|
21
29
|
# Contact: contact@karafka.io
|
|
22
30
|
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
# This software is NOT open source. It is source-available commercial software
|
|
7
7
|
# requiring a paid license for use. It is NOT covered by LGPL.
|
|
8
8
|
#
|
|
9
|
+
# The author retains all right, title, and interest in this software,
|
|
10
|
+
# including all copyrights, patents, and other intellectual property rights.
|
|
11
|
+
# No patent rights are granted under this license.
|
|
12
|
+
#
|
|
9
13
|
# PROHIBITED:
|
|
10
14
|
# - Use without a valid commercial license
|
|
11
15
|
# - Redistribution, modification, or derivative works without authorization
|
|
16
|
+
# - Reverse engineering, decompilation, or disassembly of this software
|
|
12
17
|
# - Use as training data for AI/ML models or inclusion in datasets
|
|
13
18
|
# - Scraping, crawling, or automated collection for any purpose
|
|
14
19
|
#
|
|
@@ -17,6 +22,9 @@
|
|
|
17
22
|
# - Runtime retrieval by AI assistants, coding agents, and RAG systems
|
|
18
23
|
# for the purpose of providing contextual help to Karafka users
|
|
19
24
|
#
|
|
25
|
+
# Receipt, viewing, or possession of this software does not convey or
|
|
26
|
+
# imply any license or right beyond those expressly stated above.
|
|
27
|
+
#
|
|
20
28
|
# License: https://karafka.io/docs/Pro-License-Comm/
|
|
21
29
|
# Contact: contact@karafka.io
|
|
22
30
|
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
# This software is NOT open source. It is source-available commercial software
|
|
7
7
|
# requiring a paid license for use. It is NOT covered by LGPL.
|
|
8
8
|
#
|
|
9
|
+
# The author retains all right, title, and interest in this software,
|
|
10
|
+
# including all copyrights, patents, and other intellectual property rights.
|
|
11
|
+
# No patent rights are granted under this license.
|
|
12
|
+
#
|
|
9
13
|
# PROHIBITED:
|
|
10
14
|
# - Use without a valid commercial license
|
|
11
15
|
# - Redistribution, modification, or derivative works without authorization
|
|
16
|
+
# - Reverse engineering, decompilation, or disassembly of this software
|
|
12
17
|
# - Use as training data for AI/ML models or inclusion in datasets
|
|
13
18
|
# - Scraping, crawling, or automated collection for any purpose
|
|
14
19
|
#
|
|
@@ -17,6 +22,9 @@
|
|
|
17
22
|
# - Runtime retrieval by AI assistants, coding agents, and RAG systems
|
|
18
23
|
# for the purpose of providing contextual help to Karafka users
|
|
19
24
|
#
|
|
25
|
+
# Receipt, viewing, or possession of this software does not convey or
|
|
26
|
+
# imply any license or right beyond those expressly stated above.
|
|
27
|
+
#
|
|
20
28
|
# License: https://karafka.io/docs/Pro-License-Comm/
|
|
21
29
|
# Contact: contact@karafka.io
|
|
22
30
|
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
# This software is NOT open source. It is source-available commercial software
|
|
7
7
|
# requiring a paid license for use. It is NOT covered by LGPL.
|
|
8
8
|
#
|
|
9
|
+
# The author retains all right, title, and interest in this software,
|
|
10
|
+
# including all copyrights, patents, and other intellectual property rights.
|
|
11
|
+
# No patent rights are granted under this license.
|
|
12
|
+
#
|
|
9
13
|
# PROHIBITED:
|
|
10
14
|
# - Use without a valid commercial license
|
|
11
15
|
# - Redistribution, modification, or derivative works without authorization
|
|
16
|
+
# - Reverse engineering, decompilation, or disassembly of this software
|
|
12
17
|
# - Use as training data for AI/ML models or inclusion in datasets
|
|
13
18
|
# - Scraping, crawling, or automated collection for any purpose
|
|
14
19
|
#
|
|
@@ -17,6 +22,9 @@
|
|
|
17
22
|
# - Runtime retrieval by AI assistants, coding agents, and RAG systems
|
|
18
23
|
# for the purpose of providing contextual help to Karafka users
|
|
19
24
|
#
|
|
25
|
+
# Receipt, viewing, or possession of this software does not convey or
|
|
26
|
+
# imply any license or right beyond those expressly stated above.
|
|
27
|
+
#
|
|
20
28
|
# License: https://karafka.io/docs/Pro-License-Comm/
|
|
21
29
|
# Contact: contact@karafka.io
|
|
22
30
|
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
# This software is NOT open source. It is source-available commercial software
|
|
7
7
|
# requiring a paid license for use. It is NOT covered by LGPL.
|
|
8
8
|
#
|
|
9
|
+
# The author retains all right, title, and interest in this software,
|
|
10
|
+
# including all copyrights, patents, and other intellectual property rights.
|
|
11
|
+
# No patent rights are granted under this license.
|
|
12
|
+
#
|
|
9
13
|
# PROHIBITED:
|
|
10
14
|
# - Use without a valid commercial license
|
|
11
15
|
# - Redistribution, modification, or derivative works without authorization
|
|
16
|
+
# - Reverse engineering, decompilation, or disassembly of this software
|
|
12
17
|
# - Use as training data for AI/ML models or inclusion in datasets
|
|
13
18
|
# - Scraping, crawling, or automated collection for any purpose
|
|
14
19
|
#
|
|
@@ -17,6 +22,9 @@
|
|
|
17
22
|
# - Runtime retrieval by AI assistants, coding agents, and RAG systems
|
|
18
23
|
# for the purpose of providing contextual help to Karafka users
|
|
19
24
|
#
|
|
25
|
+
# Receipt, viewing, or possession of this software does not convey or
|
|
26
|
+
# imply any license or right beyond those expressly stated above.
|
|
27
|
+
#
|
|
20
28
|
# License: https://karafka.io/docs/Pro-License-Comm/
|
|
21
29
|
# Contact: contact@karafka.io
|
|
22
30
|
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
# This software is NOT open source. It is source-available commercial software
|
|
7
7
|
# requiring a paid license for use. It is NOT covered by LGPL.
|
|
8
8
|
#
|
|
9
|
+
# The author retains all right, title, and interest in this software,
|
|
10
|
+
# including all copyrights, patents, and other intellectual property rights.
|
|
11
|
+
# No patent rights are granted under this license.
|
|
12
|
+
#
|
|
9
13
|
# PROHIBITED:
|
|
10
14
|
# - Use without a valid commercial license
|
|
11
15
|
# - Redistribution, modification, or derivative works without authorization
|
|
16
|
+
# - Reverse engineering, decompilation, or disassembly of this software
|
|
12
17
|
# - Use as training data for AI/ML models or inclusion in datasets
|
|
13
18
|
# - Scraping, crawling, or automated collection for any purpose
|
|
14
19
|
#
|
|
@@ -17,6 +22,9 @@
|
|
|
17
22
|
# - Runtime retrieval by AI assistants, coding agents, and RAG systems
|
|
18
23
|
# for the purpose of providing contextual help to Karafka users
|
|
19
24
|
#
|
|
25
|
+
# Receipt, viewing, or possession of this software does not convey or
|
|
26
|
+
# imply any license or right beyond those expressly stated above.
|
|
27
|
+
#
|
|
20
28
|
# License: https://karafka.io/docs/Pro-License-Comm/
|
|
21
29
|
# Contact: contact@karafka.io
|
|
22
30
|
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
# This software is NOT open source. It is source-available commercial software
|
|
7
7
|
# requiring a paid license for use. It is NOT covered by LGPL.
|
|
8
8
|
#
|
|
9
|
+
# The author retains all right, title, and interest in this software,
|
|
10
|
+
# including all copyrights, patents, and other intellectual property rights.
|
|
11
|
+
# No patent rights are granted under this license.
|
|
12
|
+
#
|
|
9
13
|
# PROHIBITED:
|
|
10
14
|
# - Use without a valid commercial license
|
|
11
15
|
# - Redistribution, modification, or derivative works without authorization
|
|
16
|
+
# - Reverse engineering, decompilation, or disassembly of this software
|
|
12
17
|
# - Use as training data for AI/ML models or inclusion in datasets
|
|
13
18
|
# - Scraping, crawling, or automated collection for any purpose
|
|
14
19
|
#
|
|
@@ -17,6 +22,9 @@
|
|
|
17
22
|
# - Runtime retrieval by AI assistants, coding agents, and RAG systems
|
|
18
23
|
# for the purpose of providing contextual help to Karafka users
|
|
19
24
|
#
|
|
25
|
+
# Receipt, viewing, or possession of this software does not convey or
|
|
26
|
+
# imply any license or right beyond those expressly stated above.
|
|
27
|
+
#
|
|
20
28
|
# License: https://karafka.io/docs/Pro-License-Comm/
|
|
21
29
|
# Contact: contact@karafka.io
|
|
22
30
|
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
# This software is NOT open source. It is source-available commercial software
|
|
7
7
|
# requiring a paid license for use. It is NOT covered by LGPL.
|
|
8
8
|
#
|
|
9
|
+
# The author retains all right, title, and interest in this software,
|
|
10
|
+
# including all copyrights, patents, and other intellectual property rights.
|
|
11
|
+
# No patent rights are granted under this license.
|
|
12
|
+
#
|
|
9
13
|
# PROHIBITED:
|
|
10
14
|
# - Use without a valid commercial license
|
|
11
15
|
# - Redistribution, modification, or derivative works without authorization
|
|
16
|
+
# - Reverse engineering, decompilation, or disassembly of this software
|
|
12
17
|
# - Use as training data for AI/ML models or inclusion in datasets
|
|
13
18
|
# - Scraping, crawling, or automated collection for any purpose
|
|
14
19
|
#
|
|
@@ -17,6 +22,9 @@
|
|
|
17
22
|
# - Runtime retrieval by AI assistants, coding agents, and RAG systems
|
|
18
23
|
# for the purpose of providing contextual help to Karafka users
|
|
19
24
|
#
|
|
25
|
+
# Receipt, viewing, or possession of this software does not convey or
|
|
26
|
+
# imply any license or right beyond those expressly stated above.
|
|
27
|
+
#
|
|
20
28
|
# License: https://karafka.io/docs/Pro-License-Comm/
|
|
21
29
|
# Contact: contact@karafka.io
|
|
22
30
|
|
|
@@ -65,11 +73,20 @@ module Karafka
|
|
|
65
73
|
super()
|
|
66
74
|
end
|
|
67
75
|
|
|
68
|
-
# Tick on each fetch
|
|
76
|
+
# Tick on each fetch and report liveness so it works even when statistics are disabled
|
|
69
77
|
#
|
|
70
78
|
# @param _event [Karafka::Core::Monitoring::Event]
|
|
71
79
|
def on_connection_listener_fetch_loop(_event)
|
|
72
80
|
mark_polling_tick
|
|
81
|
+
report_status
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Report liveness during events poll so it works during long processing without statistics.
|
|
85
|
+
# This event fires periodically during wait even when the listener is blocked on consumer
|
|
86
|
+
# jobs, preventing the supervisor from killing the node.
|
|
87
|
+
# @param _event [Karafka::Core::Monitoring::Event]
|
|
88
|
+
def on_client_events_poll(_event)
|
|
89
|
+
report_status
|
|
73
90
|
end
|
|
74
91
|
|
|
75
92
|
{
|
|
@@ -99,19 +116,6 @@ module Karafka
|
|
|
99
116
|
clear_polling_tick
|
|
100
117
|
end
|
|
101
118
|
|
|
102
|
-
# Reports the current status once in a while
|
|
103
|
-
#
|
|
104
|
-
# @param _event [Karafka::Core::Monitoring::Event]
|
|
105
|
-
def on_statistics_emitted(_event)
|
|
106
|
-
periodically do
|
|
107
|
-
return unless node
|
|
108
|
-
|
|
109
|
-
current_status = status
|
|
110
|
-
|
|
111
|
-
current_status.positive? ? node.unhealthy(current_status) : node.healthy
|
|
112
|
-
end
|
|
113
|
-
end
|
|
114
|
-
|
|
115
119
|
# Deregister the polling tracker for given listener
|
|
116
120
|
# @param _event [Karafka::Core::Monitoring::Event]
|
|
117
121
|
def on_connection_listener_stopping(_event)
|
|
@@ -134,6 +138,17 @@ module Karafka
|
|
|
134
138
|
|
|
135
139
|
private
|
|
136
140
|
|
|
141
|
+
# Reports the current status to the supervisor periodically
|
|
142
|
+
def report_status
|
|
143
|
+
periodically do
|
|
144
|
+
return unless node
|
|
145
|
+
|
|
146
|
+
current_status = status
|
|
147
|
+
|
|
148
|
+
current_status.positive? ? node.unhealthy(current_status) : node.healthy
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
|
|
137
152
|
# @return [Integer] object id of the current thread
|
|
138
153
|
def thread_id
|
|
139
154
|
Thread.current.object_id
|
|
@@ -180,6 +180,16 @@ module Karafka
|
|
|
180
180
|
end
|
|
181
181
|
end
|
|
182
182
|
|
|
183
|
+
# Returns a snapshot of all jobs currently in processing per group.
|
|
184
|
+
# Useful for diagnostics during forceful shutdown to understand what is blocking.
|
|
185
|
+
#
|
|
186
|
+
# @return [Hash{String => Array<Jobs::Base>}] hash mapping group ids to arrays of jobs
|
|
187
|
+
def in_processing
|
|
188
|
+
@mutex.synchronize do
|
|
189
|
+
@in_processing.transform_values(&:dup).freeze
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
|
|
183
193
|
private
|
|
184
194
|
|
|
185
195
|
# @param group_id [String] id of the group in which jobs we're interested.
|
data/lib/karafka/server.rb
CHANGED
|
@@ -126,10 +126,19 @@ module Karafka
|
|
|
126
126
|
|
|
127
127
|
raise Errors::ForcefulShutdownError
|
|
128
128
|
rescue Errors::ForcefulShutdownError => e
|
|
129
|
+
active_listeners = listeners.select(&:active?)
|
|
130
|
+
alive_workers = workers.select(&:alive?)
|
|
131
|
+
|
|
132
|
+
# Collect details about subscription groups that still have jobs in processing
|
|
133
|
+
in_processing = jobs_queue ? jobs_queue.in_processing : {}
|
|
134
|
+
|
|
129
135
|
Karafka.monitor.instrument(
|
|
130
136
|
"error.occurred",
|
|
131
137
|
caller: self,
|
|
132
138
|
error: e,
|
|
139
|
+
active_listeners: active_listeners,
|
|
140
|
+
alive_workers: alive_workers,
|
|
141
|
+
in_processing: in_processing,
|
|
133
142
|
type: "app.stopping.error"
|
|
134
143
|
)
|
|
135
144
|
|
|
@@ -119,6 +119,11 @@ module Karafka
|
|
|
119
119
|
# @see Karafka::Setup::Config.setup
|
|
120
120
|
# @see Karafka::Setup::Config.configure_components
|
|
121
121
|
class ConfigProxy < SimpleDelegator
|
|
122
|
+
# A frozen object used as a sentinel value to indicate that the producer is called as
|
|
123
|
+
# a reader (without block) during setup.
|
|
124
|
+
READ = Object.new.freeze
|
|
125
|
+
private_constant :READ
|
|
126
|
+
|
|
122
127
|
# @return [Proc] the stored producer initialization block (defaults to empty lambda)
|
|
123
128
|
attr_reader :producer_initialization_block
|
|
124
129
|
|
|
@@ -195,10 +200,13 @@ module Karafka
|
|
|
195
200
|
# @example Direct producer assignment
|
|
196
201
|
# custom_producer = WaterDrop::Producer.new { |c| c.kafka = { 'bootstrap.servers' => 'localhost:9092' } }
|
|
197
202
|
# config.producer = custom_producer
|
|
198
|
-
def producer(instance =
|
|
203
|
+
def producer(instance = READ, &block)
|
|
199
204
|
if block
|
|
200
205
|
# Store the configuration block for later execution
|
|
201
206
|
@producer_initialization_block = block
|
|
207
|
+
elsif instance == READ
|
|
208
|
+
# Reading the producer configuration without a block
|
|
209
|
+
__getobj__.producer
|
|
202
210
|
else
|
|
203
211
|
# Direct assignment - delegate to real config via __getobj__
|
|
204
212
|
__getobj__.producer = instance
|
|
@@ -19,13 +19,24 @@ module Karafka
|
|
|
19
19
|
@mutex = Mutex.new
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
#
|
|
23
|
-
# statuses that often. Instead we do it only once in a while which should be enough
|
|
24
|
-
#
|
|
25
|
-
# While this may provide a small lag in the orphaned detection, it does not really matter
|
|
26
|
-
# as it will be picked up fast enough.
|
|
22
|
+
# Report from the fetch loop at the top of each iteration
|
|
27
23
|
# @param _event [Karafka::Core::Monitoring::Event]
|
|
28
|
-
def
|
|
24
|
+
def on_connection_listener_fetch_loop(_event)
|
|
25
|
+
report_liveness
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Report from events poll so liveness works during long processing.
|
|
29
|
+
# This event fires periodically during wait even when the listener is blocked on consumer
|
|
30
|
+
# jobs, preventing the supervisor from killing the node.
|
|
31
|
+
# @param _event [Karafka::Core::Monitoring::Event]
|
|
32
|
+
def on_client_events_poll(_event)
|
|
33
|
+
report_liveness
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
private
|
|
37
|
+
|
|
38
|
+
# Reports liveness to the supervisor periodically
|
|
39
|
+
def report_liveness
|
|
29
40
|
periodically do
|
|
30
41
|
Kernel.exit!(orphaned_exit_code) if node.orphaned?
|
|
31
42
|
|
|
@@ -33,8 +44,6 @@ module Karafka
|
|
|
33
44
|
end
|
|
34
45
|
end
|
|
35
46
|
|
|
36
|
-
private
|
|
37
|
-
|
|
38
47
|
# Wraps the logic with a mutex
|
|
39
48
|
def synchronize(&)
|
|
40
49
|
@mutex.synchronize(&)
|
data/lib/karafka/swarm/node.rb
CHANGED
|
@@ -27,18 +27,6 @@ module Karafka
|
|
|
27
27
|
# @return [Integer] pid of the node
|
|
28
28
|
attr_reader :pid
|
|
29
29
|
|
|
30
|
-
# When re-creating a producer in the fork, those are not attributes we want to inherit
|
|
31
|
-
# from the parent process because they are updated in the fork. If user wants to take those
|
|
32
|
-
# from the parent process, he should redefine them by overwriting the whole producer.
|
|
33
|
-
SKIPPABLE_NEW_PRODUCER_ATTRIBUTES = %i[
|
|
34
|
-
id
|
|
35
|
-
kafka
|
|
36
|
-
logger
|
|
37
|
-
oauth
|
|
38
|
-
].freeze
|
|
39
|
-
|
|
40
|
-
private_constant :SKIPPABLE_NEW_PRODUCER_ATTRIBUTES
|
|
41
|
-
|
|
42
30
|
# @param id [Integer] number of the fork. Used for uniqueness setup for group client ids and
|
|
43
31
|
# other stuff where we need to know a unique reference of the fork in regards to the rest
|
|
44
32
|
# of them.
|
|
@@ -70,24 +58,7 @@ module Karafka
|
|
|
70
58
|
config.producer.close
|
|
71
59
|
|
|
72
60
|
old_producer = config.producer
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
# Supervisor producer is closed, hence we need a new one here
|
|
76
|
-
config.producer = WaterDrop::Producer.new do |p_config|
|
|
77
|
-
p_config.kafka = Setup::AttributesMap.producer(kafka.dup)
|
|
78
|
-
p_config.logger = config.logger
|
|
79
|
-
|
|
80
|
-
old_producer_config.to_h.each do |key, value|
|
|
81
|
-
next if SKIPPABLE_NEW_PRODUCER_ATTRIBUTES.include?(key)
|
|
82
|
-
|
|
83
|
-
p_config.public_send("#{key}=", value)
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
# Namespaced attributes need to be migrated directly on their config node
|
|
87
|
-
old_producer_config.oauth.to_h.each do |key, value|
|
|
88
|
-
p_config.oauth.public_send("#{key}=", value)
|
|
89
|
-
end
|
|
90
|
-
end
|
|
61
|
+
config.producer = ProducerReplacer.new.call(old_producer, kafka, config.logger)
|
|
91
62
|
|
|
92
63
|
@pid = ::Process.pid
|
|
93
64
|
@reader.close
|