karafka 2.5.4 → 2.5.5
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 +3 -0
- data/LICENSE-COMM +4 -2
- data/lib/karafka/admin/acl.rb +127 -80
- data/lib/karafka/admin/configs.rb +84 -70
- data/lib/karafka/admin/consumer_groups.rb +377 -330
- data/lib/karafka/admin/replication.rb +287 -263
- data/lib/karafka/admin/topics.rb +232 -186
- data/lib/karafka/admin.rb +277 -117
- data/lib/karafka/pro/active_job/consumer.rb +19 -2
- data/lib/karafka/pro/active_job/dispatcher.rb +19 -2
- data/lib/karafka/pro/active_job/job_options_contract.rb +19 -2
- data/lib/karafka/pro/base_consumer.rb +19 -2
- data/lib/karafka/pro/cleaner/errors.rb +19 -2
- data/lib/karafka/pro/cleaner/messages/message.rb +19 -2
- data/lib/karafka/pro/cleaner/messages/messages.rb +19 -2
- data/lib/karafka/pro/cleaner/messages/metadata.rb +19 -2
- data/lib/karafka/pro/cleaner.rb +19 -2
- data/lib/karafka/pro/cli/contracts/server.rb +19 -2
- data/lib/karafka/pro/cli/parallel_segments/base.rb +19 -2
- data/lib/karafka/pro/cli/parallel_segments/collapse.rb +19 -2
- data/lib/karafka/pro/cli/parallel_segments/distribute.rb +19 -2
- data/lib/karafka/pro/cli/parallel_segments.rb +19 -2
- data/lib/karafka/pro/connection/manager.rb +19 -2
- data/lib/karafka/pro/connection/multiplexing/listener.rb +19 -2
- data/lib/karafka/pro/contracts/base.rb +19 -2
- data/lib/karafka/pro/encryption/cipher.rb +19 -2
- data/lib/karafka/pro/encryption/contracts/config.rb +19 -2
- data/lib/karafka/pro/encryption/errors.rb +19 -2
- data/lib/karafka/pro/encryption/messages/middleware.rb +19 -2
- data/lib/karafka/pro/encryption/messages/parser.rb +19 -2
- data/lib/karafka/pro/encryption/setup/config.rb +19 -2
- data/lib/karafka/pro/encryption.rb +19 -2
- data/lib/karafka/pro/instrumentation/performance_tracker.rb +19 -2
- data/lib/karafka/pro/iterator/expander.rb +19 -2
- data/lib/karafka/pro/iterator/tpl_builder.rb +19 -2
- data/lib/karafka/pro/iterator.rb +19 -2
- data/lib/karafka/pro/loader.rb +19 -2
- data/lib/karafka/pro/processing/adaptive_iterator/consumer.rb +19 -2
- data/lib/karafka/pro/processing/adaptive_iterator/tracker.rb +19 -2
- data/lib/karafka/pro/processing/collapser.rb +19 -2
- data/lib/karafka/pro/processing/coordinator.rb +19 -2
- data/lib/karafka/pro/processing/coordinators/errors_tracker.rb +19 -2
- data/lib/karafka/pro/processing/coordinators/filters_applier.rb +19 -2
- data/lib/karafka/pro/processing/coordinators/virtual_offset_manager.rb +19 -2
- data/lib/karafka/pro/processing/executor.rb +19 -2
- data/lib/karafka/pro/processing/expansions_selector.rb +19 -2
- data/lib/karafka/pro/processing/filters/base.rb +19 -2
- data/lib/karafka/pro/processing/filters/delayer.rb +19 -2
- data/lib/karafka/pro/processing/filters/expirer.rb +19 -2
- data/lib/karafka/pro/processing/filters/inline_insights_delayer.rb +19 -2
- data/lib/karafka/pro/processing/filters/throttler.rb +19 -2
- data/lib/karafka/pro/processing/filters/virtual_limiter.rb +19 -2
- data/lib/karafka/pro/processing/jobs/consume_non_blocking.rb +19 -2
- data/lib/karafka/pro/processing/jobs/eofed_non_blocking.rb +19 -2
- data/lib/karafka/pro/processing/jobs/periodic.rb +19 -2
- data/lib/karafka/pro/processing/jobs/periodic_non_blocking.rb +19 -2
- data/lib/karafka/pro/processing/jobs/revoked_non_blocking.rb +19 -2
- data/lib/karafka/pro/processing/jobs_builder.rb +19 -2
- data/lib/karafka/pro/processing/jobs_queue.rb +19 -2
- data/lib/karafka/pro/processing/offset_metadata/consumer.rb +19 -2
- data/lib/karafka/pro/processing/offset_metadata/fetcher.rb +19 -2
- data/lib/karafka/pro/processing/offset_metadata/listener.rb +19 -2
- data/lib/karafka/pro/processing/parallel_segments/filters/base.rb +19 -2
- data/lib/karafka/pro/processing/parallel_segments/filters/default.rb +19 -2
- data/lib/karafka/pro/processing/parallel_segments/filters/mom.rb +19 -2
- data/lib/karafka/pro/processing/partitioner.rb +19 -2
- data/lib/karafka/pro/processing/periodic_job/consumer.rb +19 -2
- data/lib/karafka/pro/processing/piping/consumer.rb +19 -2
- data/lib/karafka/pro/processing/schedulers/base.rb +19 -2
- data/lib/karafka/pro/processing/schedulers/default.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_lrj_mom.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_lrj_mom_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_mom.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_mom_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/dlq_lrj_mom.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/dlq_lrj_mom_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/dlq_mom.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/dlq_mom_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/ftr_lrj_mom.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/ftr_lrj_mom_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/ftr_mom.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/ftr_mom_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/lrj_mom.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/lrj_mom_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/mom.rb +19 -2
- data/lib/karafka/pro/processing/strategies/aj/mom_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/base.rb +19 -2
- data/lib/karafka/pro/processing/strategies/default.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/default.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/ftr.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_mom.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_mom_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/ftr_mom.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/ftr_mom_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/ftr_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/lrj.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/lrj_mom.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/lrj_mom_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/lrj_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/mom.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/mom_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/dlq/vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/ftr/default.rb +19 -2
- data/lib/karafka/pro/processing/strategies/ftr/vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/lrj/default.rb +19 -2
- data/lib/karafka/pro/processing/strategies/lrj/ftr.rb +19 -2
- data/lib/karafka/pro/processing/strategies/lrj/ftr_mom.rb +19 -2
- data/lib/karafka/pro/processing/strategies/lrj/ftr_mom_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/lrj/ftr_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/lrj/mom.rb +19 -2
- data/lib/karafka/pro/processing/strategies/lrj/mom_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/lrj/vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/mom/default.rb +19 -2
- data/lib/karafka/pro/processing/strategies/mom/ftr.rb +19 -2
- data/lib/karafka/pro/processing/strategies/mom/ftr_vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/mom/vp.rb +19 -2
- data/lib/karafka/pro/processing/strategies/vp/default.rb +19 -2
- data/lib/karafka/pro/processing/strategies.rb +19 -2
- data/lib/karafka/pro/processing/strategy_selector.rb +19 -2
- data/lib/karafka/pro/processing/subscription_groups_coordinator.rb +19 -2
- data/lib/karafka/pro/processing/virtual_partitions/distributors/balanced.rb +19 -2
- data/lib/karafka/pro/processing/virtual_partitions/distributors/base.rb +19 -2
- data/lib/karafka/pro/processing/virtual_partitions/distributors/consistent.rb +19 -2
- data/lib/karafka/pro/recurring_tasks/consumer.rb +19 -2
- data/lib/karafka/pro/recurring_tasks/contracts/config.rb +19 -2
- data/lib/karafka/pro/recurring_tasks/contracts/task.rb +19 -2
- data/lib/karafka/pro/recurring_tasks/deserializer.rb +19 -2
- data/lib/karafka/pro/recurring_tasks/dispatcher.rb +19 -2
- data/lib/karafka/pro/recurring_tasks/errors.rb +19 -2
- data/lib/karafka/pro/recurring_tasks/executor.rb +19 -2
- data/lib/karafka/pro/recurring_tasks/listener.rb +19 -2
- data/lib/karafka/pro/recurring_tasks/matcher.rb +19 -2
- data/lib/karafka/pro/recurring_tasks/schedule.rb +19 -2
- data/lib/karafka/pro/recurring_tasks/serializer.rb +19 -2
- data/lib/karafka/pro/recurring_tasks/setup/config.rb +19 -2
- data/lib/karafka/pro/recurring_tasks/task.rb +19 -2
- data/lib/karafka/pro/recurring_tasks.rb +19 -2
- data/lib/karafka/pro/routing/features/active_job/builder.rb +19 -2
- data/lib/karafka/pro/routing/features/active_job.rb +19 -2
- data/lib/karafka/pro/routing/features/adaptive_iterator/config.rb +19 -2
- data/lib/karafka/pro/routing/features/adaptive_iterator/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/adaptive_iterator/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/adaptive_iterator.rb +19 -2
- data/lib/karafka/pro/routing/features/base.rb +19 -2
- data/lib/karafka/pro/routing/features/dead_letter_queue/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/dead_letter_queue/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/dead_letter_queue.rb +19 -2
- data/lib/karafka/pro/routing/features/delaying/config.rb +19 -2
- data/lib/karafka/pro/routing/features/delaying/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/delaying/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/delaying.rb +19 -2
- data/lib/karafka/pro/routing/features/direct_assignments/config.rb +19 -2
- data/lib/karafka/pro/routing/features/direct_assignments/contracts/consumer_group.rb +19 -2
- data/lib/karafka/pro/routing/features/direct_assignments/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/direct_assignments/subscription_group.rb +19 -2
- data/lib/karafka/pro/routing/features/direct_assignments/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/direct_assignments.rb +19 -2
- data/lib/karafka/pro/routing/features/expiring/config.rb +19 -2
- data/lib/karafka/pro/routing/features/expiring/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/expiring/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/expiring.rb +19 -2
- data/lib/karafka/pro/routing/features/filtering/config.rb +19 -2
- data/lib/karafka/pro/routing/features/filtering/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/filtering/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/filtering.rb +19 -2
- data/lib/karafka/pro/routing/features/inline_insights/config.rb +19 -2
- data/lib/karafka/pro/routing/features/inline_insights/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/inline_insights/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/inline_insights.rb +19 -2
- data/lib/karafka/pro/routing/features/long_running_job/config.rb +19 -2
- data/lib/karafka/pro/routing/features/long_running_job/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/long_running_job/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/long_running_job.rb +19 -2
- data/lib/karafka/pro/routing/features/multiplexing/config.rb +19 -2
- data/lib/karafka/pro/routing/features/multiplexing/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/multiplexing/patches/contracts/consumer_group.rb +19 -2
- data/lib/karafka/pro/routing/features/multiplexing/proxy.rb +19 -2
- data/lib/karafka/pro/routing/features/multiplexing/subscription_group.rb +19 -2
- data/lib/karafka/pro/routing/features/multiplexing/subscription_groups_builder.rb +19 -2
- data/lib/karafka/pro/routing/features/multiplexing.rb +19 -2
- data/lib/karafka/pro/routing/features/non_blocking_job/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/non_blocking_job.rb +19 -2
- data/lib/karafka/pro/routing/features/offset_metadata/config.rb +19 -2
- data/lib/karafka/pro/routing/features/offset_metadata/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/offset_metadata/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/offset_metadata.rb +19 -2
- data/lib/karafka/pro/routing/features/parallel_segments/builder.rb +19 -2
- data/lib/karafka/pro/routing/features/parallel_segments/config.rb +19 -2
- data/lib/karafka/pro/routing/features/parallel_segments/consumer_group.rb +19 -2
- data/lib/karafka/pro/routing/features/parallel_segments/contracts/consumer_group.rb +19 -2
- data/lib/karafka/pro/routing/features/parallel_segments/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/parallel_segments.rb +19 -2
- data/lib/karafka/pro/routing/features/patterns/builder.rb +19 -2
- data/lib/karafka/pro/routing/features/patterns/config.rb +19 -2
- data/lib/karafka/pro/routing/features/patterns/consumer_group.rb +19 -2
- data/lib/karafka/pro/routing/features/patterns/contracts/consumer_group.rb +19 -2
- data/lib/karafka/pro/routing/features/patterns/contracts/pattern.rb +19 -2
- data/lib/karafka/pro/routing/features/patterns/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/patterns/detector.rb +19 -2
- data/lib/karafka/pro/routing/features/patterns/pattern.rb +19 -2
- data/lib/karafka/pro/routing/features/patterns/patterns.rb +19 -2
- data/lib/karafka/pro/routing/features/patterns/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/patterns/topics.rb +19 -2
- data/lib/karafka/pro/routing/features/patterns.rb +19 -2
- data/lib/karafka/pro/routing/features/pausing/config.rb +19 -2
- data/lib/karafka/pro/routing/features/pausing/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/pausing/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/pausing.rb +19 -2
- data/lib/karafka/pro/routing/features/periodic_job/config.rb +19 -2
- data/lib/karafka/pro/routing/features/periodic_job/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/periodic_job/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/periodic_job.rb +19 -2
- data/lib/karafka/pro/routing/features/recurring_tasks/builder.rb +19 -2
- data/lib/karafka/pro/routing/features/recurring_tasks/config.rb +19 -2
- data/lib/karafka/pro/routing/features/recurring_tasks/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/recurring_tasks/proxy.rb +19 -2
- data/lib/karafka/pro/routing/features/recurring_tasks/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/recurring_tasks.rb +19 -2
- data/lib/karafka/pro/routing/features/scheduled_messages/builder.rb +19 -2
- data/lib/karafka/pro/routing/features/scheduled_messages/config.rb +19 -2
- data/lib/karafka/pro/routing/features/scheduled_messages/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/scheduled_messages/proxy.rb +19 -2
- data/lib/karafka/pro/routing/features/scheduled_messages/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/scheduled_messages.rb +19 -2
- data/lib/karafka/pro/routing/features/swarm/config.rb +19 -2
- data/lib/karafka/pro/routing/features/swarm/contracts/routing.rb +19 -2
- data/lib/karafka/pro/routing/features/swarm/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/swarm/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/swarm.rb +19 -2
- data/lib/karafka/pro/routing/features/throttling/config.rb +19 -2
- data/lib/karafka/pro/routing/features/throttling/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/throttling/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/throttling.rb +19 -2
- data/lib/karafka/pro/routing/features/virtual_partitions/config.rb +19 -2
- data/lib/karafka/pro/routing/features/virtual_partitions/contracts/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/virtual_partitions/topic.rb +19 -2
- data/lib/karafka/pro/routing/features/virtual_partitions.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/consumer.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/contracts/config.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/contracts/message.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/daily_buffer.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/day.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/deserializers/headers.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/deserializers/payload.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/dispatcher.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/errors.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/max_epoch.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/proxy.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/schema_validator.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/serializer.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/setup/config.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/state.rb +19 -2
- data/lib/karafka/pro/scheduled_messages/tracker.rb +19 -2
- data/lib/karafka/pro/scheduled_messages.rb +19 -2
- data/lib/karafka/pro/swarm/liveness_listener.rb +19 -2
- data/lib/karafka/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 664c8ed7d20d66153422c1b9e2475fbcaa166c7a62c938170a5909e48e1d9f99
|
|
4
|
+
data.tar.gz: 973f79843261ef8dd002b2f13aa13e939e1e6b6d2f45ab8358af2a347c357c47
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 27df04323e3b2851c14dc01a9e34c4b6c21b5eec48eeb493e6c5c4941ce419c0cd8adc45c3cb898d377632af4e42750092b81fa0e46ee472556a357c9bbcc67f
|
|
7
|
+
data.tar.gz: 6a7d33572e7b3b71cb41dc16a92b4581a964429fc246f82792a7ba74bcb1b56b870225ada7232e46dba3f1ef05923140a0b488b513d3a223b5890a7d4ff77df4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Karafka Framework Changelog
|
|
2
2
|
|
|
3
|
+
## 2.5.5 (2026-01-24)
|
|
4
|
+
- [Feature] Add multi-cluster Admin support via `Karafka::Admin.new(kafka: { ... })` allowing operations against different Kafka clusters while maintaining backward compatibility with existing class-method API.
|
|
5
|
+
|
|
3
6
|
## 2.5.4 (2025-12-28)
|
|
4
7
|
- [Enhancement] Align Datadog logger listener error handling with the main logger listener by adding missing error types and replacing `UnsupportedCaseError` with generic error logging to support dynamic errors reporting.
|
|
5
8
|
- [Enhancement] Align Appsignal metrics listener `USER_CONSUMER_ERROR_TYPES` with all consumer error types for complete error tracking.
|
data/LICENSE-COMM
CHANGED
|
@@ -22,10 +22,12 @@ In order to use the Software under this Agreement, you must either: (a) receive
|
|
|
22
22
|
|
|
23
23
|
3. Restricted Uses.
|
|
24
24
|
|
|
25
|
-
3.1 You shall not (and shall not allow any third party to): (a) decompile, disassemble, or otherwise reverse engineer the Software or attempt to reconstruct or discover any source code, underlying ideas, algorithms, file formats or programming interfaces of the Software by any means whatsoever (except and only to the extent that applicable law prohibits or restricts reverse engineering restrictions); (b) distribute, sell, sublicense, rent, lease or use the Software for time sharing, hosting, service provider or like purposes, except as expressly permitted under this Agreement; (c) redistribute the Software or Modifications other than by including the Software or a portion thereof within your own product, which must have substantially different functionality than the Software or Modifications and must not allow any third party to use the Software or Modifications, or any portions thereof, for software development or application development purposes; (d) redistribute the Software as part of a product, "appliance" or "virtual server"; (e) redistribute the Software on any server which is not directly under your control; (f) remove any product identification, proprietary, copyright or other notices contained in the Software; (g) modify any part of the Software, create a derivative work of any part of the Software (except as permitted in Section 2), or incorporate the Software, except to the extent expressly authorized in writing by Maciej Mensfeld; (h) publicly disseminate performance information or analysis (including, without limitation, benchmarks) from any source relating to the Software; (i) utilize any equipment, device, software, or other means designed to circumvent or remove any form of Source URL or copy protection used by Maciej Mensfeld in connection with the Software, or use the Software together with any authorization code, Source URL, serial number, or other copy protection device not supplied by Maciej Mensfeld; (j) use the Software to develop a product which is competitive with any Maciej Mensfeld product offerings;
|
|
25
|
+
3.1 You shall not (and shall not allow any third party to): (a) decompile, disassemble, or otherwise reverse engineer the Software or attempt to reconstruct or discover any source code, underlying ideas, algorithms, file formats or programming interfaces of the Software by any means whatsoever (except and only to the extent that applicable law prohibits or restricts reverse engineering restrictions); (b) distribute, sell, sublicense, rent, lease or use the Software for time sharing, hosting, service provider or like purposes, except as expressly permitted under this Agreement; (c) redistribute the Software or Modifications other than by including the Software or a portion thereof within your own product, which must have substantially different functionality than the Software or Modifications and must not allow any third party to use the Software or Modifications, or any portions thereof, for software development or application development purposes; (d) redistribute the Software as part of a product, "appliance" or "virtual server"; (e) redistribute the Software on any server which is not directly under your control; (f) remove any product identification, proprietary, copyright or other notices contained in the Software; (g) modify any part of the Software, create a derivative work of any part of the Software (except as permitted in Section 2), or incorporate the Software, except to the extent expressly authorized in writing by Maciej Mensfeld; (h) publicly disseminate performance information or analysis (including, without limitation, benchmarks) from any source relating to the Software; (i) utilize any equipment, device, software, or other means designed to circumvent or remove any form of Source URL or copy protection used by Maciej Mensfeld in connection with the Software, or use the Software together with any authorization code, Source URL, serial number, or other copy protection device not supplied by Maciej Mensfeld; (j) use the Software to develop a product which is competitive with any Maciej Mensfeld product offerings; (k) use unauthorized Source URLS or keycode(s) or distribute or publish Source URLs or keycode(s), except as may be expressly permitted by Maciej Mensfeld in writing. If your unique Source URL or the offline license is ever published, Maciej Mensfeld reserves the right to terminate your access without notice; (l) use the Software, its source code, documentation, or any portion thereof as training data, input, or reference material for any machine learning system, artificial intelligence model, neural network, large language model, code generation tool, or similar automated system, whether for commercial or non-commercial purposes; (m) include the Software, its source code, or any portion thereof in any dataset, corpus, or collection intended for machine learning, artificial intelligence training, or automated code analysis, regardless of whether such dataset is publicly distributed or used internally; (n) use automated tools, scripts, crawlers, or similar technologies to systematically access, scrape, copy, or collect the Software or its source code, except for the limited purpose of cloning the repository for licensed use; or (o) create, distribute, or commercialize any product, service, or tool that was developed using knowledge, patterns, or code derived from the Software through machine learning or artificial intelligence systems.
|
|
26
26
|
|
|
27
27
|
3.2 UNDER NO CIRCUMSTANCES MAY YOU USE THE SOFTWARE AS PART OF A PRODUCT OR SERVICE THAT PROVIDES SIMILAR FUNCTIONALITY TO THE SOFTWARE ITSELF.
|
|
28
28
|
|
|
29
|
+
3.3 ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING PROHIBITION. WITHOUT LIMITING THE GENERALITY OF SECTION 3.1, THE SOFTWARE AND ITS SOURCE CODE MAY NOT BE USED IN ANY MANNER TO TRAIN, DEVELOP, IMPROVE, OR VALIDATE ANY ARTIFICIAL INTELLIGENCE OR MACHINE LEARNING SYSTEM. THIS PROHIBITION APPLIES REGARDLESS OF WHETHER THE SOFTWARE IS ACCESSED DIRECTLY, THROUGH AUTOMATED MEANS, OR VIA THIRD-PARTY DATASETS OR SERVICES. ANY SUCH USE CONSTITUTES A MATERIAL BREACH OF THIS AGREEMENT AND MAY RESULT IN IMMEDIATE TERMINATION OF YOUR LICENSE AND PURSUIT OF ALL AVAILABLE LEGAL REMEDIES. For clarity, this prohibition applies to the training and development of AI systems, and does not restrict licensed users from utilizing AI-powered development tools in the ordinary course of developing software that integrates with the Software.
|
|
30
|
+
|
|
29
31
|
The Open Source version of the Software ("LGPL Version") is licensed under the terms of the GNU Lesser General Public License version 3.0 ("LGPL") and not under this EULA.
|
|
30
32
|
|
|
31
33
|
4. Ownership. Notwithstanding anything to the contrary contained herein, except for the limited license rights expressly provided herein, Maciej Mensfeld and its suppliers have and will retain all rights, title and interest (including, without limitation, all patent, copyright, trademark, trade secret and other intellectual property rights) in and to the Software and all copies, modifications and derivative works thereof (including any changes which incorporate any of your ideas, feedback or suggestions). You acknowledge that you are obtaining only a limited license right to the Software, and that irrespective of any use of the words "purchase", "sale" or like terms hereunder no ownership rights are being conveyed to you under this Agreement or otherwise.
|
|
@@ -36,7 +38,7 @@ The Open Source version of the Software ("LGPL Version") is licensed under the t
|
|
|
36
38
|
|
|
37
39
|
7. Term of Agreement.
|
|
38
40
|
|
|
39
|
-
7.1 Term. This Agreement is effective as of the Delivery of the Software and expires at such time as all license and service subscriptions hereunder have expired in accordance with their own terms (the "Term"). For clarification, the term of your license under this Agreement may be perpetual, limited for Evaluation Version, or designated as a fixed-term license in the Invoice, and shall be specified at your time of purchase. Either party may terminate this Agreement (including all related Invoices) if the other party: (a) fails to cure any material breach of this Agreement within thirty (30) days after written notice of such breach, provided that Maciej Mensfeld may terminate this Agreement immediately upon any breach of Section 3 or if you exceed any other restrictions contained in Section 1, unless otherwise specified in this agreement; (b) ceases operation without a successor; or (c) seeks protection under any bankruptcy, receivership, trust deed, creditors arrangement, composition or comparable proceeding, or if any such proceeding is instituted against such party (and not dismissed within sixty (60) days)). Termination is not an exclusive remedy and the exercise by either party of any remedy under this Agreement will be without prejudice to any other remedies it may have under this Agreement, by law, or otherwise.
|
|
41
|
+
7.1 Term. This Agreement is effective as of the Delivery of the Software and expires at such time as all license and service subscriptions hereunder have expired in accordance with their own terms (the "Term"). For clarification, the term of your license under this Agreement may be perpetual, limited for Evaluation Version, or designated as a fixed-term license in the Invoice, and shall be specified at your time of purchase. Either party may terminate this Agreement (including all related Invoices) if the other party: (a) fails to cure any material breach of this Agreement within thirty (30) days after written notice of such breach, provided that Maciej Mensfeld may terminate this Agreement immediately upon any breach of Section 3 (including, without limitation, any use of the Software for artificial intelligence or machine learning purposes as described in Section 3.3) or if you exceed any other restrictions contained in Section 1, unless otherwise specified in this agreement; (b) ceases operation without a successor; or (c) seeks protection under any bankruptcy, receivership, trust deed, creditors arrangement, composition or comparable proceeding, or if any such proceeding is instituted against such party (and not dismissed within sixty (60) days)). Termination is not an exclusive remedy and the exercise by either party of any remedy under this Agreement will be without prejudice to any other remedies it may have under this Agreement, by law, or otherwise.
|
|
40
42
|
|
|
41
43
|
7.2 Termination. Upon any termination of this Agreement, you shall cease any and all use of any Software and destroy all copies thereof.
|
|
42
44
|
|
data/lib/karafka/admin/acl.rb
CHANGED
|
@@ -106,89 +106,84 @@ module Karafka
|
|
|
106
106
|
# Class level APIs that operate on Acl instances and/or return Acl instances.
|
|
107
107
|
# @note For the sake of consistency all methods from this API return array of Acls
|
|
108
108
|
class << self
|
|
109
|
-
#
|
|
110
|
-
# @
|
|
111
|
-
# @return [Array<Acl>] created acls
|
|
109
|
+
# @param acl [Acl] ACL rule to create
|
|
110
|
+
# @see #create
|
|
112
111
|
def create(acl)
|
|
113
|
-
|
|
114
|
-
admin.create_acl(**acl.to_native_hash)
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
[acl]
|
|
112
|
+
new.create(acl)
|
|
118
113
|
end
|
|
119
114
|
|
|
120
|
-
#
|
|
121
|
-
# @
|
|
122
|
-
# @return [Array<Acl>] deleted acls
|
|
123
|
-
# @note More than one Acl may be removed if rules match that way
|
|
115
|
+
# @param acl [Acl] ACL pattern to match for deletion
|
|
116
|
+
# @see #delete
|
|
124
117
|
def delete(acl)
|
|
125
|
-
|
|
126
|
-
admin.delete_acl(**acl.to_native_hash)
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
result.deleted_acls.map do |result_acl|
|
|
130
|
-
from_rdkafka(result_acl)
|
|
131
|
-
end
|
|
118
|
+
new.delete(acl)
|
|
132
119
|
end
|
|
133
120
|
|
|
134
|
-
#
|
|
135
|
-
# @
|
|
136
|
-
# @return [Array<Acl>] described acls
|
|
121
|
+
# @param acl [Acl] ACL pattern to describe
|
|
122
|
+
# @see #describe
|
|
137
123
|
def describe(acl)
|
|
138
|
-
|
|
139
|
-
admin.describe_acl(**acl.to_native_hash)
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
result.acls.map do |result_acl|
|
|
143
|
-
from_rdkafka(result_acl)
|
|
144
|
-
end
|
|
124
|
+
new.describe(acl)
|
|
145
125
|
end
|
|
146
126
|
|
|
147
|
-
#
|
|
148
|
-
# @return [Array<Acl>] all acls
|
|
127
|
+
# @see #all
|
|
149
128
|
def all
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
)
|
|
129
|
+
new.all
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Creates (unless already present) a given ACL rule in Kafka
|
|
134
|
+
# @param acl [Acl]
|
|
135
|
+
# @return [Array<Acl>] created acls
|
|
136
|
+
def create(acl)
|
|
137
|
+
with_admin_wait do |admin|
|
|
138
|
+
admin.create_acl(**acl.to_native_hash)
|
|
161
139
|
end
|
|
162
140
|
|
|
163
|
-
|
|
141
|
+
[acl]
|
|
142
|
+
end
|
|
164
143
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
144
|
+
# Removes acls matching provide acl pattern.
|
|
145
|
+
# @param acl [Acl]
|
|
146
|
+
# @return [Array<Acl>] deleted acls
|
|
147
|
+
# @note More than one Acl may be removed if rules match that way
|
|
148
|
+
def delete(acl)
|
|
149
|
+
result = with_admin_wait do |admin|
|
|
150
|
+
admin.delete_acl(**acl.to_native_hash)
|
|
171
151
|
end
|
|
172
152
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
)
|
|
153
|
+
result.deleted_acls.map do |result_acl|
|
|
154
|
+
from_rdkafka(result_acl)
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Takes an Acl definition and describes all existing Acls matching its criteria
|
|
159
|
+
# @param acl [Acl]
|
|
160
|
+
# @return [Array<Acl>] described acls
|
|
161
|
+
def describe(acl)
|
|
162
|
+
result = with_admin_wait do |admin|
|
|
163
|
+
admin.describe_acl(**acl.to_native_hash)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
result.acls.map do |result_acl|
|
|
167
|
+
from_rdkafka(result_acl)
|
|
189
168
|
end
|
|
190
169
|
end
|
|
191
170
|
|
|
171
|
+
# Returns all acls on a cluster level
|
|
172
|
+
# @return [Array<Acl>] all acls
|
|
173
|
+
def all
|
|
174
|
+
describe(
|
|
175
|
+
self.class.new(
|
|
176
|
+
resource_type: :any,
|
|
177
|
+
resource_name: nil,
|
|
178
|
+
resource_pattern_type: :any,
|
|
179
|
+
principal: nil,
|
|
180
|
+
operation: :any,
|
|
181
|
+
permission_type: :any,
|
|
182
|
+
host: '*'
|
|
183
|
+
)
|
|
184
|
+
)
|
|
185
|
+
end
|
|
186
|
+
|
|
192
187
|
attr_reader(
|
|
193
188
|
:resource_type, :resource_name, :resource_pattern_type, :principal, :host, :operation,
|
|
194
189
|
:permission_type
|
|
@@ -196,6 +191,11 @@ module Karafka
|
|
|
196
191
|
|
|
197
192
|
# Initializes a new Acl instance with specified attributes.
|
|
198
193
|
#
|
|
194
|
+
# This class serves dual purposes:
|
|
195
|
+
# 1. As an ACL rule definition when called with resource_type and other ACL parameters
|
|
196
|
+
# 2. As an admin operations instance when called with only kafka: parameter
|
|
197
|
+
#
|
|
198
|
+
# @param kafka [Hash] custom kafka configuration for admin operations (optional)
|
|
199
199
|
# @param resource_type [Symbol, Integer] Specifies the type of Kafka resource
|
|
200
200
|
# (like :topic, :consumer_group).
|
|
201
201
|
# Accepts either a symbol from RESOURCE_TYPES_MAP or a direct rdkafka numerical type.
|
|
@@ -215,24 +215,45 @@ module Karafka
|
|
|
215
215
|
#
|
|
216
216
|
# Each parameter is mapped to its corresponding value in the respective *_MAP constant,
|
|
217
217
|
# allowing usage of more descriptive Ruby symbols instead of numerical types.
|
|
218
|
+
#
|
|
219
|
+
# @example Create an ACL rule
|
|
220
|
+
# acl = Karafka::Admin::Acl.new(
|
|
221
|
+
# resource_type: :topic,
|
|
222
|
+
# resource_name: 'my-topic',
|
|
223
|
+
# resource_pattern_type: :literal,
|
|
224
|
+
# principal: 'User:my-user',
|
|
225
|
+
# operation: :read,
|
|
226
|
+
# permission_type: :allow
|
|
227
|
+
# )
|
|
228
|
+
#
|
|
229
|
+
# @example Create an admin instance for a different cluster
|
|
230
|
+
# admin = Karafka::Admin::Acl.new(kafka: { 'bootstrap.servers': 'other:9092' })
|
|
231
|
+
# admin.do_create(acl)
|
|
218
232
|
def initialize(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
233
|
+
kafka: nil,
|
|
234
|
+
resource_type: nil,
|
|
235
|
+
resource_name: nil,
|
|
236
|
+
resource_pattern_type: nil,
|
|
237
|
+
principal: nil,
|
|
223
238
|
host: '*',
|
|
224
|
-
operation
|
|
225
|
-
permission_type:
|
|
239
|
+
operation: nil,
|
|
240
|
+
permission_type: nil
|
|
226
241
|
)
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
242
|
+
# If resource_type is provided, this is an ACL rule definition
|
|
243
|
+
if resource_type
|
|
244
|
+
@resource_type = map(resource_type, RESOURCE_TYPES_MAP)
|
|
245
|
+
@resource_name = resource_name
|
|
246
|
+
@resource_pattern_type = map(resource_pattern_type, RESOURCE_PATTERNS_TYPE_MAP)
|
|
247
|
+
@principal = principal
|
|
248
|
+
@host = host
|
|
249
|
+
@operation = map(operation, OPERATIONS_MAP)
|
|
250
|
+
@permission_type = map(permission_type, PERMISSION_TYPES_MAP)
|
|
251
|
+
super(kafka: kafka || {})
|
|
252
|
+
freeze
|
|
253
|
+
else
|
|
254
|
+
# This is an admin operations instance
|
|
255
|
+
super(kafka: kafka || {})
|
|
256
|
+
end
|
|
236
257
|
end
|
|
237
258
|
|
|
238
259
|
# Converts the Acl into a hash with native rdkafka types
|
|
@@ -251,6 +272,32 @@ module Karafka
|
|
|
251
272
|
|
|
252
273
|
private
|
|
253
274
|
|
|
275
|
+
# Yields admin instance, allows to run Acl operations and awaits on the final result
|
|
276
|
+
# Makes sure that admin is closed afterwards.
|
|
277
|
+
def with_admin_wait
|
|
278
|
+
with_admin do |admin|
|
|
279
|
+
yield(admin).wait(max_wait_timeout: self.class.max_wait_time)
|
|
280
|
+
end
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Takes a rdkafka Acl result and converts it into our local Acl representation. Since the
|
|
284
|
+
# rdkafka Acl object is an integer based on on types, etc we remap it into our "more" Ruby
|
|
285
|
+
# form.
|
|
286
|
+
#
|
|
287
|
+
# @param rdkafka_acl [Rdkafka::Admin::AclBindingResult]
|
|
288
|
+
# return [Acl] mapped acl
|
|
289
|
+
def from_rdkafka(rdkafka_acl)
|
|
290
|
+
self.class.new(
|
|
291
|
+
resource_type: rdkafka_acl.matching_acl_resource_type,
|
|
292
|
+
resource_name: rdkafka_acl.matching_acl_resource_name,
|
|
293
|
+
resource_pattern_type: rdkafka_acl.matching_acl_pattern_type,
|
|
294
|
+
principal: rdkafka_acl.matching_acl_principal,
|
|
295
|
+
host: rdkafka_acl.matching_acl_host,
|
|
296
|
+
operation: rdkafka_acl.matching_acl_operation,
|
|
297
|
+
permission_type: rdkafka_acl.matching_acl_permission_type
|
|
298
|
+
)
|
|
299
|
+
end
|
|
300
|
+
|
|
254
301
|
# Maps the provided attribute based on the mapping hash and if not found returns the
|
|
255
302
|
# attribute itself. Useful when converting from Acl symbol based representation to the
|
|
256
303
|
# rdkafka one.
|
|
@@ -11,91 +11,105 @@ module Karafka
|
|
|
11
11
|
# Altering is done in the incremental way.
|
|
12
12
|
class Configs < Admin
|
|
13
13
|
class << self
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
# @
|
|
17
|
-
# list of resources we are interested in. It is useful to provide multiple resources
|
|
18
|
-
# when you need data from multiple topics, etc. Karafka will make one query for all the
|
|
19
|
-
# data instead of doing one per topic.
|
|
20
|
-
#
|
|
21
|
-
# @return [Array<Resource>] array with resources containing their configuration details
|
|
22
|
-
#
|
|
23
|
-
# @note Even if you request one resource, result will always be an array with resources
|
|
24
|
-
#
|
|
25
|
-
# @example Describe topic named "example" and print its config
|
|
26
|
-
# resource = Karafka::Admin::Configs::Resource.new(type: :topic, name: 'example')
|
|
27
|
-
# results = Karafka::Admin::Configs.describe(resource)
|
|
28
|
-
# results.first.configs.each do |config|
|
|
29
|
-
# puts "#{config.name} - #{config.value}"
|
|
30
|
-
# end
|
|
14
|
+
# @param resources [Resource, Array<Resource>] single resource or list of resources
|
|
15
|
+
# to fetch configuration from Kafka
|
|
16
|
+
# @see #describe
|
|
31
17
|
def describe(*resources)
|
|
32
|
-
|
|
33
|
-
:describe_configs,
|
|
34
|
-
resources
|
|
35
|
-
)
|
|
18
|
+
new.describe(*resources)
|
|
36
19
|
end
|
|
37
20
|
|
|
38
|
-
#
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
# @param resources [Resource, Array<Resource>] single resource we want to alter or
|
|
42
|
-
# list of resources.
|
|
43
|
-
#
|
|
44
|
-
# @note This operation is not transactional and can work only partially if some config
|
|
45
|
-
# options are not valid. Always make sure, your alterations are correct.
|
|
46
|
-
#
|
|
47
|
-
# @note We call it `#alter` despite using the Kafka incremental alter API because the
|
|
48
|
-
# regular alter is deprecated.
|
|
49
|
-
#
|
|
50
|
-
# @example Alter the `delete.retention.ms` and set it to 8640001
|
|
51
|
-
# resource = Karafka::Admin::Configs::Resource.new(type: :topic, name: 'example')
|
|
52
|
-
# resource.set('delete.retention.ms', '8640001')
|
|
53
|
-
# Karafka::Admin::Configs.alter(resource)
|
|
21
|
+
# @param resources [Resource, Array<Resource>] single resource or list of resources
|
|
22
|
+
# with accumulated alteration operations to apply
|
|
23
|
+
# @see #alter
|
|
54
24
|
def alter(*resources)
|
|
55
|
-
|
|
56
|
-
:incremental_alter_configs,
|
|
57
|
-
resources
|
|
58
|
-
)
|
|
25
|
+
new.alter(*resources)
|
|
59
26
|
end
|
|
27
|
+
end
|
|
60
28
|
|
|
61
|
-
|
|
29
|
+
# Fetches given resources configurations from Kafka
|
|
30
|
+
#
|
|
31
|
+
# @param resources [Resource, Array<Resource>] single resource we want to describe or
|
|
32
|
+
# list of resources we are interested in. It is useful to provide multiple resources
|
|
33
|
+
# when you need data from multiple topics, etc. Karafka will make one query for all the
|
|
34
|
+
# data instead of doing one per topic.
|
|
35
|
+
#
|
|
36
|
+
# @return [Array<Resource>] array with resources containing their configuration details
|
|
37
|
+
#
|
|
38
|
+
# @note Even if you request one resource, result will always be an array with resources
|
|
39
|
+
#
|
|
40
|
+
# @example Describe topic named "example" and print its config
|
|
41
|
+
# resource = Karafka::Admin::Configs::Resource.new(type: :topic, name: 'example')
|
|
42
|
+
# results = Karafka::Admin::Configs.describe(resource)
|
|
43
|
+
# results.first.configs.each do |config|
|
|
44
|
+
# puts "#{config.name} - #{config.value}"
|
|
45
|
+
# end
|
|
46
|
+
def describe(*resources)
|
|
47
|
+
operate_on_resources(
|
|
48
|
+
:describe_configs,
|
|
49
|
+
resources
|
|
50
|
+
)
|
|
51
|
+
end
|
|
62
52
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
# Alters given resources based on the alteration operations accumulated in the provided
|
|
54
|
+
# resources
|
|
55
|
+
#
|
|
56
|
+
# @param resources [Resource, Array<Resource>] single resource we want to alter or
|
|
57
|
+
# list of resources.
|
|
58
|
+
#
|
|
59
|
+
# @note This operation is not transactional and can work only partially if some config
|
|
60
|
+
# options are not valid. Always make sure, your alterations are correct.
|
|
61
|
+
#
|
|
62
|
+
# @note We call it `#alter` despite using the Kafka incremental alter API because the
|
|
63
|
+
# regular alter is deprecated.
|
|
64
|
+
#
|
|
65
|
+
# @example Alter the `delete.retention.ms` and set it to 8640001
|
|
66
|
+
# resource = Karafka::Admin::Configs::Resource.new(type: :topic, name: 'example')
|
|
67
|
+
# resource.set('delete.retention.ms', '8640001')
|
|
68
|
+
# Karafka::Admin::Configs.alter(resource)
|
|
69
|
+
def alter(*resources)
|
|
70
|
+
operate_on_resources(
|
|
71
|
+
:incremental_alter_configs,
|
|
72
|
+
resources
|
|
73
|
+
)
|
|
74
|
+
end
|
|
67
75
|
|
|
68
|
-
|
|
69
|
-
admin.public_send(
|
|
70
|
-
action,
|
|
71
|
-
resources.map(&:to_native_hash)
|
|
72
|
-
)
|
|
73
|
-
end
|
|
76
|
+
private
|
|
74
77
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
type: rd_kafka_resource.type
|
|
80
|
-
)
|
|
78
|
+
# @param action [Symbol] runs given action via Rdkafka Admin
|
|
79
|
+
# @param resources [Array<Resource>] resources on which we want to operate
|
|
80
|
+
def operate_on_resources(action, resources)
|
|
81
|
+
resources = Array(resources).flatten
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
result = with_admin_wait do |admin|
|
|
84
|
+
admin.public_send(
|
|
85
|
+
action,
|
|
86
|
+
resources.map(&:to_native_hash)
|
|
87
|
+
)
|
|
88
|
+
end
|
|
85
89
|
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
result.resources.map do |rd_kafka_resource|
|
|
91
|
+
# Create back a resource
|
|
92
|
+
resource = Resource.new(
|
|
93
|
+
name: rd_kafka_resource.name,
|
|
94
|
+
type: rd_kafka_resource.type
|
|
95
|
+
)
|
|
88
96
|
|
|
89
|
-
|
|
97
|
+
rd_kafka_resource.configs.each do |rd_kafka_config|
|
|
98
|
+
resource.configs << Config.from_rd_kafka(rd_kafka_config)
|
|
90
99
|
end
|
|
100
|
+
|
|
101
|
+
resource.configs.sort_by!(&:name)
|
|
102
|
+
resource.configs.freeze
|
|
103
|
+
|
|
104
|
+
resource
|
|
91
105
|
end
|
|
106
|
+
end
|
|
92
107
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
end
|
|
108
|
+
# Yields admin instance, allows to run Configs operations and awaits on the final result
|
|
109
|
+
# Makes sure that admin is closed afterwards.
|
|
110
|
+
def with_admin_wait
|
|
111
|
+
with_admin do |admin|
|
|
112
|
+
yield(admin).wait(max_wait_timeout: self.class.max_wait_time)
|
|
99
113
|
end
|
|
100
114
|
end
|
|
101
115
|
end
|