karafka 2.5.4.rc1 → 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.
Files changed (260) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -1
  3. data/LICENSE-COMM +4 -2
  4. data/lib/karafka/admin/acl.rb +127 -80
  5. data/lib/karafka/admin/configs.rb +84 -70
  6. data/lib/karafka/admin/consumer_groups.rb +377 -330
  7. data/lib/karafka/admin/replication.rb +287 -263
  8. data/lib/karafka/admin/topics.rb +232 -186
  9. data/lib/karafka/admin.rb +277 -117
  10. data/lib/karafka/pro/active_job/consumer.rb +19 -2
  11. data/lib/karafka/pro/active_job/dispatcher.rb +19 -2
  12. data/lib/karafka/pro/active_job/job_options_contract.rb +19 -2
  13. data/lib/karafka/pro/base_consumer.rb +19 -2
  14. data/lib/karafka/pro/cleaner/errors.rb +19 -2
  15. data/lib/karafka/pro/cleaner/messages/message.rb +19 -2
  16. data/lib/karafka/pro/cleaner/messages/messages.rb +19 -2
  17. data/lib/karafka/pro/cleaner/messages/metadata.rb +19 -2
  18. data/lib/karafka/pro/cleaner.rb +19 -2
  19. data/lib/karafka/pro/cli/contracts/server.rb +19 -2
  20. data/lib/karafka/pro/cli/parallel_segments/base.rb +19 -2
  21. data/lib/karafka/pro/cli/parallel_segments/collapse.rb +19 -2
  22. data/lib/karafka/pro/cli/parallel_segments/distribute.rb +19 -2
  23. data/lib/karafka/pro/cli/parallel_segments.rb +19 -2
  24. data/lib/karafka/pro/connection/manager.rb +19 -2
  25. data/lib/karafka/pro/connection/multiplexing/listener.rb +19 -2
  26. data/lib/karafka/pro/contracts/base.rb +19 -2
  27. data/lib/karafka/pro/encryption/cipher.rb +19 -2
  28. data/lib/karafka/pro/encryption/contracts/config.rb +19 -2
  29. data/lib/karafka/pro/encryption/errors.rb +19 -2
  30. data/lib/karafka/pro/encryption/messages/middleware.rb +19 -2
  31. data/lib/karafka/pro/encryption/messages/parser.rb +19 -2
  32. data/lib/karafka/pro/encryption/setup/config.rb +19 -2
  33. data/lib/karafka/pro/encryption.rb +19 -2
  34. data/lib/karafka/pro/instrumentation/performance_tracker.rb +19 -2
  35. data/lib/karafka/pro/iterator/expander.rb +19 -2
  36. data/lib/karafka/pro/iterator/tpl_builder.rb +19 -2
  37. data/lib/karafka/pro/iterator.rb +19 -2
  38. data/lib/karafka/pro/loader.rb +19 -2
  39. data/lib/karafka/pro/processing/adaptive_iterator/consumer.rb +19 -2
  40. data/lib/karafka/pro/processing/adaptive_iterator/tracker.rb +19 -2
  41. data/lib/karafka/pro/processing/collapser.rb +19 -2
  42. data/lib/karafka/pro/processing/coordinator.rb +19 -2
  43. data/lib/karafka/pro/processing/coordinators/errors_tracker.rb +19 -2
  44. data/lib/karafka/pro/processing/coordinators/filters_applier.rb +19 -2
  45. data/lib/karafka/pro/processing/coordinators/virtual_offset_manager.rb +19 -2
  46. data/lib/karafka/pro/processing/executor.rb +19 -2
  47. data/lib/karafka/pro/processing/expansions_selector.rb +19 -2
  48. data/lib/karafka/pro/processing/filters/base.rb +19 -2
  49. data/lib/karafka/pro/processing/filters/delayer.rb +19 -2
  50. data/lib/karafka/pro/processing/filters/expirer.rb +19 -2
  51. data/lib/karafka/pro/processing/filters/inline_insights_delayer.rb +19 -2
  52. data/lib/karafka/pro/processing/filters/throttler.rb +19 -2
  53. data/lib/karafka/pro/processing/filters/virtual_limiter.rb +19 -2
  54. data/lib/karafka/pro/processing/jobs/consume_non_blocking.rb +19 -2
  55. data/lib/karafka/pro/processing/jobs/eofed_non_blocking.rb +19 -2
  56. data/lib/karafka/pro/processing/jobs/periodic.rb +19 -2
  57. data/lib/karafka/pro/processing/jobs/periodic_non_blocking.rb +19 -2
  58. data/lib/karafka/pro/processing/jobs/revoked_non_blocking.rb +19 -2
  59. data/lib/karafka/pro/processing/jobs_builder.rb +19 -2
  60. data/lib/karafka/pro/processing/jobs_queue.rb +19 -2
  61. data/lib/karafka/pro/processing/offset_metadata/consumer.rb +19 -2
  62. data/lib/karafka/pro/processing/offset_metadata/fetcher.rb +19 -2
  63. data/lib/karafka/pro/processing/offset_metadata/listener.rb +19 -2
  64. data/lib/karafka/pro/processing/parallel_segments/filters/base.rb +19 -2
  65. data/lib/karafka/pro/processing/parallel_segments/filters/default.rb +19 -2
  66. data/lib/karafka/pro/processing/parallel_segments/filters/mom.rb +19 -2
  67. data/lib/karafka/pro/processing/partitioner.rb +19 -2
  68. data/lib/karafka/pro/processing/periodic_job/consumer.rb +19 -2
  69. data/lib/karafka/pro/processing/piping/consumer.rb +19 -2
  70. data/lib/karafka/pro/processing/schedulers/base.rb +19 -2
  71. data/lib/karafka/pro/processing/schedulers/default.rb +19 -2
  72. data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_lrj_mom.rb +19 -2
  73. data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_lrj_mom_vp.rb +19 -2
  74. data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_mom.rb +19 -2
  75. data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_mom_vp.rb +19 -2
  76. data/lib/karafka/pro/processing/strategies/aj/dlq_lrj_mom.rb +19 -2
  77. data/lib/karafka/pro/processing/strategies/aj/dlq_lrj_mom_vp.rb +19 -2
  78. data/lib/karafka/pro/processing/strategies/aj/dlq_mom.rb +19 -2
  79. data/lib/karafka/pro/processing/strategies/aj/dlq_mom_vp.rb +19 -2
  80. data/lib/karafka/pro/processing/strategies/aj/ftr_lrj_mom.rb +19 -2
  81. data/lib/karafka/pro/processing/strategies/aj/ftr_lrj_mom_vp.rb +19 -2
  82. data/lib/karafka/pro/processing/strategies/aj/ftr_mom.rb +19 -2
  83. data/lib/karafka/pro/processing/strategies/aj/ftr_mom_vp.rb +19 -2
  84. data/lib/karafka/pro/processing/strategies/aj/lrj_mom.rb +19 -2
  85. data/lib/karafka/pro/processing/strategies/aj/lrj_mom_vp.rb +19 -2
  86. data/lib/karafka/pro/processing/strategies/aj/mom.rb +19 -2
  87. data/lib/karafka/pro/processing/strategies/aj/mom_vp.rb +19 -2
  88. data/lib/karafka/pro/processing/strategies/base.rb +19 -2
  89. data/lib/karafka/pro/processing/strategies/default.rb +19 -2
  90. data/lib/karafka/pro/processing/strategies/dlq/default.rb +19 -2
  91. data/lib/karafka/pro/processing/strategies/dlq/ftr.rb +19 -2
  92. data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj.rb +19 -2
  93. data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_mom.rb +19 -2
  94. data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_mom_vp.rb +19 -2
  95. data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_vp.rb +19 -2
  96. data/lib/karafka/pro/processing/strategies/dlq/ftr_mom.rb +19 -2
  97. data/lib/karafka/pro/processing/strategies/dlq/ftr_mom_vp.rb +19 -2
  98. data/lib/karafka/pro/processing/strategies/dlq/ftr_vp.rb +19 -2
  99. data/lib/karafka/pro/processing/strategies/dlq/lrj.rb +19 -2
  100. data/lib/karafka/pro/processing/strategies/dlq/lrj_mom.rb +19 -2
  101. data/lib/karafka/pro/processing/strategies/dlq/lrj_mom_vp.rb +19 -2
  102. data/lib/karafka/pro/processing/strategies/dlq/lrj_vp.rb +19 -2
  103. data/lib/karafka/pro/processing/strategies/dlq/mom.rb +19 -2
  104. data/lib/karafka/pro/processing/strategies/dlq/mom_vp.rb +19 -2
  105. data/lib/karafka/pro/processing/strategies/dlq/vp.rb +19 -2
  106. data/lib/karafka/pro/processing/strategies/ftr/default.rb +19 -2
  107. data/lib/karafka/pro/processing/strategies/ftr/vp.rb +19 -2
  108. data/lib/karafka/pro/processing/strategies/lrj/default.rb +19 -2
  109. data/lib/karafka/pro/processing/strategies/lrj/ftr.rb +19 -2
  110. data/lib/karafka/pro/processing/strategies/lrj/ftr_mom.rb +19 -2
  111. data/lib/karafka/pro/processing/strategies/lrj/ftr_mom_vp.rb +19 -2
  112. data/lib/karafka/pro/processing/strategies/lrj/ftr_vp.rb +19 -2
  113. data/lib/karafka/pro/processing/strategies/lrj/mom.rb +19 -2
  114. data/lib/karafka/pro/processing/strategies/lrj/mom_vp.rb +19 -2
  115. data/lib/karafka/pro/processing/strategies/lrj/vp.rb +19 -2
  116. data/lib/karafka/pro/processing/strategies/mom/default.rb +19 -2
  117. data/lib/karafka/pro/processing/strategies/mom/ftr.rb +19 -2
  118. data/lib/karafka/pro/processing/strategies/mom/ftr_vp.rb +19 -2
  119. data/lib/karafka/pro/processing/strategies/mom/vp.rb +19 -2
  120. data/lib/karafka/pro/processing/strategies/vp/default.rb +19 -2
  121. data/lib/karafka/pro/processing/strategies.rb +19 -2
  122. data/lib/karafka/pro/processing/strategy_selector.rb +19 -2
  123. data/lib/karafka/pro/processing/subscription_groups_coordinator.rb +19 -2
  124. data/lib/karafka/pro/processing/virtual_partitions/distributors/balanced.rb +19 -2
  125. data/lib/karafka/pro/processing/virtual_partitions/distributors/base.rb +19 -2
  126. data/lib/karafka/pro/processing/virtual_partitions/distributors/consistent.rb +19 -2
  127. data/lib/karafka/pro/recurring_tasks/consumer.rb +19 -2
  128. data/lib/karafka/pro/recurring_tasks/contracts/config.rb +19 -2
  129. data/lib/karafka/pro/recurring_tasks/contracts/task.rb +19 -2
  130. data/lib/karafka/pro/recurring_tasks/deserializer.rb +19 -2
  131. data/lib/karafka/pro/recurring_tasks/dispatcher.rb +19 -2
  132. data/lib/karafka/pro/recurring_tasks/errors.rb +19 -2
  133. data/lib/karafka/pro/recurring_tasks/executor.rb +19 -2
  134. data/lib/karafka/pro/recurring_tasks/listener.rb +19 -2
  135. data/lib/karafka/pro/recurring_tasks/matcher.rb +19 -2
  136. data/lib/karafka/pro/recurring_tasks/schedule.rb +19 -2
  137. data/lib/karafka/pro/recurring_tasks/serializer.rb +19 -2
  138. data/lib/karafka/pro/recurring_tasks/setup/config.rb +19 -2
  139. data/lib/karafka/pro/recurring_tasks/task.rb +19 -2
  140. data/lib/karafka/pro/recurring_tasks.rb +19 -2
  141. data/lib/karafka/pro/routing/features/active_job/builder.rb +19 -2
  142. data/lib/karafka/pro/routing/features/active_job.rb +19 -2
  143. data/lib/karafka/pro/routing/features/adaptive_iterator/config.rb +19 -2
  144. data/lib/karafka/pro/routing/features/adaptive_iterator/contracts/topic.rb +19 -2
  145. data/lib/karafka/pro/routing/features/adaptive_iterator/topic.rb +19 -2
  146. data/lib/karafka/pro/routing/features/adaptive_iterator.rb +19 -2
  147. data/lib/karafka/pro/routing/features/base.rb +19 -2
  148. data/lib/karafka/pro/routing/features/dead_letter_queue/contracts/topic.rb +19 -2
  149. data/lib/karafka/pro/routing/features/dead_letter_queue/topic.rb +19 -2
  150. data/lib/karafka/pro/routing/features/dead_letter_queue.rb +19 -2
  151. data/lib/karafka/pro/routing/features/delaying/config.rb +19 -2
  152. data/lib/karafka/pro/routing/features/delaying/contracts/topic.rb +19 -2
  153. data/lib/karafka/pro/routing/features/delaying/topic.rb +19 -2
  154. data/lib/karafka/pro/routing/features/delaying.rb +19 -2
  155. data/lib/karafka/pro/routing/features/direct_assignments/config.rb +19 -2
  156. data/lib/karafka/pro/routing/features/direct_assignments/contracts/consumer_group.rb +19 -2
  157. data/lib/karafka/pro/routing/features/direct_assignments/contracts/topic.rb +19 -2
  158. data/lib/karafka/pro/routing/features/direct_assignments/subscription_group.rb +19 -2
  159. data/lib/karafka/pro/routing/features/direct_assignments/topic.rb +19 -2
  160. data/lib/karafka/pro/routing/features/direct_assignments.rb +19 -2
  161. data/lib/karafka/pro/routing/features/expiring/config.rb +19 -2
  162. data/lib/karafka/pro/routing/features/expiring/contracts/topic.rb +19 -2
  163. data/lib/karafka/pro/routing/features/expiring/topic.rb +19 -2
  164. data/lib/karafka/pro/routing/features/expiring.rb +19 -2
  165. data/lib/karafka/pro/routing/features/filtering/config.rb +19 -2
  166. data/lib/karafka/pro/routing/features/filtering/contracts/topic.rb +19 -2
  167. data/lib/karafka/pro/routing/features/filtering/topic.rb +19 -2
  168. data/lib/karafka/pro/routing/features/filtering.rb +19 -2
  169. data/lib/karafka/pro/routing/features/inline_insights/config.rb +19 -2
  170. data/lib/karafka/pro/routing/features/inline_insights/contracts/topic.rb +19 -2
  171. data/lib/karafka/pro/routing/features/inline_insights/topic.rb +19 -2
  172. data/lib/karafka/pro/routing/features/inline_insights.rb +19 -2
  173. data/lib/karafka/pro/routing/features/long_running_job/config.rb +19 -2
  174. data/lib/karafka/pro/routing/features/long_running_job/contracts/topic.rb +19 -2
  175. data/lib/karafka/pro/routing/features/long_running_job/topic.rb +19 -2
  176. data/lib/karafka/pro/routing/features/long_running_job.rb +19 -2
  177. data/lib/karafka/pro/routing/features/multiplexing/config.rb +19 -2
  178. data/lib/karafka/pro/routing/features/multiplexing/contracts/topic.rb +19 -2
  179. data/lib/karafka/pro/routing/features/multiplexing/patches/contracts/consumer_group.rb +19 -2
  180. data/lib/karafka/pro/routing/features/multiplexing/proxy.rb +19 -2
  181. data/lib/karafka/pro/routing/features/multiplexing/subscription_group.rb +19 -2
  182. data/lib/karafka/pro/routing/features/multiplexing/subscription_groups_builder.rb +19 -2
  183. data/lib/karafka/pro/routing/features/multiplexing.rb +19 -2
  184. data/lib/karafka/pro/routing/features/non_blocking_job/topic.rb +19 -2
  185. data/lib/karafka/pro/routing/features/non_blocking_job.rb +19 -2
  186. data/lib/karafka/pro/routing/features/offset_metadata/config.rb +19 -2
  187. data/lib/karafka/pro/routing/features/offset_metadata/contracts/topic.rb +19 -2
  188. data/lib/karafka/pro/routing/features/offset_metadata/topic.rb +19 -2
  189. data/lib/karafka/pro/routing/features/offset_metadata.rb +19 -2
  190. data/lib/karafka/pro/routing/features/parallel_segments/builder.rb +19 -2
  191. data/lib/karafka/pro/routing/features/parallel_segments/config.rb +19 -2
  192. data/lib/karafka/pro/routing/features/parallel_segments/consumer_group.rb +19 -2
  193. data/lib/karafka/pro/routing/features/parallel_segments/contracts/consumer_group.rb +19 -2
  194. data/lib/karafka/pro/routing/features/parallel_segments/topic.rb +19 -2
  195. data/lib/karafka/pro/routing/features/parallel_segments.rb +19 -2
  196. data/lib/karafka/pro/routing/features/patterns/builder.rb +19 -2
  197. data/lib/karafka/pro/routing/features/patterns/config.rb +19 -2
  198. data/lib/karafka/pro/routing/features/patterns/consumer_group.rb +19 -2
  199. data/lib/karafka/pro/routing/features/patterns/contracts/consumer_group.rb +19 -2
  200. data/lib/karafka/pro/routing/features/patterns/contracts/pattern.rb +19 -2
  201. data/lib/karafka/pro/routing/features/patterns/contracts/topic.rb +19 -2
  202. data/lib/karafka/pro/routing/features/patterns/detector.rb +19 -2
  203. data/lib/karafka/pro/routing/features/patterns/pattern.rb +19 -2
  204. data/lib/karafka/pro/routing/features/patterns/patterns.rb +19 -2
  205. data/lib/karafka/pro/routing/features/patterns/topic.rb +19 -2
  206. data/lib/karafka/pro/routing/features/patterns/topics.rb +19 -2
  207. data/lib/karafka/pro/routing/features/patterns.rb +19 -2
  208. data/lib/karafka/pro/routing/features/pausing/config.rb +19 -2
  209. data/lib/karafka/pro/routing/features/pausing/contracts/topic.rb +19 -2
  210. data/lib/karafka/pro/routing/features/pausing/topic.rb +19 -2
  211. data/lib/karafka/pro/routing/features/pausing.rb +19 -2
  212. data/lib/karafka/pro/routing/features/periodic_job/config.rb +19 -2
  213. data/lib/karafka/pro/routing/features/periodic_job/contracts/topic.rb +19 -2
  214. data/lib/karafka/pro/routing/features/periodic_job/topic.rb +19 -2
  215. data/lib/karafka/pro/routing/features/periodic_job.rb +19 -2
  216. data/lib/karafka/pro/routing/features/recurring_tasks/builder.rb +19 -2
  217. data/lib/karafka/pro/routing/features/recurring_tasks/config.rb +19 -2
  218. data/lib/karafka/pro/routing/features/recurring_tasks/contracts/topic.rb +19 -2
  219. data/lib/karafka/pro/routing/features/recurring_tasks/proxy.rb +19 -2
  220. data/lib/karafka/pro/routing/features/recurring_tasks/topic.rb +19 -2
  221. data/lib/karafka/pro/routing/features/recurring_tasks.rb +19 -2
  222. data/lib/karafka/pro/routing/features/scheduled_messages/builder.rb +19 -2
  223. data/lib/karafka/pro/routing/features/scheduled_messages/config.rb +19 -2
  224. data/lib/karafka/pro/routing/features/scheduled_messages/contracts/topic.rb +19 -2
  225. data/lib/karafka/pro/routing/features/scheduled_messages/proxy.rb +19 -2
  226. data/lib/karafka/pro/routing/features/scheduled_messages/topic.rb +19 -2
  227. data/lib/karafka/pro/routing/features/scheduled_messages.rb +19 -2
  228. data/lib/karafka/pro/routing/features/swarm/config.rb +19 -2
  229. data/lib/karafka/pro/routing/features/swarm/contracts/routing.rb +19 -2
  230. data/lib/karafka/pro/routing/features/swarm/contracts/topic.rb +19 -2
  231. data/lib/karafka/pro/routing/features/swarm/topic.rb +19 -2
  232. data/lib/karafka/pro/routing/features/swarm.rb +19 -2
  233. data/lib/karafka/pro/routing/features/throttling/config.rb +19 -2
  234. data/lib/karafka/pro/routing/features/throttling/contracts/topic.rb +19 -2
  235. data/lib/karafka/pro/routing/features/throttling/topic.rb +19 -2
  236. data/lib/karafka/pro/routing/features/throttling.rb +19 -2
  237. data/lib/karafka/pro/routing/features/virtual_partitions/config.rb +19 -2
  238. data/lib/karafka/pro/routing/features/virtual_partitions/contracts/topic.rb +19 -2
  239. data/lib/karafka/pro/routing/features/virtual_partitions/topic.rb +19 -2
  240. data/lib/karafka/pro/routing/features/virtual_partitions.rb +19 -2
  241. data/lib/karafka/pro/scheduled_messages/consumer.rb +19 -2
  242. data/lib/karafka/pro/scheduled_messages/contracts/config.rb +19 -2
  243. data/lib/karafka/pro/scheduled_messages/contracts/message.rb +19 -2
  244. data/lib/karafka/pro/scheduled_messages/daily_buffer.rb +19 -2
  245. data/lib/karafka/pro/scheduled_messages/day.rb +19 -2
  246. data/lib/karafka/pro/scheduled_messages/deserializers/headers.rb +19 -2
  247. data/lib/karafka/pro/scheduled_messages/deserializers/payload.rb +19 -2
  248. data/lib/karafka/pro/scheduled_messages/dispatcher.rb +19 -2
  249. data/lib/karafka/pro/scheduled_messages/errors.rb +19 -2
  250. data/lib/karafka/pro/scheduled_messages/max_epoch.rb +19 -2
  251. data/lib/karafka/pro/scheduled_messages/proxy.rb +19 -2
  252. data/lib/karafka/pro/scheduled_messages/schema_validator.rb +19 -2
  253. data/lib/karafka/pro/scheduled_messages/serializer.rb +19 -2
  254. data/lib/karafka/pro/scheduled_messages/setup/config.rb +19 -2
  255. data/lib/karafka/pro/scheduled_messages/state.rb +19 -2
  256. data/lib/karafka/pro/scheduled_messages/tracker.rb +19 -2
  257. data/lib/karafka/pro/scheduled_messages.rb +19 -2
  258. data/lib/karafka/pro/swarm/liveness_listener.rb +19 -2
  259. data/lib/karafka/version.rb +1 -1
  260. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 974c54eac8c3f6045b0eb6f21cde51b48cd8a23af18efd640784870045c01d35
4
- data.tar.gz: d22621e0199bf8e1adbfe67f59247d2f8e5ae61a52fc389ea1baa2d4f8401418
3
+ metadata.gz: 664c8ed7d20d66153422c1b9e2475fbcaa166c7a62c938170a5909e48e1d9f99
4
+ data.tar.gz: 973f79843261ef8dd002b2f13aa13e939e1e6b6d2f45ab8358af2a347c357c47
5
5
  SHA512:
6
- metadata.gz: f81840332313f5914afde17caeaa794085442ac702e62ea4b6a51429cc191ac2cd7562181a55b76bc314fcc0ca6411c27308cc7b0b88637cdece4a8b1e5c75e4
7
- data.tar.gz: acbc167ab3314dc884274992cd17d40256c967ab1a2ad141376565b1164b29a11669a9ebabe79125ac7129103d9fb09447441bc992b8540115576fa906b033a5
6
+ metadata.gz: 27df04323e3b2851c14dc01a9e34c4b6c21b5eec48eeb493e6c5c4941ce419c0cd8adc45c3cb898d377632af4e42750092b81fa0e46ee472556a357c9bbcc67f
7
+ data.tar.gz: 6a7d33572e7b3b71cb41dc16a92b4581a964429fc246f82792a7ba74bcb1b56b870225ada7232e46dba3f1ef05923140a0b488b513d3a223b5890a7d4ff77df4
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Karafka Framework Changelog
2
2
 
3
- ## 2.5.4 (Unreleased)
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
+
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.
6
9
  - [Enhancement] Reduce gem package size by excluding development files (spec, examples, CI configs, dev scripts) from the gem build.
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; or (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.
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
 
@@ -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
- # Creates (unless already present) a given ACL rule in Kafka
110
- # @param acl [Acl]
111
- # @return [Array<Acl>] created acls
109
+ # @param acl [Acl] ACL rule to create
110
+ # @see #create
112
111
  def create(acl)
113
- with_admin_wait do |admin|
114
- admin.create_acl(**acl.to_native_hash)
115
- end
116
-
117
- [acl]
112
+ new.create(acl)
118
113
  end
119
114
 
120
- # Removes acls matching provide acl pattern.
121
- # @param acl [Acl]
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
- result = with_admin_wait do |admin|
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
- # Takes an Acl definition and describes all existing Acls matching its criteria
135
- # @param acl [Acl]
136
- # @return [Array<Acl>] described acls
121
+ # @param acl [Acl] ACL pattern to describe
122
+ # @see #describe
137
123
  def describe(acl)
138
- result = with_admin_wait do |admin|
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
- # Returns all acls on a cluster level
148
- # @return [Array<Acl>] all acls
127
+ # @see #all
149
128
  def all
150
- describe(
151
- new(
152
- resource_type: :any,
153
- resource_name: nil,
154
- resource_pattern_type: :any,
155
- principal: nil,
156
- operation: :any,
157
- permission_type: :any,
158
- host: '*'
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
- private
141
+ [acl]
142
+ end
164
143
 
165
- # Yields admin instance, allows to run Acl operations and awaits on the final result
166
- # Makes sure that admin is closed afterwards.
167
- def with_admin_wait
168
- with_admin do |admin|
169
- yield(admin).wait(max_wait_timeout: max_wait_time)
170
- end
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
- # Takes a rdkafka Acl result and converts it into our local Acl representation. Since the
174
- # rdkafka Acl object is an integer based on on types, etc we remap it into our "more" Ruby
175
- # form.
176
- #
177
- # @param rdkafka_acl [Rdkafka::Admin::AclBindingResult]
178
- # return [Acl] mapped acl
179
- def from_rdkafka(rdkafka_acl)
180
- new(
181
- resource_type: rdkafka_acl.matching_acl_resource_type,
182
- resource_name: rdkafka_acl.matching_acl_resource_name,
183
- resource_pattern_type: rdkafka_acl.matching_acl_pattern_type,
184
- principal: rdkafka_acl.matching_acl_principal,
185
- host: rdkafka_acl.matching_acl_host,
186
- operation: rdkafka_acl.matching_acl_operation,
187
- permission_type: rdkafka_acl.matching_acl_permission_type
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
- resource_type:,
220
- resource_name:,
221
- resource_pattern_type:,
222
- principal:,
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
- @resource_type = map(resource_type, RESOURCE_TYPES_MAP)
228
- @resource_name = resource_name
229
- @resource_pattern_type = map(resource_pattern_type, RESOURCE_PATTERNS_TYPE_MAP)
230
- @principal = principal
231
- @host = host
232
- @operation = map(operation, OPERATIONS_MAP)
233
- @permission_type = map(permission_type, PERMISSION_TYPES_MAP)
234
- super()
235
- freeze
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
- # Fetches given resources configurations from Kafka
15
- #
16
- # @param resources [Resource, Array<Resource>] single resource we want to describe or
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
- operate_on_resources(
33
- :describe_configs,
34
- resources
35
- )
18
+ new.describe(*resources)
36
19
  end
37
20
 
38
- # Alters given resources based on the alteration operations accumulated in the provided
39
- # resources
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
- operate_on_resources(
56
- :incremental_alter_configs,
57
- resources
58
- )
25
+ new.alter(*resources)
59
26
  end
27
+ end
60
28
 
61
- private
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
- # @param action [Symbol] runs given action via Rdkafka Admin
64
- # @param resources [Array<Resource>] resources on which we want to operate
65
- def operate_on_resources(action, resources)
66
- resources = Array(resources).flatten
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
- result = with_admin_wait do |admin|
69
- admin.public_send(
70
- action,
71
- resources.map(&:to_native_hash)
72
- )
73
- end
76
+ private
74
77
 
75
- result.resources.map do |rd_kafka_resource|
76
- # Create back a resource
77
- resource = Resource.new(
78
- name: rd_kafka_resource.name,
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
- rd_kafka_resource.configs.each do |rd_kafka_config|
83
- resource.configs << Config.from_rd_kafka(rd_kafka_config)
84
- end
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
- resource.configs.sort_by!(&:name)
87
- resource.configs.freeze
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
- resource
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
- # Yields admin instance, allows to run Acl operations and awaits on the final result
94
- # Makes sure that admin is closed afterwards.
95
- def with_admin_wait
96
- with_admin do |admin|
97
- yield(admin).wait(max_wait_timeout: max_wait_time)
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