karafka 1.4.12 → 2.2.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (359) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.github/FUNDING.yml +1 -0
  4. data/.github/ISSUE_TEMPLATE/bug_report.md +10 -9
  5. data/.github/workflows/ci.yml +169 -31
  6. data/.rspec +4 -0
  7. data/.ruby-version +1 -1
  8. data/CHANGELOG.md +716 -607
  9. data/CONTRIBUTING.md +10 -19
  10. data/Gemfile +7 -0
  11. data/Gemfile.lock +69 -92
  12. data/LICENSE +17 -0
  13. data/LICENSE-COMM +89 -0
  14. data/LICENSE-LGPL +165 -0
  15. data/README.md +48 -47
  16. data/bin/benchmarks +99 -0
  17. data/bin/create_token +22 -0
  18. data/bin/integrations +310 -0
  19. data/bin/karafka +5 -14
  20. data/bin/record_rss +50 -0
  21. data/bin/rspecs +6 -0
  22. data/bin/scenario +29 -0
  23. data/bin/stress_many +13 -0
  24. data/bin/stress_one +13 -0
  25. data/bin/verify_license_integrity +37 -0
  26. data/bin/wait_for_kafka +24 -0
  27. data/certs/cert_chain.pem +26 -0
  28. data/certs/karafka-pro.pem +11 -0
  29. data/config/locales/errors.yml +97 -0
  30. data/config/locales/pro_errors.yml +59 -0
  31. data/docker-compose.yml +19 -11
  32. data/karafka.gemspec +26 -22
  33. data/lib/active_job/karafka.rb +17 -0
  34. data/lib/active_job/queue_adapters/karafka_adapter.rb +32 -0
  35. data/lib/karafka/active_job/consumer.rb +49 -0
  36. data/lib/karafka/active_job/current_attributes/loading.rb +36 -0
  37. data/lib/karafka/active_job/current_attributes/persistence.rb +28 -0
  38. data/lib/karafka/active_job/current_attributes.rb +42 -0
  39. data/lib/karafka/active_job/dispatcher.rb +69 -0
  40. data/lib/karafka/active_job/job_extensions.rb +34 -0
  41. data/lib/karafka/active_job/job_options_contract.rb +32 -0
  42. data/lib/karafka/admin.rb +313 -0
  43. data/lib/karafka/app.rb +47 -23
  44. data/lib/karafka/base_consumer.rb +260 -29
  45. data/lib/karafka/cli/base.rb +67 -36
  46. data/lib/karafka/cli/console.rb +18 -12
  47. data/lib/karafka/cli/help.rb +24 -0
  48. data/lib/karafka/cli/info.rb +47 -12
  49. data/lib/karafka/cli/install.rb +23 -14
  50. data/lib/karafka/cli/server.rb +101 -44
  51. data/lib/karafka/cli/topics.rb +146 -0
  52. data/lib/karafka/cli.rb +24 -27
  53. data/lib/karafka/connection/client.rb +553 -90
  54. data/lib/karafka/connection/consumer_group_coordinator.rb +48 -0
  55. data/lib/karafka/connection/listener.rb +294 -38
  56. data/lib/karafka/connection/listeners_batch.rb +40 -0
  57. data/lib/karafka/connection/messages_buffer.rb +84 -0
  58. data/lib/karafka/connection/pauses_manager.rb +46 -0
  59. data/lib/karafka/connection/proxy.rb +98 -0
  60. data/lib/karafka/connection/raw_messages_buffer.rb +101 -0
  61. data/lib/karafka/connection/rebalance_manager.rb +105 -0
  62. data/lib/karafka/contracts/base.rb +17 -0
  63. data/lib/karafka/contracts/config.rb +130 -11
  64. data/lib/karafka/contracts/consumer_group.rb +32 -187
  65. data/lib/karafka/contracts/server_cli_options.rb +80 -19
  66. data/lib/karafka/contracts/topic.rb +65 -0
  67. data/lib/karafka/contracts.rb +1 -1
  68. data/lib/karafka/embedded.rb +36 -0
  69. data/lib/karafka/env.rb +46 -0
  70. data/lib/karafka/errors.rb +37 -21
  71. data/lib/karafka/helpers/async.rb +33 -0
  72. data/lib/karafka/helpers/colorize.rb +26 -0
  73. data/lib/karafka/helpers/multi_delegator.rb +2 -2
  74. data/lib/karafka/instrumentation/callbacks/error.rb +39 -0
  75. data/lib/karafka/instrumentation/callbacks/rebalance.rb +64 -0
  76. data/lib/karafka/instrumentation/callbacks/statistics.rb +51 -0
  77. data/lib/karafka/instrumentation/logger_listener.rb +303 -0
  78. data/lib/karafka/instrumentation/monitor.rb +13 -61
  79. data/lib/karafka/instrumentation/notifications.rb +79 -0
  80. data/lib/karafka/instrumentation/proctitle_listener.rb +7 -16
  81. data/lib/karafka/instrumentation/vendors/appsignal/base.rb +30 -0
  82. data/lib/karafka/instrumentation/vendors/appsignal/client.rb +122 -0
  83. data/lib/karafka/instrumentation/vendors/appsignal/dashboard.json +222 -0
  84. data/lib/karafka/instrumentation/vendors/appsignal/errors_listener.rb +30 -0
  85. data/lib/karafka/instrumentation/vendors/appsignal/metrics_listener.rb +331 -0
  86. data/lib/karafka/instrumentation/vendors/datadog/dashboard.json +1 -0
  87. data/lib/karafka/instrumentation/vendors/datadog/logger_listener.rb +155 -0
  88. data/lib/karafka/instrumentation/vendors/datadog/metrics_listener.rb +264 -0
  89. data/lib/karafka/instrumentation/vendors/kubernetes/liveness_listener.rb +176 -0
  90. data/lib/karafka/licenser.rb +78 -0
  91. data/lib/karafka/messages/batch_metadata.rb +52 -0
  92. data/lib/karafka/messages/builders/batch_metadata.rb +60 -0
  93. data/lib/karafka/messages/builders/message.rb +40 -0
  94. data/lib/karafka/messages/builders/messages.rb +36 -0
  95. data/lib/karafka/{params/params.rb → messages/message.rb} +20 -13
  96. data/lib/karafka/messages/messages.rb +71 -0
  97. data/lib/karafka/{params → messages}/metadata.rb +4 -6
  98. data/lib/karafka/messages/parser.rb +14 -0
  99. data/lib/karafka/messages/seek.rb +12 -0
  100. data/lib/karafka/patches/rdkafka/bindings.rb +122 -0
  101. data/lib/karafka/patches/rdkafka/opaque.rb +36 -0
  102. data/lib/karafka/pro/active_job/consumer.rb +47 -0
  103. data/lib/karafka/pro/active_job/dispatcher.rb +86 -0
  104. data/lib/karafka/pro/active_job/job_options_contract.rb +45 -0
  105. data/lib/karafka/pro/cleaner/errors.rb +27 -0
  106. data/lib/karafka/pro/cleaner/messages/message.rb +46 -0
  107. data/lib/karafka/pro/cleaner/messages/messages.rb +42 -0
  108. data/lib/karafka/pro/cleaner.rb +41 -0
  109. data/lib/karafka/pro/contracts/base.rb +23 -0
  110. data/lib/karafka/pro/contracts/server_cli_options.rb +111 -0
  111. data/lib/karafka/pro/encryption/cipher.rb +58 -0
  112. data/lib/karafka/pro/encryption/contracts/config.rb +79 -0
  113. data/lib/karafka/pro/encryption/errors.rb +27 -0
  114. data/lib/karafka/pro/encryption/messages/middleware.rb +46 -0
  115. data/lib/karafka/pro/encryption/messages/parser.rb +56 -0
  116. data/lib/karafka/pro/encryption/setup/config.rb +48 -0
  117. data/lib/karafka/pro/encryption.rb +47 -0
  118. data/lib/karafka/pro/iterator/expander.rb +95 -0
  119. data/lib/karafka/pro/iterator/tpl_builder.rb +155 -0
  120. data/lib/karafka/pro/iterator.rb +170 -0
  121. data/lib/karafka/pro/loader.rb +106 -0
  122. data/lib/karafka/pro/performance_tracker.rb +84 -0
  123. data/lib/karafka/pro/processing/collapser.rb +62 -0
  124. data/lib/karafka/pro/processing/coordinator.rb +147 -0
  125. data/lib/karafka/pro/processing/filters/base.rb +61 -0
  126. data/lib/karafka/pro/processing/filters/delayer.rb +70 -0
  127. data/lib/karafka/pro/processing/filters/expirer.rb +51 -0
  128. data/lib/karafka/pro/processing/filters/inline_insights_delayer.rb +78 -0
  129. data/lib/karafka/pro/processing/filters/throttler.rb +84 -0
  130. data/lib/karafka/pro/processing/filters/virtual_limiter.rb +52 -0
  131. data/lib/karafka/pro/processing/filters_applier.rb +105 -0
  132. data/lib/karafka/pro/processing/jobs/consume_non_blocking.rb +39 -0
  133. data/lib/karafka/pro/processing/jobs/revoked_non_blocking.rb +37 -0
  134. data/lib/karafka/pro/processing/jobs_builder.rb +50 -0
  135. data/lib/karafka/pro/processing/partitioner.rb +69 -0
  136. data/lib/karafka/pro/processing/scheduler.rb +75 -0
  137. data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_lrj_mom.rb +70 -0
  138. data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_lrj_mom_vp.rb +76 -0
  139. data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_mom.rb +72 -0
  140. data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_mom_vp.rb +76 -0
  141. data/lib/karafka/pro/processing/strategies/aj/dlq_lrj_mom.rb +66 -0
  142. data/lib/karafka/pro/processing/strategies/aj/dlq_lrj_mom_vp.rb +70 -0
  143. data/lib/karafka/pro/processing/strategies/aj/dlq_mom.rb +64 -0
  144. data/lib/karafka/pro/processing/strategies/aj/dlq_mom_vp.rb +69 -0
  145. data/lib/karafka/pro/processing/strategies/aj/ftr_lrj_mom.rb +38 -0
  146. data/lib/karafka/pro/processing/strategies/aj/ftr_lrj_mom_vp.rb +66 -0
  147. data/lib/karafka/pro/processing/strategies/aj/ftr_mom.rb +38 -0
  148. data/lib/karafka/pro/processing/strategies/aj/ftr_mom_vp.rb +58 -0
  149. data/lib/karafka/pro/processing/strategies/aj/lrj_mom.rb +37 -0
  150. data/lib/karafka/pro/processing/strategies/aj/lrj_mom_vp.rb +82 -0
  151. data/lib/karafka/pro/processing/strategies/aj/mom.rb +36 -0
  152. data/lib/karafka/pro/processing/strategies/aj/mom_vp.rb +52 -0
  153. data/lib/karafka/pro/processing/strategies/base.rb +26 -0
  154. data/lib/karafka/pro/processing/strategies/default.rb +105 -0
  155. data/lib/karafka/pro/processing/strategies/dlq/default.rb +137 -0
  156. data/lib/karafka/pro/processing/strategies/dlq/ftr.rb +61 -0
  157. data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj.rb +75 -0
  158. data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_mom.rb +71 -0
  159. data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_mom_vp.rb +43 -0
  160. data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_vp.rb +41 -0
  161. data/lib/karafka/pro/processing/strategies/dlq/ftr_mom.rb +69 -0
  162. data/lib/karafka/pro/processing/strategies/dlq/ftr_mom_vp.rb +41 -0
  163. data/lib/karafka/pro/processing/strategies/dlq/ftr_vp.rb +40 -0
  164. data/lib/karafka/pro/processing/strategies/dlq/lrj.rb +64 -0
  165. data/lib/karafka/pro/processing/strategies/dlq/lrj_mom.rb +65 -0
  166. data/lib/karafka/pro/processing/strategies/dlq/lrj_mom_vp.rb +36 -0
  167. data/lib/karafka/pro/processing/strategies/dlq/lrj_vp.rb +39 -0
  168. data/lib/karafka/pro/processing/strategies/dlq/mom.rb +68 -0
  169. data/lib/karafka/pro/processing/strategies/dlq/mom_vp.rb +37 -0
  170. data/lib/karafka/pro/processing/strategies/dlq/vp.rb +40 -0
  171. data/lib/karafka/pro/processing/strategies/ftr/default.rb +111 -0
  172. data/lib/karafka/pro/processing/strategies/ftr/vp.rb +40 -0
  173. data/lib/karafka/pro/processing/strategies/lrj/default.rb +85 -0
  174. data/lib/karafka/pro/processing/strategies/lrj/ftr.rb +69 -0
  175. data/lib/karafka/pro/processing/strategies/lrj/ftr_mom.rb +67 -0
  176. data/lib/karafka/pro/processing/strategies/lrj/ftr_mom_vp.rb +40 -0
  177. data/lib/karafka/pro/processing/strategies/lrj/ftr_vp.rb +39 -0
  178. data/lib/karafka/pro/processing/strategies/lrj/mom.rb +77 -0
  179. data/lib/karafka/pro/processing/strategies/lrj/mom_vp.rb +38 -0
  180. data/lib/karafka/pro/processing/strategies/lrj/vp.rb +36 -0
  181. data/lib/karafka/pro/processing/strategies/mom/default.rb +46 -0
  182. data/lib/karafka/pro/processing/strategies/mom/ftr.rb +53 -0
  183. data/lib/karafka/pro/processing/strategies/mom/ftr_vp.rb +37 -0
  184. data/lib/karafka/pro/processing/strategies/mom/vp.rb +35 -0
  185. data/lib/karafka/pro/processing/strategies/vp/default.rb +124 -0
  186. data/lib/karafka/pro/processing/strategies.rb +22 -0
  187. data/lib/karafka/pro/processing/strategy_selector.rb +84 -0
  188. data/lib/karafka/pro/processing/virtual_offset_manager.rb +147 -0
  189. data/lib/karafka/pro/routing/features/active_job/builder.rb +45 -0
  190. data/lib/karafka/pro/routing/features/active_job.rb +26 -0
  191. data/lib/karafka/pro/routing/features/base.rb +24 -0
  192. data/lib/karafka/pro/routing/features/dead_letter_queue/contracts/topic.rb +53 -0
  193. data/lib/karafka/pro/routing/features/dead_letter_queue.rb +27 -0
  194. data/lib/karafka/pro/routing/features/delaying/config.rb +27 -0
  195. data/lib/karafka/pro/routing/features/delaying/contracts/topic.rb +41 -0
  196. data/lib/karafka/pro/routing/features/delaying/topic.rb +59 -0
  197. data/lib/karafka/pro/routing/features/delaying.rb +29 -0
  198. data/lib/karafka/pro/routing/features/expiring/config.rb +27 -0
  199. data/lib/karafka/pro/routing/features/expiring/contracts/topic.rb +41 -0
  200. data/lib/karafka/pro/routing/features/expiring/topic.rb +59 -0
  201. data/lib/karafka/pro/routing/features/expiring.rb +27 -0
  202. data/lib/karafka/pro/routing/features/filtering/config.rb +40 -0
  203. data/lib/karafka/pro/routing/features/filtering/contracts/topic.rb +44 -0
  204. data/lib/karafka/pro/routing/features/filtering/topic.rb +51 -0
  205. data/lib/karafka/pro/routing/features/filtering.rb +27 -0
  206. data/lib/karafka/pro/routing/features/inline_insights/config.rb +32 -0
  207. data/lib/karafka/pro/routing/features/inline_insights/contracts/topic.rb +41 -0
  208. data/lib/karafka/pro/routing/features/inline_insights/topic.rb +52 -0
  209. data/lib/karafka/pro/routing/features/inline_insights.rb +26 -0
  210. data/lib/karafka/pro/routing/features/long_running_job/config.rb +28 -0
  211. data/lib/karafka/pro/routing/features/long_running_job/contracts/topic.rb +40 -0
  212. data/lib/karafka/pro/routing/features/long_running_job/topic.rb +42 -0
  213. data/lib/karafka/pro/routing/features/long_running_job.rb +28 -0
  214. data/lib/karafka/pro/routing/features/patterns/builder.rb +38 -0
  215. data/lib/karafka/pro/routing/features/patterns/config.rb +54 -0
  216. data/lib/karafka/pro/routing/features/patterns/consumer_group.rb +72 -0
  217. data/lib/karafka/pro/routing/features/patterns/contracts/consumer_group.rb +62 -0
  218. data/lib/karafka/pro/routing/features/patterns/contracts/pattern.rb +46 -0
  219. data/lib/karafka/pro/routing/features/patterns/contracts/topic.rb +41 -0
  220. data/lib/karafka/pro/routing/features/patterns/detector.rb +71 -0
  221. data/lib/karafka/pro/routing/features/patterns/pattern.rb +95 -0
  222. data/lib/karafka/pro/routing/features/patterns/patterns.rb +35 -0
  223. data/lib/karafka/pro/routing/features/patterns/topic.rb +50 -0
  224. data/lib/karafka/pro/routing/features/patterns/topics.rb +53 -0
  225. data/lib/karafka/pro/routing/features/patterns.rb +33 -0
  226. data/lib/karafka/pro/routing/features/pausing/contracts/topic.rb +51 -0
  227. data/lib/karafka/pro/routing/features/pausing/topic.rb +44 -0
  228. data/lib/karafka/pro/routing/features/pausing.rb +25 -0
  229. data/lib/karafka/pro/routing/features/throttling/config.rb +32 -0
  230. data/lib/karafka/pro/routing/features/throttling/contracts/topic.rb +44 -0
  231. data/lib/karafka/pro/routing/features/throttling/topic.rb +69 -0
  232. data/lib/karafka/pro/routing/features/throttling.rb +30 -0
  233. data/lib/karafka/pro/routing/features/virtual_partitions/config.rb +30 -0
  234. data/lib/karafka/pro/routing/features/virtual_partitions/contracts/topic.rb +55 -0
  235. data/lib/karafka/pro/routing/features/virtual_partitions/topic.rb +56 -0
  236. data/lib/karafka/pro/routing/features/virtual_partitions.rb +27 -0
  237. data/lib/karafka/pro.rb +13 -0
  238. data/lib/karafka/process.rb +24 -8
  239. data/lib/karafka/processing/coordinator.rb +181 -0
  240. data/lib/karafka/processing/coordinators_buffer.rb +62 -0
  241. data/lib/karafka/processing/executor.rb +155 -0
  242. data/lib/karafka/processing/executors_buffer.rb +72 -0
  243. data/lib/karafka/processing/expansions_selector.rb +22 -0
  244. data/lib/karafka/processing/inline_insights/consumer.rb +41 -0
  245. data/lib/karafka/processing/inline_insights/listener.rb +19 -0
  246. data/lib/karafka/processing/inline_insights/tracker.rb +128 -0
  247. data/lib/karafka/processing/jobs/base.rb +55 -0
  248. data/lib/karafka/processing/jobs/consume.rb +45 -0
  249. data/lib/karafka/processing/jobs/idle.rb +24 -0
  250. data/lib/karafka/processing/jobs/revoked.rb +22 -0
  251. data/lib/karafka/processing/jobs/shutdown.rb +23 -0
  252. data/lib/karafka/processing/jobs_builder.rb +28 -0
  253. data/lib/karafka/processing/jobs_queue.rb +150 -0
  254. data/lib/karafka/processing/partitioner.rb +24 -0
  255. data/lib/karafka/processing/result.rb +42 -0
  256. data/lib/karafka/processing/scheduler.rb +22 -0
  257. data/lib/karafka/processing/strategies/aj_dlq_mom.rb +44 -0
  258. data/lib/karafka/processing/strategies/aj_mom.rb +21 -0
  259. data/lib/karafka/processing/strategies/base.rb +52 -0
  260. data/lib/karafka/processing/strategies/default.rb +158 -0
  261. data/lib/karafka/processing/strategies/dlq.rb +88 -0
  262. data/lib/karafka/processing/strategies/dlq_mom.rb +49 -0
  263. data/lib/karafka/processing/strategies/mom.rb +29 -0
  264. data/lib/karafka/processing/strategy_selector.rb +47 -0
  265. data/lib/karafka/processing/worker.rb +93 -0
  266. data/lib/karafka/processing/workers_batch.rb +27 -0
  267. data/lib/karafka/railtie.rb +141 -0
  268. data/lib/karafka/routing/activity_manager.rb +84 -0
  269. data/lib/karafka/routing/builder.rb +45 -19
  270. data/lib/karafka/routing/consumer_group.rb +56 -20
  271. data/lib/karafka/routing/consumer_mapper.rb +1 -12
  272. data/lib/karafka/routing/features/active_job/builder.rb +33 -0
  273. data/lib/karafka/routing/features/active_job/config.rb +15 -0
  274. data/lib/karafka/routing/features/active_job/contracts/topic.rb +44 -0
  275. data/lib/karafka/routing/features/active_job/proxy.rb +14 -0
  276. data/lib/karafka/routing/features/active_job/topic.rb +33 -0
  277. data/lib/karafka/routing/features/active_job.rb +13 -0
  278. data/lib/karafka/routing/features/base/expander.rb +59 -0
  279. data/lib/karafka/routing/features/base.rb +71 -0
  280. data/lib/karafka/routing/features/dead_letter_queue/config.rb +19 -0
  281. data/lib/karafka/routing/features/dead_letter_queue/contracts/topic.rb +46 -0
  282. data/lib/karafka/routing/features/dead_letter_queue/topic.rb +41 -0
  283. data/lib/karafka/routing/features/dead_letter_queue.rb +16 -0
  284. data/lib/karafka/routing/features/declaratives/config.rb +18 -0
  285. data/lib/karafka/routing/features/declaratives/contracts/topic.rb +33 -0
  286. data/lib/karafka/routing/features/declaratives/topic.rb +44 -0
  287. data/lib/karafka/routing/features/declaratives.rb +14 -0
  288. data/lib/karafka/routing/features/inline_insights/config.rb +15 -0
  289. data/lib/karafka/routing/features/inline_insights/contracts/topic.rb +27 -0
  290. data/lib/karafka/routing/features/inline_insights/topic.rb +31 -0
  291. data/lib/karafka/routing/features/inline_insights.rb +40 -0
  292. data/lib/karafka/routing/features/manual_offset_management/config.rb +15 -0
  293. data/lib/karafka/routing/features/manual_offset_management/contracts/topic.rb +27 -0
  294. data/lib/karafka/routing/features/manual_offset_management/topic.rb +35 -0
  295. data/lib/karafka/routing/features/manual_offset_management.rb +18 -0
  296. data/lib/karafka/routing/proxy.rb +22 -21
  297. data/lib/karafka/routing/router.rb +24 -10
  298. data/lib/karafka/routing/subscription_group.rb +110 -0
  299. data/lib/karafka/routing/subscription_groups_builder.rb +65 -0
  300. data/lib/karafka/routing/topic.rb +87 -24
  301. data/lib/karafka/routing/topics.rb +46 -0
  302. data/lib/karafka/runner.rb +52 -0
  303. data/lib/karafka/serialization/json/deserializer.rb +7 -15
  304. data/lib/karafka/server.rb +113 -37
  305. data/lib/karafka/setup/attributes_map.rb +348 -0
  306. data/lib/karafka/setup/config.rb +256 -175
  307. data/lib/karafka/status.rb +54 -7
  308. data/lib/karafka/templates/example_consumer.rb.erb +16 -0
  309. data/lib/karafka/templates/karafka.rb.erb +33 -55
  310. data/lib/karafka/time_trackers/base.rb +14 -0
  311. data/lib/karafka/time_trackers/pause.rb +122 -0
  312. data/lib/karafka/time_trackers/poll.rb +69 -0
  313. data/lib/karafka/version.rb +1 -1
  314. data/lib/karafka.rb +91 -17
  315. data/renovate.json +9 -0
  316. data.tar.gz.sig +0 -0
  317. metadata +330 -168
  318. metadata.gz.sig +0 -0
  319. data/MIT-LICENCE +0 -18
  320. data/certs/mensfeld.pem +0 -25
  321. data/config/errors.yml +0 -41
  322. data/lib/karafka/assignment_strategies/round_robin.rb +0 -13
  323. data/lib/karafka/attributes_map.rb +0 -63
  324. data/lib/karafka/backends/inline.rb +0 -16
  325. data/lib/karafka/base_responder.rb +0 -226
  326. data/lib/karafka/cli/flow.rb +0 -48
  327. data/lib/karafka/cli/missingno.rb +0 -19
  328. data/lib/karafka/code_reloader.rb +0 -67
  329. data/lib/karafka/connection/api_adapter.rb +0 -158
  330. data/lib/karafka/connection/batch_delegator.rb +0 -55
  331. data/lib/karafka/connection/builder.rb +0 -23
  332. data/lib/karafka/connection/message_delegator.rb +0 -36
  333. data/lib/karafka/consumers/batch_metadata.rb +0 -10
  334. data/lib/karafka/consumers/callbacks.rb +0 -71
  335. data/lib/karafka/consumers/includer.rb +0 -64
  336. data/lib/karafka/consumers/responders.rb +0 -24
  337. data/lib/karafka/consumers/single_params.rb +0 -15
  338. data/lib/karafka/contracts/consumer_group_topic.rb +0 -19
  339. data/lib/karafka/contracts/responder_usage.rb +0 -54
  340. data/lib/karafka/fetcher.rb +0 -42
  341. data/lib/karafka/helpers/class_matcher.rb +0 -88
  342. data/lib/karafka/helpers/config_retriever.rb +0 -46
  343. data/lib/karafka/helpers/inflector.rb +0 -26
  344. data/lib/karafka/instrumentation/stdout_listener.rb +0 -140
  345. data/lib/karafka/params/batch_metadata.rb +0 -26
  346. data/lib/karafka/params/builders/batch_metadata.rb +0 -30
  347. data/lib/karafka/params/builders/params.rb +0 -38
  348. data/lib/karafka/params/builders/params_batch.rb +0 -25
  349. data/lib/karafka/params/params_batch.rb +0 -60
  350. data/lib/karafka/patches/ruby_kafka.rb +0 -47
  351. data/lib/karafka/persistence/client.rb +0 -29
  352. data/lib/karafka/persistence/consumers.rb +0 -45
  353. data/lib/karafka/persistence/topics.rb +0 -48
  354. data/lib/karafka/responders/builder.rb +0 -36
  355. data/lib/karafka/responders/topic.rb +0 -55
  356. data/lib/karafka/routing/topic_mapper.rb +0 -53
  357. data/lib/karafka/serialization/json/serializer.rb +0 -31
  358. data/lib/karafka/setup/configurators/water_drop.rb +0 -36
  359. data/lib/karafka/templates/application_responder.rb.erb +0 -11
data/CHANGELOG.md CHANGED
@@ -1,609 +1,718 @@
1
1
  # Karafka framework changelog
2
2
 
3
- ## 1.4.12 (2022-01-13)
4
- - Ruby 3.1 support
5
- - `irb` dependency removal (vbyno)
6
-
7
- ## 1.4.11 (2021-12-04)
8
- - Source code metadata url added to the gemspec
9
- - Gem bump
10
-
11
- ## 1.4.10 (2021-10-30)
12
- - update gems requirements in the gemspec (nijikon)
13
-
14
- ## 1.4.9 (2021-09-29)
15
- - fix `dry-configurable` deprecation warnings for default value as positional argument
16
-
17
- ## 1.4.8 (2021-09-08)
18
- - Allow 'rails' in Gemfile to enable rails-aware generator (rewritten)
19
-
20
- ## 1.4.7 (2021-09-04)
21
- - Update ruby-kafka to `1.4.0`
22
- - Support for `resolve_seed_brokers` option (with Azdaroth)
23
- - Set minimum `ruby-kafka` requirement to `1.3.0`
24
-
25
- ## 1.4.6 (2021-08-05)
26
- - #700 Fix Ruby 3 compatibility issues in Connection::Client#pause (MmKolodziej)
27
-
28
- ## 1.4.5 (2021-06-16)
29
- - Fixup logger checks for non-writeable logfile (ojab)
30
- - #689 - Update the stdout initialization message for framework initialization
31
-
32
- ## 1.4.4 (2021-04-19)
33
- - Remove Ruby 2.5 support and update minimum Ruby requirement to 2.6
34
- - Remove rake dependency
35
-
36
- ## 1.4.3 (2021-03-24)
37
- - Fixes for Ruby 3.0 compatibility
38
-
39
- ## 1.4.2 (2021-02-16)
40
- - Rescue Errno::EROFS in ensure_dir_exists (unasuke)
41
-
42
- ## 1.4.1 (2020-12-04)
43
- - Return non-zero exit code when printing usage
44
- - Add support for :assignment_strategy for consumers
45
-
46
- ## 1.4.0 (2020-09-05)
47
- - Rename `Karafka::Params::Metadata` to `Karafka::Params::BatchMetadata`
48
- - Rename consumer `#metadata` to `#batch_metadata`
49
- - Separate metadata (including Karafka native metadata) from the root of params (backwards compatibility preserved thanks to rabotyaga)
50
- - Remove metadata hash dependency
51
- - Remove params dependency on a hash in favour of PORO
52
- - Remove batch metadata dependency on a hash
53
- - Remove MultiJson in favour of JSON in the default deserializer
54
- - allow accessing all the metadata without accessing the payload
55
- - freeze params and underlying elements except for the mutable payload
56
- - provide access to raw payload after serialization
57
- - fixes a bug where a non-deserializable (error) params would be marked as deserialized after first unsuccessful deserialization attempt
58
- - fixes bug where karafka would mutate internal ruby-kafka state
59
- - fixes bug where topic name in metadata would not be mapped using topic mappers
60
- - simplifies the params and params batch API, before `#payload` usage, it won't be deserialized
61
- - removes the `#[]` API from params to prevent from accessing raw data in a different way than #raw_payload
62
- - makes the params batch operations consistent as params payload is deserialized only when accessed explicitly
63
-
64
- ## 1.3.7 (2020-08-11)
65
- - #599 - Allow metadata access without deserialization attempt (rabotyaga)
66
- - Sync with ruby-kafka `1.2.0` api
67
-
68
- ## 1.3.6 (2020-04-24)
69
- - #583 - Use Karafka.logger for CLI messages (prikha)
70
- - #582 - Cannot only define seed brokers in consumer groups
71
-
72
- ## 1.3.5 (2020-04-02)
73
- - #578 - ThreadError: can't be called from trap context patch
74
-
75
- ## 1.3.4 (2020-02-17)
76
- - `dry-configurable` upgrade (solnic)
77
- - Remove temporary `thor` patches that are no longer needed
78
-
79
- ## 1.3.3 (2019-12-23)
80
- - Require `delegate` to fix missing dependency in `ruby-kafka`
81
-
82
- ## 1.3.2 (2019-12-23)
83
- - #561 - Allow `thor` 1.0.x usage in Karafka
84
- - #567 - Ruby 2.7.0 support + unfreeze of a frozen string fix
85
-
86
- ## 1.3.1 (2019-11-11)
87
- - #545 - Makes sure the log directory exists when is possible (robertomiranda)
88
- - Ruby 2.6.5 support
89
- - #551 - add support for DSA keys
90
- - #549 - Missing directories after `karafka install` (nijikon)
91
-
92
- ## 1.3.0 (2019-09-09)
93
- - Drop support for Ruby 2.4
94
- - YARD docs tags cleanup
95
-
96
- ## 1.3.0.rc1 (2019-07-31)
97
- - Drop support for Kafka 0.10 in favor of native support for Kafka 0.11.
98
- - Update ruby-kafka to the 0.7 version
99
- - Support messages headers receiving
100
- - Message bus unification
101
- - Parser available in metadata
102
- - Cleanup towards moving to a non-global state app management
103
- - Drop Ruby 2.3 support
104
- - Support for Ruby 2.6.3
105
- - `Karafka::Loader` has been removed in favor of Zeitwerk
106
- - Schemas are now contracts
107
- - #393 - Reorganize responders - removed `multiple_usage` constrain
108
- - #388 - ssl_client_cert_chain sync
109
- - #300 - Store value in a value key and replace its content with parsed version - without root merge
110
- - #331 - Disallow building groups without topics
111
- - #340 - Instrumentation unification. Better and more consistent naming
112
- - #340 - Procline instrumentation for a nicer process name
113
- - #342 - Change default for `fetcher_max_queue_size` from `100` to `10` to lower max memory usage
114
- - #345 - Cleanup exceptions names
115
- - #341 - Split connection delegator into batch delegator and single_delegator
116
- - #351 - Rename `#retrieve!` to `#parse!` on params and `#parsed` to `parse!` on params batch.
117
- - #351 - Adds '#first' for params_batch that returns parsed first element from the params_batch object.
118
- - #360 - Single params consuming mode automatically parses data specs
119
- - #359 - Divide mark_as_consumed into mark_as_consumed and mark_as_consumed!
120
- - #356 - Provide a `#values` for params_batch to extract only values of objects from the params_batch
121
- - #363 - Too shallow ruby-kafka version lock
122
- - #354 - Expose consumer heartbeat
123
- - #377 - Remove the persistent setup in favor of persistence
124
- - #375 - Sidekiq Backend parser mismatch
125
- - #369 - Single consumer can support more than one topic
126
- - #288 - Drop dependency on `activesupport` gem
127
- - #371 - SASL over SSL
128
- - #392 - Move params redundant data to metadata
129
- - #335 - Metadata access from within the consumer
130
- - #402 - Delayed reconnection upon critical failures
131
- - #405 - `reconnect_timeout` value is now being validated
132
- - #437 - Specs ensuring that the `#437` won't occur in the `1.3` release
133
- - #426 - ssl client cert key password
134
- - #444 - add certificate and private key validation
135
- - #460 - Decouple responder "parser" (generator?) from topic.parser (benissimo)
136
- - #463 - Split parsers into serializers / deserializers
137
- - #473 - Support SASL OAuthBearer Authentication
138
- - #475 - Disallow subscribing to the same topic with multiple consumers
139
- - #485 - Setting shutdown_timeout to nil kills the app without waiting for anything
140
- - #487 - Make listeners as instances
141
- - #29 - Consumer class names must have the word "Consumer" in it in order to work (Sidekiq backend)
142
- - #491 - irb is missing for console to work
143
- - #502 - Karafka process hangs when sending multiple sigkills
144
- - #506 - ssl_verify_hostname sync
145
- - #483 - Upgrade dry-validation before releasing 1.3
146
- - #492 - Use Zeitwerk for code reload in development
147
- - #508 - Reset the consumers instances upon reconnecting to a cluster
148
- - [#530](https://github.com/karafka/karafka/pull/530) - expose ruby and ruby-kafka version
149
- - [534](https://github.com/karafka/karafka/pull/534) - Allow to use headers in the deserializer object
150
- - [#319](https://github.com/karafka/karafka/pull/328) - Support for exponential backoff in pause
151
-
152
- ## 1.2.11
153
- - [#470](https://github.com/karafka/karafka/issues/470) Karafka not working with dry-configurable 0.8
154
-
155
- ## 1.2.10
156
- - [#453](https://github.com/karafka/karafka/pull/453) require `Forwardable` module
157
-
158
- ## 1.2.9
159
- - Critical exceptions now will cause consumer to stop instead of retrying without a break
160
- - #412 - Fix dry-inflector dependency lock in gemspec
161
- - #414 - Backport to 1.2 the delayed retry upon failure
162
- - #437 - Raw message is no longer added to params after ParserError raised
163
-
164
- ## 1.2.8
165
- - #408 - Responder Topic Lookup Bug on Heroku
166
-
167
- ## 1.2.7
168
- - Unlock Ruby-kafka version with a warning
169
-
170
- ## 1.2.6
171
- - Lock WaterDrop to 1.2.3
172
- - Lock Ruby-Kafka to 0.6.x (support for 0.7 will be added in Karafka 1.3)
173
- - #382 - Full logging with AR, etc for development mode when there is Rails integration
174
-
175
- ## 1.2.5
176
- - #354 - Expose consumer heartbeat
177
- - #373 - Async producer not working properly with responders
178
-
179
- ## 1.2.4
180
- - #332 - Fetcher for max queue size
181
-
182
- ## 1.2.3
183
- - #313 - support PLAINTEXT and SSL for scheme
184
- - #288 - drop activesupport callbacks in favor of notifications
185
- - #320 - Pausing indefinitely with nil pause timeout doesn't work
186
- - #318 - Partition pausing doesn't work with custom topic mappers
187
- - Rename ConfigAdapter to ApiAdapter to better reflect what it does
188
- - #317 - Manual offset committing doesn't work with custom topic mappers
189
-
190
- ## 1.2.2
191
- - #312 - Broken for ActiveSupport 5.2.0
192
-
193
- ## 1.2.1
194
- - #304 - Unification of error instrumentation event details
195
- - #306 - Using file logger from within a trap context upon shutdown is impossible
196
-
197
- ## 1.2.0
198
- - Spec improvements
199
- - #260 - Specs missing randomization
200
- - #251 - Shutdown upon non responding (unreachable) cluster is not possible
201
- - #258 - Investigate lowering requirements on activesupport
202
- - #246 - Alias consumer#mark_as_consumed on controller
203
- - #259 - Allow forcing key/partition key on responders
204
- - #267 - Styling inconsistency
205
- - #242 - Support setting the max bytes to fetch per request
206
- - #247 - Support SCRAM once released
207
- - #271 - Provide an after_init option to pass a configuration block
208
- - #262 - Error in the monitor code for NewRelic
209
- - #241 - Performance metrics
210
- - #274 - Rename controllers to consumers
211
- - #184 - Seek to
212
- - #284 - Dynamic Params parent class
213
- - #275 - ssl_ca_certs_from_system
214
- - #296 - Instrument forceful exit with an error
215
- - Replaced some of the activesupport parts with dry-inflector
216
- - Lower ActiveSupport dependency
217
- - Remove configurators in favor of the after_init block configurator
218
- - Ruby 2.5.0 support
219
- - Renamed Karafka::Connection::Processor to Karafka::Connection::Delegator to match incoming naming conventions
220
- - Renamed Karafka::Connection::Consumer to Karafka::Connection::Client due to #274
221
- - Removed HashWithIndifferentAccess in favor of a regular hash
222
- - JSON parsing defaults now to string keys
223
- - Lower memory usage due to less params data internal details
224
- - Support multiple ```after_init``` blocks in favor of a single one
225
- - Renamed ```received_at``` to ```receive_time``` to follow ruby-kafka and WaterDrop conventions
226
- - Adjust internal setup to easier map Ruby-Kafka config changes
227
- - System callbacks reorganization
228
- - Added ```before_fetch_loop``` configuration block for early client usage (```#seek```, etc)
229
- - Renamed ```after_fetched``` to ```after_fetch``` to normalize the naming convention
230
- - Instrumentation on a connection delegator level
231
- - Added ```params_batch#last``` method to retrieve last element after unparsing
232
- - All params keys are now strings
233
-
234
- ## 1.1.2
235
- - #256 - Default kafka.seed_brokers configuration is created in invalid format
236
-
237
- ## 1.1.1
238
- - #253 - Allow providing a global per app parser in config settings
239
-
240
- ## 1.1.0
241
- - Gem bump
242
- - Switch from Celluloid to native Thread management
243
- - Improved shutdown process
244
- - Introduced optional fetch callbacks and moved current the ```after_received``` there as well
245
- - Karafka will raise Errors::InvalidPauseTimeout exception when trying to pause but timeout set to 0
246
- - Allow float for timeouts and other time based second settings
247
- - Renamed MessagesProcessor to Processor and MessagesConsumer to Consumer - we don't process and don't consumer anything else so it was pointless to keep this "namespace"
248
- - #232 - Remove unused ActiveSupport require
249
- - #214 - Expose consumer on a controller layer
250
- - #193 - Process shutdown callbacks
251
- - Fixed accessibility of ```#params_batch``` from the outside of the controller
252
- - connection_pool config options are no longer required
253
- - celluloid config options are no longer required
254
- - ```#perform``` is now renamed to ```#consume``` with warning level on using the old one (deprecated)
255
- - #235 - Rename perform to consume
256
- - Upgrade to ruby-kafka 0.5
257
- - Due to redesign of Waterdrop concurrency setting is no longer needed
258
- - #236 - Manual offset management
259
- - WaterDrop 1.0.0 support with async
260
- - Renamed ```batch_consuming``` option to ```batch_fetching``` as it is not a consumption (with processing) but a process of fetching messages from Kafka. The messages is considered consumed, when it is processed.
261
- - Renamed ```batch_processing``` to ```batch_consuming``` to resemble Kafka concept of consuming messages.
262
- - Renamed ```after_received``` to ```after_fetched``` to normalize the naming conventions.
263
- - Responders support the per topic ```async``` option.
264
-
265
- ## 1.0.1
266
- - #210 - LoadError: cannot load such file -- [...]/karafka.rb
267
- - Ruby 2.4.2 as a default (+travis integration)
268
- - JRuby upgrade
269
- - Expanded persistence layer (moved to a namespace for easier future development)
270
- - #213 - Misleading error when non-existing dependency is required
271
- - #212 - Make params react to #topic, #partition, #offset
272
- - #215 - Consumer group route dynamic options are ignored
273
- - #217 - check RUBY_ENGINE constant if RUBY_VERSION is missing (#217)
274
- - #218 - add configuration setting to control Celluloid's shutdown timeout
275
- - Renamed Karafka::Routing::Mapper to Karafka::Routing::TopicMapper to match naming conventions
276
- - #219 - Allow explicit consumer group names, without prefixes
277
- - Fix to early removed pid upon shutdown of demonized process
278
- - max_wait_time updated to match https://github.com/zendesk/ruby-kafka/issues/433
279
- - #230 - Better uri validation for seed brokers (incompatibility as the kafka:// or kafka+ssl:// is required)
280
- - Small internal docs fixes
281
- - Dry::Validation::MissingMessageError: message for broker_schema? was not found
282
- - #238 - warning: already initialized constant Karafka::Schemas::URI_SCHEMES
283
-
284
- ## 1.0.0
285
-
286
- ### Closed issues:
287
-
288
- - #103 - Env for logger is loaded 2 early (on gem load not on app init)
289
- - #142 - Possibility to better control Kafka consumers (consumer groups management)
290
- - #150 - Add support for start_from_beginning on a per topic basis
291
- - #154 - Support for min_bytes and max_wait_time on messages consuming
292
- - #160 - Reorganize settings to better resemble ruby-kafka requirements
293
- - #164 - If we decide to have configuration per topic, topic uniqueness should be removed
294
- - #165 - Router validator
295
- - #166 - Params and route reorganization (new API)
296
- - #167 - Remove Sidekiq UI from Karafka
297
- - #168 - Introduce unique IDs of routes
298
- - #171 - Add kafka message metadata to params
299
- - #176 - Transform Karafka::Connection::Consumer into a module
300
- - #177 - Monitor not reacting when kafka killed with -9
301
- - #175 - Allow single consumer to subscribe to multiple topics
302
- - #178 - Remove parsing failover when cannot unparse data
303
- - #174 - Extended config validation
304
- - ~~#180 - Switch from JSON parser to yajl-ruby~~
305
- - #181 - When responder is defined and not used due to ```respond_with``` not being triggered in the perform, it won't raise an exception.
306
- - #188 - Rename name in config to client id
307
- - #186 - Support ruby-kafka ```ssl_ca_cert_file_path``` config
308
- - #189 - karafka console does not preserve history on exit
309
- - #191 - Karafka 0.6.0rc1 does not work with jruby / now it does :-)
310
- - Switch to multi json so everyone can use their favourite JSON parser
311
- - Added jruby support in general and in Travis
312
- - #196 - Topic mapper does not map topics when subscribing thanks to @webandtech
313
- - #96 - Karafka server - possibility to run it only for a certain topics
314
- - ~~karafka worker cli option is removed (please use sidekiq directly)~~ - restored, bad idea
315
- - (optional) pausing upon processing failures ```pause_timeout```
316
- - Karafka console main process no longer intercepts irb errors
317
- - Wiki updates
318
- - #204 - Long running controllers
319
- - Better internal API to handle multiple usage cases using ```Karafka::Controllers::Includer```
320
- - #207 - Rename before_enqueued to after_received
321
- - #147 - De-attach Karafka from Sidekiq by extracting Sidekiq backend
322
-
323
- ### New features and improvements
324
-
325
- - batch processing thanks to ```#batch_consuming``` flag and ```#params_batch``` on controllers
326
- - ```#topic``` method on an controller instance to make a clear distinction in between params and route details
327
- - Changed routing model (still compatible with 0.5) to allow better resources management
328
- - Lower memory requirements due to object creation limitation (2-3 times less objects on each new message)
329
- - Introduced the ```#batch_consuming``` config flag (config for #126) that can be set per each consumer_group
330
- - Added support for partition, offset and partition key in the params hash
331
- - ```name``` option in config renamed to ```client_id```
332
- - Long running controllers with ```persistent``` flag on a topic config level, to make controller instances persistent between messages batches (single controller instance per topic per partition no per messages batch) - turned on by default
333
-
334
- ### Incompatibilities
335
-
336
- - Default boot file is renamed from app.rb to karafka.rb
337
- - Removed worker glass as dependency (now and independent gem)
338
- - ```kafka.hosts``` option renamed to ```kafka.seed_brokers``` - you don't need to provide all the hosts to work with Kafka
339
- - ```start_from_beginning``` moved into kafka scope (```kafka.start_from_beginning```)
340
- - Router no longer checks for route uniqueness - now you can define same routes for multiple kafkas and do a lot of crazy stuff, so it's your responsibility to check uniqueness
341
- - Change in the way we identify topics in between Karafka and Sidekiq workers. If you upgrade, please make sure, all the jobs scheduled in Sidekiq are finished before the upgrade.
342
- - ```batch_mode``` renamed to ```batch_fetching```
343
- - Renamed content to value to better resemble ruby-kafka internal messages naming convention
344
- - When having a responder with ```required``` topics and not using ```#respond_with``` at all, it will raise an exception
345
- - Renamed ```inline_mode``` to ```inline_processing``` to resemble other settings conventions
346
- - Renamed ```inline_processing``` to ```backend``` to reach 1.0 future compatibility
347
- - Single controller **needs** to be used for a single topic consumption
348
- - Renamed ```before_enqueue``` to ```after_received``` to better resemble internal logic, since for inline backend, there is no enqueue.
349
- - Due to the level on which topic and controller are related (class level), the dynamic worker selection is no longer available.
350
- - Renamed params #retrieve to params #retrieve! to better reflect what it does
351
-
352
- ### Other changes
353
- - PolishGeeksDevTools removed (in favour of Coditsu)
354
- - Waaaaaay better code quality thanks to switching from dev tools to Coditsu
355
- - Gem bump
356
- - Cleaner internal API
357
- - SRP
358
- - Better settings proxying and management between ruby-kafka and karafka
359
- - All internal validations are now powered by dry-validation
360
- - Better naming conventions to reflect Kafka reality
361
- - Removed Karafka::Connection::Message in favour of direct message details extraction from Kafka::FetchedMessage
362
-
363
- ## 0.5.0.3
364
- - #132 - When Kafka is gone, should reconnect after a time period
365
- - #136 - new ruby-kafka version + other gem bumps
366
- - ruby-kafka update
367
- - #135 - NonMatchingRouteError - better error description in the code
368
- - #140 - Move Capistrano Karafka to a different specific gem
369
- - #110 - Add call method on a responder class to alias instance build and call
370
- - #76 - Configs validator
371
- - #138 - Possibility to have no worker class defined if inline_mode is being used
372
- - #145 - Topic Mapper
373
- - Ruby update to 2.4.1
374
- - Gem bump x2
375
- - #158 - Update docs section on heroku usage
376
- - #150 - Add support for start_from_beginning on a per topic basis
377
- - #148 - Lower Karafka Sidekiq dependency
378
- - Allow karafka root to be specified from ENV
379
- - Handle SIGTERM as a shutdown command for kafka server to support Heroku deployment
380
-
381
- ## 0.5.0.2
382
- - Gems update x3
383
- - Default Ruby set to 2.3.3
384
- - ~~Default Ruby set to 2.4.0~~
385
- - Readme updates to match bug fixes and resolved issues
386
- - #95 - Allow options into responder
387
- - #98 - Use parser when responding on a topic
388
- - #114 - Option to configure waterdrop connection pool timeout and concurrency
389
- - #118 - Added dot in topic validation format
390
- - #119 - add support for authentication using SSL
391
- - #121 - JSON as a default for standalone responders usage
392
- - #122 - Allow on capistrano role customization
393
- - #125 - Add support to batch incoming messages
394
- - #130 - start_from_beginning flag on routes and default
395
- - #128 - Monitor caller_label not working with super on inheritance
396
- - Renamed *inline* to *inline_mode* to stay consistent with flags that change the way karafka works (#125)
397
- - Dry-configurable bump to 0.5 with fixed proc value evaluation on retrieve patch (internal change)
398
-
399
- ## 0.5.0.1
400
- - Fixed inconsistency in responders non-required topic definition. Now only required: false available
401
- - #101 - Responders fail when multiple_usage true and required false
402
- - fix error on startup from waterdrop #102
403
- - Waterdrop 0.3.2.1 with kafka.hosts instead of kafka_hosts
404
- - #105 - Karafka::Monitor#caller_label not working with inherited monitors
405
- - #99 - Standalone mode (without Sidekiq)
406
- - #97 - Buffer responders single topics before send (pre-validation)
407
- - Better control over consumer thanks to additional config options
408
- - #111 - Dynamic worker assignment based on the income params
409
- - Long shutdown time fix
410
-
411
- ## 0.5.0
412
- - Removed Zookeeper totally as dependency
413
- - Better group and partition rebalancing
414
- - Automatic thread management (no need for tuning) - each topic is a separate actor/thread
415
- - Moved from Poseidon into Ruby-Kafka
416
- - No more max_concurrency setting
417
- - After you define your App class and routes (and everything else) you need to add execute App.boot!
418
- - Manual consuming is no longer available (no more karafka consume command)
419
- - Karafka topics CLI is no longer available. No Zookeeper - no global topic discovery
420
- - Dropped ZK as dependency
421
- - karafka info command no longer prints details about Zookeeper
422
- - Better shutdown
423
- - No more autodiscovery via Zookeeper - instead, the whole cluster will be discovered directly from Kafka
424
- - No more support for Kafka 0.8
425
- - Support for Kafka 0.9
426
- - No more need for ActorCluster, since now we have a single thread (and Kafka connection) per topic
427
- - Ruby 2.2.* support dropped
428
- - Using App name as a Kafka client_id
429
- - Automatic Capistrano integration
430
- - Responders support for handling better responses pipe-lining and better responses flow description and design (see README for more details)
431
- - Gem bump
432
- - Readme updates
433
- - karafka flow CLI command for printing the application flow
434
- - Some internal refactoring
435
-
436
- ## 0.4.2
437
- - #87 - Re-consume mode with crone for better Rails/Rack integration
438
- - Moved Karafka server related stuff into separate Karafka::Server class
439
- - Renamed Karafka::Runner into Karafka::Fetcher
440
- - Gem bump
441
- - Added chroot option to Zookeeper options
442
- - Moved BROKERS_PATH into config from constant
443
- - Added Karafka consume CLI action for a short running single consumption round
444
- - Small fixes to close broken connections
445
- - Readme updates
446
-
447
- ## 0.4.1
448
- - Explicit throw(:abort) required to halt before_enqueue (like in Rails 5)
449
- - #61 - autodiscovery of Kafka brokers based on Zookeeper data
450
- - #63 - Graceful shutdown with current offset state during data processing
451
- - #65 - Example of NewRelic monitor is outdated
452
- - #71 - Setup should be executed after user code is loaded
453
- - Gem bump x3
454
- - Rubocop remarks
455
- - worker_timeout config option has been removed. It now needs to be defined manually by the framework user because WorkerGlass::Timeout can be disabled and we cannot use Karafka settings on a class level to initialize user code stuff
456
- - Moved setup logic under setup/Setup namespace
457
- - Better defaults handling
458
- - #75 - Kafka and Zookeeper options as a hash
459
- - #82 - Karafka autodiscovery fails upon caching of configs
460
- - #81 - Switch config management to dry configurable
461
- - Version fix
462
- - Dropped support for Ruby 2.1.*
463
- - Ruby bump to 2.3.1
464
-
465
- ## 0.4.0
466
- - Added WaterDrop gem with default configuration
467
- - Refactoring of config logic to simplify adding new dependencies that need to be configured based on #setup data
468
- - Gem bump
469
- - Readme updates
470
- - Renamed cluster to actor_cluster for method names
471
- - Replaced SidekiqGlass with generic WorkerGlass lib
472
- - Application bootstrap in app.rb no longer required
473
- - Karafka.boot needs to be executed after all the application files are loaded (template updated)
474
- - Small loader refactor (no API changes)
475
- - Ruby 2.3.0 support (default)
476
- - No more rake tasks
477
- - Karafka CLI instead of rake tasks
478
- - Worker cli command allows passing additional options directly to Sidekiq
479
- - Renamed concurrency to max_concurrency - it describes better what happens - Karafka will use this number of threads only when required
480
- - Added wait_timeout that allows us to tune how long should we wait on a single socket connection (single topic) for new messages before going to next one (this applies to each thread separately)
481
- - Rubocop remarks
482
- - Removed Sinatra and Puma dependencies
483
- - Karafka Cli internal reorganization
484
- - Karafka Cli routes task
485
- - #37 - warn log for failed parsing of a message
486
- - #43 - wrong constant name
487
- - #44 - Method name conflict
488
- - #48 - Cannot load such file -- celluloid/current
489
- - #46 - Loading application
490
- - #45 - Set up monitor in config
491
- - #47 - rake karafka:run uses app.rb only
492
- - #53 - README update with Sinatra/Rails integration description
493
- - #41 - New Routing engine
494
- - #54 - Move Karafka::Workers::BaseWorker to Karafka::BaseWorker
495
- - #55 - ApplicationController and ApplicationWorker
496
-
497
- ## 0.3.2
498
- - Karafka::Params::Params lazy load merge keys with string/symbol names priorities fix
499
-
500
- ## 0.3.1
501
- - Renamed Karafka::Monitor to Karafka::Process to represent a Karafka process wrapper
502
- - Added Karafka::Monitoring that allows to add custom logging and monitoring with external libraries and systems
503
- - Moved logging functionality into Karafka::Monitoring default monitoring
504
- - Added possibility to provide own monitoring as long as in responds to #notice and #notice_error
505
- - Standardized logging format for all logs
506
-
507
- ## 0.3.0
508
- - Switched from custom ParserError for each parser to general catching of Karafka::Errors::ParseError and its descendants
509
- - Gem bump
510
- - Fixed #32 - now when using custom workers that does not inherit from Karafka::BaseWorker perform method is not required. Using custom workers means that the logic that would normally lie under #perform, needs to be executed directly from the worker.
511
- - Fixed #31 - Technically didn't fix because this is how Sidekiq is meant to work, but provided possibility to assign custom interchangers that allow to bypass JSON encoding issues by converting data that goes to Redis to a required format (and parsing it back when it is fetched)
512
- - Added full parameters lazy load - content is no longer loaded during #perform_async if params are not used in before_enqueue
513
- - No more namespaces for Redis by default (use separate DBs)
514
-
515
- ## 0.1.21
516
- - Sidekiq 4.0.1 bump
517
- - Gem bump
518
- - Added direct celluloid requirement to Karafka (removed from Sidekiq)
519
-
520
- ## 0.1.19
521
- - Internal call - schedule naming change
522
- - Enqueue to perform_async naming in controller to follow Sidekiq naming convention
523
- - Gem bump
524
-
525
- ## 0.1.18
526
- - Changed Redis configuration options into a single hash that is directly passed to Redis setup for Sidekiq
527
- - Added config.ru to provide a Sidekiq web UI (see README for more details)
528
-
529
- ## 0.1.17
530
- - Changed Karafka::Connection::Cluster tp Karafka::Connection::ActorCluster to distinguish between a single thread actor cluster for multiple topic connection and a future feature that will allow process clusterization.
531
- - Add an ability to use user-defined parsers for a messages
532
- - Lazy load params for before callbacks
533
- - Automatic loading/initializing all workers classes during startup (so Sidekiq won't fail with unknown workers exception)
534
- - Params are now private to controller
535
- - Added bootstrap method to app.rb
536
-
537
- ## 0.1.16
538
- - Cluster level error catching for all exceptions so actor is not killer
539
- - Cluster level error logging
540
- - Listener refactoring (QueueConsumer extracted)
541
- - Karafka::Connection::QueueConsumer to wrap around fetching logic - technically we could replace Kafka with any other messaging engine as long as we preserve the same API
542
- - Added debug env for debugging purpose in applications
543
-
544
- ## 0.1.15
545
- - Fixed max_wait_ms vs socket_timeout_ms issue
546
- - Fixed closing queue connection after Poseidon::Errors::ProtocolError failure
547
- - Fixed wrong logging file selection based on env
548
- - Extracted Karafka::Connection::QueueConsumer object to wrap around queue connection
549
-
550
- ## 0.1.14
551
- - Rake tasks for listing all the topics on Kafka server (rake kafka:topics)
552
-
553
- ## 0.1.13
554
- - Ability to assign custom workers and use them bypassing Karafka::BaseWorker (or its descendants)
555
- - Gem bump
556
-
557
- ## 0.1.12
558
- - All internal errors went to Karafka::Errors namespace
559
-
560
- ## 0.1.11
561
- - Rescuing all the "before Sidekiq" processing so errors won't affect other incoming messages
562
- - Fixed dying actors after connection error
563
- - Added a new app status - "initializing"
564
- - Karafka::Status model cleanup
565
-
566
- ## 0.1.10
567
- - Added possibility to specify redis namespace in configuration (failover to app name)
568
- - Renamed redis_host to redis_url in configuration
569
-
570
- ## 0.1.9
571
- - Added worker logger
572
-
573
- ## 0.1.8
574
- - Dropped local env support in favour of [Envlogic](https://github.com/karafka/envlogic) - no changes in API
575
-
576
- ## 0.1.7
577
- - Karafka option for Redis hosts (not localhost only)
578
-
579
- ## 0.1.6
580
- - Added better concurency by clusterization of listeners
581
- - Added graceful shutdown
582
- - Added concurency that allows to handle bigger applications with celluloid
583
- - Karafka controllers no longer require group to be defined (created based on the topic and app name)
584
- - Karafka controllers no longer require topic to be defined (created based on the controller name)
585
- - Readme updates
586
-
587
- ## 0.1.5
588
- - Celluloid support for listeners
589
- - Multi target logging (STDOUT and file)
590
-
591
- ## 0.1.4
592
- - Renamed events to messages to follow Apache Kafka naming convention
593
-
594
- ## 0.1.3
595
- - Karafka::App.logger moved to Karafka.logger
596
- - README updates (Usage section was added)
597
-
598
- ## 0.1.2
599
- - Logging to log/environment.log
600
- - Karafka::Runner
601
-
602
- ## 0.1.1
603
- - README updates
604
- - Rake tasks updates
605
- - Rake installation task
606
- - Changelog file added
607
-
608
- ## 0.1.0
609
- - Initial framework code
3
+ ## 2.2.10 (2023-11-02)
4
+ - [Improvement] Allow for running `#pause` without specifying the offset (provide offset or `:consecutive`). This allows for pausing on the consecutive message (last received + 1), so after resume we will get last message received + 1 effectively not using `#seek` and not purging `librdafka` buffer preserving on networking. Please be mindful that this uses notion of last message passed from **librdkafka**, and not the last one available in the consumer (`messages.last`). While for regular cases they will be the same, when using things like DLQ, LRJs, VPs or Filtering API, those may not be the same.
5
+ - [Improvement] **Drastically** improve network efficiency of operating with LRJ by using the `:consecutive` offset as default strategy for running LRJs without moving the offset in place and purging the data.
6
+ - [Improvement] Do not "seek in place". When pausing and/or seeking to the same location as the current position, do nothing not to purge buffers and not to move to the same place where we are.
7
+ - [Fix] Pattern regexps should not be part of declaratives even when configured.
8
+
9
+ ### Upgrade Notes
10
+
11
+ In the latest Karafka release, there are no breaking changes. However, please note the updates to #pause and #seek. If you spot any issues, please report them immediately. Your feedback is crucial.
12
+
13
+ ## 2.2.9 (2023-10-24)
14
+ - [Improvement] Allow using negative offset references in `Karafka::Admin#read_topic`.
15
+ - [Change] Make sure that WaterDrop `2.6.10` or higher is used with this release to support transactions fully and the Web-UI.
16
+
17
+ ## 2.2.8 (2023-10-20)
18
+ - **[Feature]** Introduce Appsignal integration for errors and metrics tracking.
19
+ - [Improvement] Expose `#synchronize` for VPs to allow for locks when cross-VP consumers work is needed.
20
+ - [Improvement] Provide `#collapse_until!` direct consumer API to allow for collapsed virtual partitions consumer operations together with the Filtering API for advanced use-cases.
21
+ - [Refactor] Reorganize how rebalance events are propagated from `librdkafka` to Karafka. Replace `connection.client.rebalance_callback` with `rebalance.partitions_assigned` and `rebalance.partitions_revoked`. Introduce two extra events: `rebalance.partitions_assign` and `rebalance.partitions_revoke` to handle pre-rebalance future work.
22
+ - [Refactor] Remove `thor` as a CLI layer and rely on Ruby `OptParser`
23
+
24
+ ### Upgrade Notes
25
+
26
+ 1. Unless you were using `connection.client.rebalance_callback` which was considered private, nothing.
27
+ 2. None of the CLI commands should change but `thor` has been removed so please report if you find any bugs.
28
+
29
+ ## 2.2.7 (2023-10-07)
30
+ - **[Feature]** Introduce Inline Insights to both OSS and Pro. Inline Insights allow you to get the Kafka insights/metrics from the consumer instance and use them to alter the processing flow. In Pro, there's an extra filter flow allowing to ensure, that the insights exist during consumption.
31
+ - [Enhancement] Make sure, that subscription groups ids are unique by including their consumer group id in them similar to how topics ids are handled (not a breaking change).
32
+ - [Enhancement] Expose `#attempt` method on a consumer to directly indicate number of attempt of processing given data.
33
+ - [Enhancement] Support Rails 7.1.
34
+
35
+ ## 2.2.6 (2023-09-26)
36
+ - [Enhancement] Retry `Karafka::Admin#read_watermark_offsets` fetching upon `not_leader_for_partition` that can occur mostly on newly created topics in KRaft and after crashes during leader selection.
37
+
38
+ ## 2.2.5 (2023-09-25)
39
+ - [Enhancement] Ensure, that when topic related operations end, the result is usable. There were few cases where admin operations on topics would finish successfully but internal Kafka caches would not report changes for a short period of time.
40
+ - [Enhancement] Stabilize cooperative-sticky early shutdown procedure.
41
+ - [Fix] use `#nil?` instead of `#present?` on `DataDog::Tracing::SpanOperation` (vitellochris)
42
+ - [Maintenance] Align connection clearing API with Rails 7.1 deprecation warning.
43
+ - [Maintenance] Make `#subscription_group` reference consistent in the Routing and Instrumentation.
44
+ - [Maintenance] Align the consumer pause instrumentation with client pause instrumentation by adding `subscription_group` visibility to the consumer.
45
+
46
+ ## 2.2.4 (2023-09-13)
47
+ - [Enhancement] Compensate for potential Kafka cluster drifts vs consumer drift in batch metadata (#1611).
48
+
49
+ ## 2.2.3 (2023-09-12)
50
+ - [Fix] Karafka admin time based offset lookup can break for one non-default partition.
51
+
52
+ ## 2.2.2 (2023-09-11)
53
+ - [Feature] Provide ability to define routing defaults.
54
+ - [Maintenance] Require `karafka-core` `>=` `2.2.2`
55
+
56
+ ## 2.2.1 (2023-09-01)
57
+ - [Fix] Fix insufficient validation of named patterns
58
+ - [Maintenance] Rely on `2.2.x` `karafka-core`.
59
+
60
+ ## 2.2.0 (2023-09-01)
61
+ - **[Feature]** Introduce dynamic topic subscriptions based on patterns [Pro].
62
+ - [Enhancement] Allow for `Karafka::Admin` setup reconfiguration via `config.admin` scope.
63
+ - [Enhancement] Make sure that consumer group used by `Karafka::Admin` obeys the `ConsumerMapper` setup.
64
+ - [Fix] Fix a case where subscription group would not accept a symbol name.
65
+
66
+ ### Upgrade Notes
67
+
68
+ As always, please make sure you have upgraded to the most recent version of `2.1` before upgrading to `2.2`.
69
+
70
+ If you are not using Kafka ACLs, there is no action you need to take.
71
+
72
+ If you are using Kafka ACLs and you've set up permissions for `karafka_admin` group, please note that this name has now been changed and is subject to [Consumer Name Mapping](https://karafka.io/docs/Consumer-mappers/).
73
+
74
+ That means you must ensure that the new consumer group that by default equals `CLIENT_ID_karafka_admin` has appropriate permissions. Please note that the Web UI also uses this group.
75
+
76
+ `Karafka::Admin` now has its own set of configuration options available, and you can find more details about that [here](https://karafka.io/docs/Topics-management-and-administration/#configuration).
77
+
78
+ If you want to maintain the `2.1` behavior, that is `karafka_admin` admin group, we recommend introducing this case inside your consumer mapper. Assuming you use the default one, the code will look as follows:
79
+
80
+ ```ruby
81
+ class MyMapper
82
+ def call(raw_consumer_group_name)
83
+ # If group is the admin one, use as it was in 2.1
84
+ return 'karafka_admin' if raw_consumer_group_name == 'karafka_admin'
85
+
86
+ # Otherwise use default karafka strategy for the rest
87
+ "#{Karafka::App.config.client_id}_#{raw_consumer_group_name}"
88
+ end
89
+ end
90
+ ```
91
+
92
+ ## 2.1.13 (2023-08-28)
93
+ - **[Feature]** Introduce Cleaning API for much better memory management for iterative data processing [Pro].
94
+ - [Enhancement] Automatically free message resources after processed for ActiveJob jobs [Pro]
95
+ - [Enhancement] Free memory used by the raw payload as fast as possible after obtaining it from `karafka-rdkafka`.
96
+ - [Enhancement] Support changing `service_name` in DataDog integration.
97
+
98
+ ## 2.1.12 (2023-08-25)
99
+ - [Fix] Fix a case where DLQ + VP without intermediate marking would mark earlier message then the last one.
100
+
101
+ ## 2.1.11 (2023-08-23)
102
+ - [Enhancement] Expand the error handling for offset related queries with timeout error retries.
103
+ - [Enhancement] Allow for connection proxy timeouts configuration.
104
+
105
+ ## 2.1.10 (2023-08-21)
106
+ - [Enhancement] Introduce `connection.client.rebalance_callback` event for instrumentation of rebalances.
107
+ - [Enhancement] Introduce new `runner.before_call` monitor event.
108
+ - [Refactor] Introduce low level commands proxy to handle deviation in how we want to run certain commands and how rdkafka-ruby runs that by design.
109
+ - [Change] No longer validate excluded topics routing presence if patterns any as it does not match pattern subscriptions where you can exclude things that could be subscribed in the future.
110
+ - [Fix] do not report negative lag stored in the DD listener.
111
+ - [Fix] Do not report lags in the DD listener for cases where the assignment is not workable.
112
+ - [Fix] Do not report negative lags in the DD listener.
113
+ - [Fix] Extremely fast shutdown after boot in specs can cause process not to stop.
114
+ - [Fix] Disable `allow.auto.create.topics` for admin by default to prevent accidental topics creation on topics metadata lookups.
115
+ - [Fix] Improve the `query_watermark_offsets` operations by increasing too low timeout.
116
+ - [Fix] Increase `TplBuilder` timeouts to compensate for remote clusters.
117
+ - [Fix] Always try to unsubscribe short-lived consumers used throughout the system, especially in the admin APIs.
118
+ - [Fix] Add missing `connection.client.poll.error` error type reference.
119
+
120
+ ## 2.1.9 (2023-08-06)
121
+ - **[Feature]** Introduce ability to customize pause strategy on a per topic basis (Pro).
122
+ - [Improvement] Disable the extensive messages logging in the default `karafka.rb` template.
123
+ - [Change] Require `waterdrop` `>= 2.6.6` due to extra `LoggerListener` API.
124
+
125
+ ## 2.1.8 (2023-07-29)
126
+ - [Improvement] Introduce `Karafka::BaseConsumer#used?` method to indicate, that at least one invocation of `#consume` took or will take place. This can be used as a replacement to the non-direct `messages.count` check for shutdown and revocation to ensure, that the consumption took place or is taking place (in case of running LRJ).
127
+ - [Improvement] Make `messages#to_a` return copy of the underlying array to prevent scenarios, where the mutation impacts offset management.
128
+ - [Improvement] Mitigate a librdkafka `cooperative-sticky` rebalance crash issue.
129
+ - [Improvement] Provide ability to overwrite `consumer_persistence` per subscribed topic. This is mostly useful for plugins and extensions developers.
130
+ - [Fix] Fix a case where the performance tracker would crash in case of mutation of messages to an empty state.
131
+
132
+ ## 2.1.7 (2023-07-22)
133
+ - [Improvement] Always query for watermarks in the Iterator to improve the initial response time.
134
+ - [Improvement] Add `max_wait_time` option to the Iterator.
135
+ - [Fix] Fix a case where `Admin#read_topic` would wait for poll interval on non-existing messages instead of early exit.
136
+ - [Fix] Fix a case where Iterator with per partition offsets with negative lookups would go below the number of available messages.
137
+ - [Fix] Remove unused constant from Admin module.
138
+ - [Fix] Add missing `connection.client.rebalance_callback.error` to the `LoggerListener` instrumentation hook.
139
+
140
+ ## 2.1.6 (2023-06-29)
141
+ - [Improvement] Provide time support for iterator
142
+ - [Improvement] Provide time support for admin `#read_topic`
143
+ - [Improvement] Provide time support for consumer `#seek`.
144
+ - [Improvement] Remove no longer needed locks for client operations.
145
+ - [Improvement] Raise `Karafka::Errors::TopicNotFoundError` when trying to iterate over non-existing topic.
146
+ - [Improvement] Ensure that Kafka multi-command operations run under mutex together.
147
+ - [Change] Require `waterdrop` `>= 2.6.2`
148
+ - [Change] Require `karafka-core` `>= 2.1.1`
149
+ - [Refactor] Clean-up iterator code.
150
+ - [Fix] Improve performance in dev environment for a Rails app (juike)
151
+ - [Fix] Rename `InvalidRealOffsetUsage` to `InvalidRealOffsetUsageError` to align with naming of other errors.
152
+ - [Fix] Fix unstable spec.
153
+ - [Fix] Fix a case where automatic `#seek` would overwrite manual seek of a user when running LRJ.
154
+ - [Fix] Make sure, that user direct `#seek` and `#pause` operations take precedence over system actions.
155
+ - [Fix] Make sure, that `#pause` and `#resume` with one underlying connection do not race-condition.
156
+
157
+ ## 2.1.5 (2023-06-19)
158
+ - [Improvement] Drastically improve `#revoked?` response quality by checking the real time assignment lost state on librdkafka.
159
+ - [Improvement] Improve eviction of saturated jobs that would run on already revoked assignments.
160
+ - [Improvement] Expose `#commit_offsets` and `#commit_offsets!` methods in the consumer to provide ability to commit offsets directly to Kafka without having to mark new messages as consumed.
161
+ - [Improvement] No longer skip offset commit when no messages marked as consumed as `librdkafka` has fixed the crashes there.
162
+ - [Improvement] Remove no longer needed patches.
163
+ - [Improvement] Ensure, that the coordinator revocation status is switched upon revocation detection when using `#revoked?`
164
+ - [Improvement] Add benchmarks for marking as consumed (sync and async).
165
+ - [Change] Require `karafka-core` `>= 2.1.0`
166
+ - [Change] Require `waterdrop` `>= 2.6.1`
167
+
168
+ ## 2.1.4 (2023-06-06)
169
+ - [Fix] `processing_lag` and `consumption_lag` on empty batch fail on shutdown usage (#1475)
170
+
171
+ ## 2.1.3 (2023-05-29)
172
+ - [Maintenance] Add linter to ensure, that all integration specs end with `_spec.rb`.
173
+ - [Fix] Fix `#retrying?` helper result value (Aerdayne).
174
+ - [Fix] Fix `mark_as_consumed!` raising an error instead of `false` on `unknown_member_id` (#1461).
175
+ - [Fix] Enable phantom tests.
176
+
177
+ ## 2.1.2 (2023-05-26)
178
+ - Set minimum `karafka-core` on `2.0.13` to make sure correct version of `karafka-rdkafka` is used.
179
+ - Set minimum `waterdrop` on `2.5.3` to make sure correct version of `waterdrop` is used.
180
+
181
+ ## 2.1.1 (2023-05-24)
182
+ - [Fix] Liveness Probe Doesn't Meet HTTP 1.1 Criteria - Causing Kubernetes Restarts (#1450)
183
+
184
+ ## 2.1.0 (2023-05-22)
185
+ - **[Feature]** Provide ability to use CurrentAttributes with ActiveJob's Karafka adapter (federicomoretti).
186
+ - **[Feature]** Introduce collective Virtual Partitions offset management.
187
+ - **[Feature]** Use virtual offsets to filter out messages that would be re-processed upon retries.
188
+ - [Improvement] No longer break processing on failing parallel virtual partitions in ActiveJob because it is compensated by virtual marking.
189
+ - [Improvement] Always use Virtual offset management for Pro ActiveJobs.
190
+ - [Improvement] Do not attempt to mark offsets on already revoked partitions.
191
+ - [Improvement] Make sure, that VP components are not injected into non VP strategies.
192
+ - [Improvement] Improve complex strategies inheritance flow.
193
+ - [Improvement] Optimize offset management for DLQ + MoM feature combinations.
194
+ - [Change] Removed `Karafka::Pro::BaseConsumer` in favor of `Karafka::BaseConsumer`. (#1345)
195
+ - [Fix] Fix for `max_messages` and `max_wait_time` not having reference in errors.yml (#1443)
196
+
197
+ ### Upgrade Notes
198
+
199
+ 1. Upgrade to Karafka `2.0.41` prior to upgrading to `2.1.0`.
200
+ 2. Replace `Karafka::Pro::BaseConsumer` references to `Karafka::BaseConsumer`.
201
+ 3. Replace `Karafka::Instrumentation::Vendors::Datadog:Listener` with `Karafka::Instrumentation::Vendors::Datadog::MetricsListener`.
202
+
203
+ ## 2.0.41 (2023-04-19)
204
+ - **[Feature]** Provide `Karafka::Pro::Iterator` for anonymous topic/partitions iterations and messages lookups (#1389 and #1427).
205
+ - [Improvement] Optimize topic lookup for `read_topic` admin method usage.
206
+ - [Improvement] Report via `LoggerListener` information about the partition on which a given job has started and finished.
207
+ - [Improvement] Slightly normalize the `LoggerListener` format. Always report partition related operations as followed: `TOPIC_NAME/PARTITION`.
208
+ - [Improvement] Do not retry recovery from `unknown_topic_or_part` when Karafka is shutting down as there is no point and no risk of any data losses.
209
+ - [Improvement] Report `client.software.name` and `client.software.version` according to `librdkafka` recommendation.
210
+ - [Improvement] Report ten longest integration specs after the suite execution.
211
+ - [Improvement] Prevent user originating errors related to statistics processing after listener loop crash from potentially crashing the listener loop and hanging Karafka process.
212
+
213
+ ## 2.0.40 (2023-04-13)
214
+ - [Improvement] Introduce `Karafka::Messages::Messages#empty?` method to handle Idle related cases where shutdown or revocation would be called on an empty messages set. This method allows for checking if there are any messages in the messages batch.
215
+ - [Refactor] Require messages builder to accept partition and do not fetch it from messages.
216
+ - [Refactor] Use empty messages set for internal APIs (Idle) (so there always is `Karafka::Messages::Messages`)
217
+ - [Refactor] Allow for empty messages set initialization with -1001 and -1 on metadata (similar to `librdkafka`)
218
+
219
+ ## 2.0.39 (2023-04-11)
220
+ - **[Feature]** Provide ability to throttle/limit number of messages processed in a time unit (#1203)
221
+ - **[Feature]** Provide Delayed Topics (#1000)
222
+ - **[Feature]** Provide ability to expire messages (expiring topics)
223
+ - **[Feature]** Provide ability to apply filters after messages are polled and before enqueued. This is a generic filter API for any usage.
224
+ - [Improvement] When using ActiveJob with Virtual Partitions, Karafka will stop if collectively VPs are failing. This minimizes number of jobs that will be collectively re-processed.
225
+ - [Improvement] `#retrying?` method has been added to consumers to provide ability to check, that we're reprocessing data after a failure. This is useful for branching out processing based on errors.
226
+ - [Improvement] Track active_job_id in instrumentation (#1372)
227
+ - [Improvement] Introduce new housekeeping job type called `Idle` for non-consumption execution flows.
228
+ - [Improvement] Change how a manual offset management works with Long-Running Jobs. Use the last message offset to move forward instead of relying on the last message marked as consumed for a scenario where no message is marked.
229
+ - [Improvement] Prioritize in Pro non-consumption jobs execution over consumption despite LJF. This will ensure, that housekeeping as well as other non-consumption events are not saturated when running a lot of work.
230
+ - [Improvement] Normalize the DLQ behaviour with MoM. Always pause on dispatch for all the strategies.
231
+ - [Improvement] Improve the manual offset management and DLQ behaviour when no markings occur for OSS.
232
+ - [Improvement] Do not early stop ActiveJob work running under virtual partitions to prevent extensive reprocessing.
233
+ - [Improvement] Drastically increase number of scenarios covered by integration specs (OSS and Pro).
234
+ - [Improvement] Introduce a `Coordinator#synchronize` lock for cross virtual partitions operations.
235
+ - [Fix] Do not resume partition that is not paused.
236
+ - [Fix] Fix `LoggerListener` cases where logs would not include caller id (when available)
237
+ - [Fix] Fix not working benchmark tests.
238
+ - [Fix] Fix a case where when using manual offset management with a user pause would ignore the pause and seek to the next message.
239
+ - [Fix] Fix a case where dead letter queue would go into an infinite loop on message with first ever offset if the first ever offset would not recover.
240
+ - [Fix] Make sure to resume always for all LRJ strategies on revocation.
241
+ - [Refactor] Make sure that coordinator is topic aware. Needed for throttling, delayed processing and expired jobs.
242
+ - [Refactor] Put Pro strategies into namespaces to better organize multiple combinations.
243
+ - [Refactor] Do not rely on messages metadata for internal topic and partition operations like `#seek` so they can run independently from the consumption flow.
244
+ - [Refactor] Hold a single topic/partition reference on a coordinator instead of in executor, coordinator and consumer.
245
+ - [Refactor] Move `#mark_as_consumed` and `#mark_as_consumed!`into `Strategies::Default` to be able to introduce marking for virtual partitions.
246
+
247
+ ## 2.0.38 (2023-03-27)
248
+ - [Improvement] Introduce `Karafka::Admin#read_watermark_offsets` to get low and high watermark offsets values.
249
+ - [Improvement] Track active_job_id in instrumentation (#1372)
250
+ - [Improvement] Improve `#read_topic` reading in case of a compacted partition where the offset is below the low watermark offset. This should optimize reading and should not go beyond the low watermark offset.
251
+ - [Improvement] Allow `#read_topic` to accept instance settings to overwrite any settings needed to customize reading behaviours.
252
+
253
+ ## 2.0.37 (2023-03-20)
254
+ - [Fix] Declarative topics execution on a secondary cluster run topics creation on the primary one (#1365)
255
+ - [Fix] Admin read operations commit offset when not needed (#1369)
256
+
257
+ ## 2.0.36 (2023-03-17)
258
+ - [Refactor] Rename internal naming of `Structurable` to `Declaratives` for declarative topics feature.
259
+ - [Fix] AJ + DLQ + MOM + LRJ is pausing indefinitely after the first job (#1362)
260
+
261
+ ## 2.0.35 (2023-03-13)
262
+ - **[Feature]** Allow for defining topics config via the DSL and its automatic creation via CLI command.
263
+ - **[Feature]** Allow for full topics reset and topics repartitioning via the CLI.
264
+
265
+ ## 2.0.34 (2023-03-04)
266
+ - [Improvement] Attach an `embedded` tag to Karafka processes started using the embedded API.
267
+ - [Change] Renamed `Datadog::Listener` to `Datadog::MetricsListener` for consistency. (#1124)
268
+
269
+ ### Upgrade Notes
270
+
271
+ 1. Replace `Datadog::Listener` references to `Datadog::MetricsListener`.
272
+
273
+ ## 2.0.33 (2023-02-24)
274
+ - **[Feature]** Support `perform_all_later` in ActiveJob adapter for Rails `7.1+`
275
+ - **[Feature]** Introduce ability to assign and re-assign tags in consumer instances. This can be used for extra instrumentation that is context aware.
276
+ - **[Feature]** Introduce ability to assign and reassign tags to the `Karafka::Process`.
277
+ - [Improvement] When using `ActiveJob` adapter, automatically tag jobs with the name of the `ActiveJob` class that is running inside of the `ActiveJob` consumer.
278
+ - [Improvement] Make `::Karafka::Instrumentation::Notifications::EVENTS` list public for anyone wanting to re-bind those into a different notification bus.
279
+ - [Improvement] Set `fetch.message.max.bytes` for `Karafka::Admin` to `5MB` to make sure that all data is fetched correctly for Web UI under heavy load (many consumers).
280
+ - [Improvement] Introduce a `strict_topics_namespacing` config option to enable/disable the strict topics naming validations. This can be useful when working with pre-existing topics which we cannot or do not want to rename.
281
+ - [Fix] Karafka monitor is prematurely cached (#1314)
282
+
283
+ ### Upgrade Notes
284
+
285
+ Since `#tags` were introduced on consumers, the `#tags` method is now part of the consumers API.
286
+
287
+ This means, that in case you were using a method called `#tags` in your consumers, you will have to rename it:
288
+
289
+ ```ruby
290
+ class EventsConsumer < ApplicationConsumer
291
+ def consume
292
+ messages.each do |message|
293
+ tags << message.payload.tag
294
+ end
295
+
296
+ tags.each { |tags| puts tag }
297
+ end
298
+
299
+ private
300
+
301
+ # This will collide with the tagging API
302
+ # This NEEDS to be renamed not to collide with `#tags` method provided by the consumers API.
303
+ def tags
304
+ @tags ||= Set.new
305
+ end
306
+ end
307
+ ```
308
+
309
+ ## 2.0.32 (2023-02-13)
310
+ - [Fix] Many non-existing topic subscriptions propagate poll errors beyond client
311
+ - [Improvement] Ignore `unknown_topic_or_part` errors in dev when `allow.auto.create.topics` is on.
312
+ - [Improvement] Optimize temporary errors handling in polling for a better backoff policy
313
+
314
+ ## 2.0.31 (2023-02-12)
315
+ - [Feature] Allow for adding partitions via `Admin#create_partitions` API.
316
+ - [Fix] Do not ignore admin errors upon invalid configuration (#1254)
317
+ - [Fix] Topic name validation (#1300) - CandyFet
318
+ - [Improvement] Increase the `max_wait_timeout` on admin operations to five minutes to make sure no timeout on heavily loaded clusters.
319
+ - [Maintenance] Require `karafka-core` >= `2.0.11` and switch to shared RSpec locator.
320
+ - [Maintenance] Require `karafka-rdkafka` >= `0.12.1`
321
+
322
+ ## 2.0.30 (2023-01-31)
323
+ - [Improvement] Alias `--consumer-groups` with `--include-consumer-groups`
324
+ - [Improvement] Alias `--subscription-groups` with `--include-subscription-groups`
325
+ - [Improvement] Alias `--topics` with `--include-topics`
326
+ - [Improvement] Introduce `--exclude-consumer-groups` for ability to exclude certain consumer groups from running
327
+ - [Improvement] Introduce `--exclude-subscription-groups` for ability to exclude certain subscription groups from running
328
+ - [Improvement] Introduce `--exclude-topics` for ability to exclude certain topics from running
329
+
330
+ ## 2.0.29 (2023-01-30)
331
+ - [Improvement] Make sure, that the `Karafka#producer` instance has the `LoggerListener` enabled in the install template, so Karafka by default prints both consumer and producer info.
332
+ - [Improvement] Extract the code loading capabilities of Karafka console from the executable, so web can use it to provide CLI commands.
333
+ - [Fix] Fix for: running karafka console results in NameError with Rails (#1280)
334
+ - [Fix] Make sure, that the `caller` for async errors is being published.
335
+ - [Change] Make sure that WaterDrop `2.4.10` or higher is used with this release to support Web-UI.
336
+
337
+ ## 2.0.28 (2023-01-25)
338
+ - **[Feature]** Provide the ability to use Dead Letter Queue with Virtual Partitions.
339
+ - [Improvement] Collapse Virtual Partitions upon retryable error to a single partition. This allows dead letter queue to operate and mitigate issues arising from work virtualization. This removes uncertainties upon errors that can be retried and processed. Affects given topic partition virtualization only for multi-topic and multi-partition parallelization. It also minimizes potential "flickering" where given data set has potentially many corrupted messages. The collapse will last until all the messages from the collective corrupted batch are processed. After that, virtualization will resume.
340
+ - [Improvement] Introduce `#collapsed?` consumer method available for consumers using Virtual Partitions.
341
+ - [Improvement] Allow for customization of DLQ dispatched message details in Pro (#1266) via the `#enhance_dlq_message` consumer method.
342
+ - [Improvement] Include `original_consumer_group` in the DLQ dispatched messages in Pro.
343
+ - [Improvement] Use Karafka `client_id` as kafka `client.id` value by default
344
+
345
+ ### Upgrade Notes
346
+
347
+ If you want to continue to use `karafka` as default for kafka `client.id`, assign it manually:
348
+
349
+ ```ruby
350
+ class KarafkaApp < Karafka::App
351
+ setup do |config|
352
+ # Other settings...
353
+ config.kafka = {
354
+ 'client.id': 'karafka'
355
+ }
356
+ ```
357
+
358
+ ## 2.0.27 (2023-01-11)
359
+ - Do not lock Ruby version in Karafka in favour of `karafka-core`.
360
+ - Make sure `karafka-core` version is at least `2.0.9` to make sure we run `karafka-rdkafka`.
361
+
362
+ ## 2.0.26 (2023-01-10)
363
+ - **[Feature]** Allow for disabling given topics by setting `active` to false. It will exclude them from consumption but will allow to have their definitions for using admin APIs, etc.
364
+ - [Improvement] Early terminate on `read_topic` when reaching the last offset available on the request time.
365
+ - [Improvement] Introduce a `quiet` state that indicates that Karafka is not only moving to quiet mode but actually that it reached it and no work will happen anymore in any of the consumer groups.
366
+ - [Improvement] Use Karafka defined routes topics when possible for `read_topic` admin API.
367
+ - [Improvement] Introduce `client.pause` and `client.resume` instrumentation hooks for tracking client topic partition pausing and resuming. This is alongside of `consumer.consuming.pause` that can be used to track both manual and automatic pausing with more granular consumer related details. The `client.*` should be used for low level tracking.
368
+ - [Improvement] Replace `LoggerListener` pause notification with one based on `client.pause` instead of `consumer.consuming.pause`.
369
+ - [Improvement] Expand `LoggerListener` with `client.resume` notification.
370
+ - [Improvement] Replace random anonymous subscription groups ids with stable once.
371
+ - [Improvement] Add `consumer.consume`, `consumer.revoke` and `consumer.shutting_down` notification events and move the revocation logic calling to strategies.
372
+ - [Change] Rename job queue statistics `processing` key to `busy`. No changes needed because naming in the DataDog listener stays the same.
373
+ - [Fix] Fix proctitle listener state changes reporting on new states.
374
+ - [Fix] Make sure all files descriptors are closed in the integration specs.
375
+ - [Fix] Fix a case where empty subscription groups could leak into the execution flow.
376
+ - [Fix] Fix `LoggerListener` reporting so it does not end with `.`.
377
+ - [Fix] Run previously defined (if any) signal traps created prior to Karafka signals traps.
378
+
379
+ ## 2.0.25 (2023-01-10)
380
+ - Release yanked due to accidental release with local changes.
381
+
382
+ ## 2.0.24 (2022-12-19)
383
+ - **[Feature]** Provide out of the box encryption support for Pro.
384
+ - [Improvement] Add instrumentation upon `#pause`.
385
+ - [Improvement] Add instrumentation upon retries.
386
+ - [Improvement] Assign `#id` to consumers similar to other entities for ease of debugging.
387
+ - [Improvement] Add retries and pausing to the default `LoggerListener`.
388
+ - [Improvement] Introduce a new final `terminated` state that will kick in prior to exit but after all the instrumentation and other things are done.
389
+ - [Improvement] Ensure that state transitions are thread-safe and ensure state transitions can occur in one direction.
390
+ - [Improvement] Optimize status methods proxying to `Karafka::App`.
391
+ - [Improvement] Allow for easier state usage by introducing explicit `#to_s` for reporting.
392
+ - [Improvement] Change auto-generated id from `SecureRandom#uuid` to `SecureRandom#hex(6)`
393
+ - [Improvement] Emit statistic every 5 seconds by default.
394
+ - [Improvement] Introduce general messages parser that can be swapped when needed.
395
+ - [Fix] Do not trigger code reloading when `consumer_persistence` is enabled.
396
+ - [Fix] Shutdown producer after all the consumer components are down and the status is stopped. This will ensure, that any instrumentation related Kafka messaging can still operate.
397
+
398
+ ### Upgrade Notes
399
+
400
+ If you want to disable `librdkafka` statistics because you do not use them at all, update the `kafka` `statistics.interval.ms` setting and set it to `0`:
401
+
402
+ ```ruby
403
+ class KarafkaApp < Karafka::App
404
+ setup do |config|
405
+ # Other settings...
406
+ config.kafka = {
407
+ 'statistics.interval.ms': 0
408
+ }
409
+ end
410
+ end
411
+ ```
412
+
413
+ ## 2.0.23 (2022-12-07)
414
+ - [Maintenance] Align with `waterdrop` and `karafka-core`
415
+ - [Improvement] Provide `Admin#read_topic` API to get topic data without subscribing.
416
+ - [Improvement] Upon an end user `#pause`, do not commit the offset in automatic offset management mode. This will prevent from a scenario where pause is needed but during it a rebalance occurs and a different assigned process starts not from the pause location but from the automatic offset that may be different. This still allows for using the `#mark_as_consumed`.
417
+ - [Fix] Fix a scenario where manual `#pause` would be overwritten by a resume initiated by the strategy.
418
+ - [Fix] Fix a scenario where manual `#pause` in LRJ would cause infinite pause.
419
+
420
+ ## 2.0.22 (2022-12-02)
421
+ - [Improvement] Load Pro components upon Karafka require so they can be altered prior to setup.
422
+ - [Improvement] Do not run LRJ jobs that were added to the jobs queue but were revoked meanwhile.
423
+ - [Improvement] Allow running particular named subscription groups similar to consumer groups.
424
+ - [Improvement] Allow running particular topics similar to consumer groups.
425
+ - [Improvement] Raise configuration error when trying to run Karafka with options leading to no subscriptions.
426
+ - [Fix] Fix `karafka info` subscription groups count reporting as it was misleading.
427
+ - [Fix] Allow for defining subscription groups with symbols similar to consumer groups and topics to align the API.
428
+ - [Fix] Do not allow for an explicit `nil` as a `subscription_group` block argument.
429
+ - [Fix] Fix instability in subscription groups static members ids when using `--consumer_groups` CLI flag.
430
+ - [Fix] Fix a case in routing, where anonymous subscription group could not be used inside of a consumer group.
431
+ - [Fix] Fix a case where shutdown prior to listeners build would crash the server initialization.
432
+ - [Fix] Duplicated logs in development environment for Rails when logger set to `$stdout`.
433
+
434
+ ## 20.0.21 (2022-11-25)
435
+ - [Improvement] Make revocation jobs for LRJ topics non-blocking to prevent blocking polling when someone uses non-revocation aware LRJ jobs and revocation happens.
436
+
437
+ ## 2.0.20 (2022-11-24)
438
+ - [Improvement] Support `group.instance.id` assignment (static group membership) for a case where a single consumer group has multiple subscription groups (#1173).
439
+
440
+ ## 2.0.19 (2022-11-20)
441
+ - **[Feature]** Provide ability to skip failing messages without dispatching them to an alternative topic (DLQ).
442
+ - [Improvement] Improve the integration with Ruby on Rails by preventing double-require of components.
443
+ - [Improvement] Improve stability of the shutdown process upon critical errors.
444
+ - [Improvement] Improve stability of the integrations spec suite.
445
+ - [Fix] Fix an issue where upon fast startup of multiple subscription groups from the same consumer group, a ghost queue would be created due to problems in `Concurrent::Hash`.
446
+
447
+ ## 2.0.18 (2022-11-18)
448
+ - **[Feature]** Support quiet mode via `TSTP` signal. When used, Karafka will finish processing current messages, run `shutdown` jobs, and switch to a quiet mode where no new work is being accepted. At the same time, it will keep the consumer group quiet, and thus no rebalance will be triggered. This can be particularly useful during deployments.
449
+ - [Improvement] Trigger `#revoked` for jobs in case revocation would happen during shutdown when jobs are still running. This should ensure, we get a notion of revocation for Pro LRJ jobs even when revocation happening upon shutdown (#1150).
450
+ - [Improvement] Stabilize the shutdown procedure for consumer groups with many subscription groups that have non-aligned processing cost per batch.
451
+ - [Improvement] Remove double loading of Karafka via Rails railtie.
452
+ - [Fix] Fix invalid class references in YARD docs.
453
+ - [Fix] prevent parallel closing of many clients.
454
+ - [Fix] fix a case where information about revocation for a combination of LRJ + VP would not be dispatched until all VP work is done.
455
+
456
+ ## 2.0.17 (2022-11-10)
457
+ - [Fix] Few typos around DLQ and Pro DLQ Dispatch original metadata naming.
458
+ - [Fix] Narrow the components lookup to the appropriate scope (#1114)
459
+
460
+ ### Upgrade Notes
461
+
462
+ 1. Replace `original-*` references from DLQ dispatched metadata with `original_*`
463
+
464
+ ```ruby
465
+ # DLQ topic consumption
466
+ def consume
467
+ messages.each do |broken_message|
468
+ topic = broken_message.metadata['original_topic'] # was original-topic
469
+ partition = broken_message.metadata['original_partition'] # was original-partition
470
+ offset = broken_message.metadata['original_offset'] # was original-offset
471
+
472
+ Rails.logger.error "This message is broken: #{topic}/#{partition}/#{offset}"
473
+ end
474
+ end
475
+ ```
476
+
477
+ ## 2.0.16 (2022-11-09)
478
+ - **[Breaking]** Disable the root `manual_offset_management` setting and require it to be configured per topic. This is part of "topic features" configuration extraction for better code organization.
479
+ - **[Feature]** Introduce **Dead Letter Queue** feature and Pro **Enhanced Dead Letter Queue** feature
480
+ - [Improvement] Align attributes available in the instrumentation bus for listener related events.
481
+ - [Improvement] Include consumer group id in consumption related events (#1093)
482
+ - [Improvement] Delegate pro components loading to Zeitwerk
483
+ - [Improvement] Include `Datadog::LoggerListener` for tracking logger data with DataDog (@bruno-b-martins)
484
+ - [Improvement] Include `seek_offset` in the `consumer.consume.error` event payload (#1113)
485
+ - [Refactor] Remove unused logger listener event handler.
486
+ - [Refactor] Internal refactoring of routing validations flow.
487
+ - [Refactor] Reorganize how routing related features are represented internally to simplify features management.
488
+ - [Refactor] Extract supported features combinations processing flow into separate strategies.
489
+ - [Refactor] Auto-create topics in the integration specs based on the defined routing
490
+ - [Refactor] Auto-inject Pro components via composition instead of requiring to use `Karafka::Pro::BaseConsumer` (#1116)
491
+ - [Fix] Fix a case where routing tags would not be injected when given routing definition would not be used with a block
492
+ - [Fix] Fix a case where using `#active_job_topic` without extra block options would cause `manual_offset_management` to stay false.
493
+ - [Fix] Fix a case when upon Pro ActiveJob usage with Virtual Partitions, correct offset would not be stored
494
+ - [Fix] Fix a case where upon Virtual Partitions usage, same underlying real partition would be resumed several times.
495
+ - [Fix] Fix LRJ enqueuing pause increases the coordinator counter (#115)
496
+ - [Fix] Release `ActiveRecord` connection to the pool after the work in non-dev envs (#1130)
497
+ - [Fix] Fix a case where post-initialization shutdown would not initiate shutdown procedures.
498
+ - [Fix] Prevent Karafka from committing offsets twice upon shutdown.
499
+ - [Fix] Fix for a case where fast consecutive stop signaling could hang the stopping listeners.
500
+ - [Specs] Split specs into regular and pro to simplify how resources are loaded
501
+ - [Specs] Add specs to ensure, that all the Pro components have a proper per-file license (#1099)
502
+
503
+ ### Upgrade Notes
504
+
505
+ 1. Remove the `manual_offset_management` setting from the main config if you use it:
506
+
507
+ ```ruby
508
+ class KarafkaApp < Karafka::App
509
+ setup do |config|
510
+ # ...
511
+
512
+ # This line needs to be removed:
513
+ config.manual_offset_management = true
514
+ end
515
+ end
516
+ ```
517
+
518
+ 2. Set the `manual_offset_management` feature flag per each topic where you want to use it in the routing. Don't set it for topics where you want the default offset management strategy to be used.
519
+
520
+ ```ruby
521
+ class KarafkaApp < Karafka::App
522
+ routes.draw do
523
+ consumer_group :group_name do
524
+ topic :example do
525
+ consumer ExampleConsumer
526
+ manual_offset_management true
527
+ end
528
+
529
+ topic :example2 do
530
+ consumer ExampleConsumer2
531
+ manual_offset_management true
532
+ end
533
+ end
534
+ end
535
+ end
536
+ ```
537
+
538
+ 3. If you were using code to restart dead connections similar to this:
539
+
540
+ ```ruby
541
+ class ActiveRecordConnectionsCleaner
542
+ def on_error_occurred(event)
543
+ return unless event[:error].is_a?(ActiveRecord::StatementInvalid)
544
+
545
+ ::ActiveRecord::Base.clear_active_connections!
546
+ end
547
+ end
548
+
549
+ Karafka.monitor.subscribe(ActiveRecordConnectionsCleaner.new)
550
+ ```
551
+
552
+ It **should** be removed. This code is **no longer needed**.
553
+
554
+ ## 2.0.15 (2022-10-20)
555
+ - Sanitize admin config prior to any admin action.
556
+ - Make messages partitioner outcome for virtual partitions consistently distributed in regards to concurrency.
557
+ - Improve DataDog/StatsD metrics reporting by reporting per topic partition lags and trends.
558
+ - Replace synchronous offset commit with async on resuming paused partition (#1087).
559
+
560
+ ## 2.0.14 (2022-10-16)
561
+ - Prevent consecutive stop signals from starting multiple supervision shutdowns.
562
+ - Provide `Karafka::Embedded` to simplify the start/stop process when running Karafka from within other process (Puma, Sidekiq, etc).
563
+ - Fix a race condition when un-pausing a long-running-job exactly upon listener resuming would crash the listener loop (#1072).
564
+
565
+ ## 2.0.13 (2022-10-14)
566
+ - Early exit upon attempts to commit current or earlier offset twice.
567
+ - Add more integration specs covering edge cases.
568
+ - Strip non producer related config when default producer is initialized (#776)
569
+
570
+ ## 2.0.12 (2022-10-06)
571
+ - Commit stored offsets upon rebalance revocation event to reduce number of messages that are re-processed.
572
+ - Support cooperative-sticky rebalance strategy.
573
+ - Replace offset commit after each batch with a per-rebalance commit.
574
+ - User instrumentation to publish internal rebalance errors.
575
+
576
+ ## 2.0.11 (2022-09-29)
577
+ - Report early on errors related to network and on max poll interval being exceeded to indicate critical problems that will be retries but may mean some underlying problems in the system.
578
+ - Fix support of Ruby 2.7.0 to 2.7.2 (#1045)
579
+
580
+ ## 2.0.10 (2022-09-23)
581
+ - Improve error recovery by delegating the recovery to the existing `librdkafka` instance.
582
+
583
+ ## 2.0.9 (2022-09-22)
584
+ - Fix Singleton not visible when used in PORO (#1034)
585
+ - Divide pristine specs into pristine and poro. Pristine will still have helpers loaded, poro will have nothing.
586
+ - Fix a case where `manual_offset_management` offset upon error is not reverted to the first message in a case where there were no markings as consumed at all for multiple batches.
587
+ - Implement small reliability improvements around marking as consumed.
588
+ - Introduce a config sanity check to make sure Virtual Partitions are not used with manual offset management.
589
+ - Fix a possibility of using `active_job_topic` with Virtual Partitions and manual offset management (ActiveJob still can use due to atomicity of jobs).
590
+ - Move seek offset ownership to the coordinator to allow Virtual Partitions further development.
591
+ - Improve client shutdown in specs.
592
+ - Do not reset client on network issue and rely on `librdkafka` to do so.
593
+ - Allow for nameless (anonymous) subscription groups (#1033)
594
+
595
+ ## 2.0.8 (2022-09-19)
596
+ - [Breaking change] Rename Virtual Partitions `concurrency` to `max_partitions` to avoid confusion (#1023).
597
+ - Allow for block based subscription groups management (#1030).
598
+
599
+ ## 2.0.7 (2022-09-05)
600
+ - [Breaking change] Redefine the Virtual Partitions routing DSL to accept concurrency
601
+ - Allow for `concurrency` setting in Virtual Partitions to extend or limit number of jobs per regular partition. This allows to make sure, we do not use all the threads on virtual partitions jobs
602
+ - Allow for creation of as many Virtual Partitions as needed, without taking global `concurrency` into consideration
603
+
604
+ ## 2.0.6 (2022-09-02)
605
+ - Improve client closing.
606
+ - Fix for: Multiple LRJ topics fetched concurrently block ability for LRJ to kick in (#1002)
607
+ - Introduce a pre-enqueue sync execution layer to prevent starvation cases for LRJ
608
+ - Close admin upon critical errors to prevent segmentation faults
609
+ - Add support for manual subscription group management (#852)
610
+
611
+ ## 2.0.5 (2022-08-23)
612
+ - Fix unnecessary double new line in the `karafka.rb` template for Ruby on Rails
613
+ - Fix a case where a manually paused partition would not be processed after rebalance (#988)
614
+ - Increase specs stability.
615
+ - Lower concurrency of execution of specs in Github CI.
616
+
617
+ ## 2.0.4 (2022-08-19)
618
+ - Fix hanging topic creation (#964)
619
+ - Fix conflict with other Rails loading libraries like `gruf` (#974)
620
+
621
+ ## 2.0.3 (2022-08-09)
622
+ - Update boot info on server startup.
623
+ - Update `karafka info` with more descriptive Ruby version info.
624
+ - Fix issue where when used with Rails in development, log would be too verbose.
625
+ - Fix issue where Zeitwerk with Rails would not load Pro components despite license being present.
626
+
627
+ ## 2.0.2 (2022-08-07)
628
+ - Bypass issue with Rails reload in development by releasing the connection (https://github.com/rails/rails/issues/44183).
629
+
630
+ ## 2.0.1 (2022-08-06)
631
+ - Provide `Karafka::Admin` for creation and destruction of topics and fetching cluster info.
632
+ - Update integration specs to always use one-time disposable topics.
633
+ - Remove no longer needed `wait_for_kafka` script.
634
+ - Add more integration specs for cover offset management upon errors.
635
+
636
+ ## 2.0.0 (2022-08-05)
637
+
638
+ This changelog describes changes between `1.4` and `2.0`. Please refer to appropriate release notes for changes between particular `rc` releases.
639
+
640
+ Karafka 2.0 is a **major** rewrite that brings many new things to the table but also removes specific concepts that happened not to be as good as I initially thought when I created them.
641
+
642
+ Please consider getting a Pro version if you want to **support** my work on the Karafka ecosystem!
643
+
644
+ For anyone worried that I will start converting regular features into Pro: This will **not** happen. Anything free and fully OSS in Karafka 1.4 will **forever** remain free. Most additions and improvements to the ecosystem are to its free parts. Any feature that is introduced as a free and open one will not become paid.
645
+
646
+ ### Additions
647
+
648
+ This section describes **new** things and concepts introduced with Karafka 2.0.
649
+
650
+ Karafka 2.0:
651
+
652
+ - Introduces multi-threaded support for [concurrent work](https://github.com/karafka/karafka/wiki/Concurrency-and-multithreading) consumption for separate partitions as well as for single partition work via [Virtual Partitions](https://github.com/karafka/karafka/wiki/Pro-Virtual-Partitions).
653
+ - Introduces [Active Job adapter](https://github.com/karafka/karafka/wiki/Active-Job) for using Karafka as a jobs backend with Ruby on Rails Active Job.
654
+ - Introduces fully automatic integration end-to-end [test suite](https://github.com/karafka/karafka/tree/master/spec/integrations) that checks any case I could imagine.
655
+ - Introduces [Virtual Partitions](https://github.com/karafka/karafka/wiki/Pro-Virtual-Partitions) for ability to parallelize work of a single partition.
656
+ - Introduces [Long-Running Jobs](https://github.com/karafka/karafka/wiki/Pro-Long-Running-Jobs) to allow for work that would otherwise exceed the `max.poll.interval.ms`.
657
+ - Introduces the [Enhanced Scheduler](https://github.com/karafka/karafka/wiki/Pro-Enhanced-Scheduler) that uses a non-preemptive LJF (Longest Job First) algorithm instead of a a FIFO (First-In, First-Out) one.
658
+ - Introduces [Enhanced Active Job adapter](https://github.com/karafka/karafka/wiki/Pro-Enhanced-Active-Job) that is optimized and allows for strong ordering of jobs and more.
659
+ - Introduces seamless [Ruby on Rails integration](https://github.com/karafka/karafka/wiki/Integrating-with-Ruby-on-Rails-and-other-frameworks) via `Rails::Railte` without need for any extra configuration.
660
+ - Provides `#revoked` [method](https://github.com/karafka/karafka/wiki/Consuming-messages#shutdown-and-partition-revocation-handlers) for taking actions upon topic revocation.
661
+ - Emits underlying async errors emitted from `librdkafka` via the standardized `error.occurred` [monitor channel](https://github.com/karafka/karafka/wiki/Error-handling-and-back-off-policy#error-tracking).
662
+ - Replaces `ruby-kafka` with `librdkafka` as an underlying driver.
663
+ - Introduces official [EOL policies](https://github.com/karafka/karafka/wiki/Versions-Lifecycle-and-EOL).
664
+ - Introduces [benchmarks](https://github.com/karafka/karafka/tree/master/spec/benchmarks) that can be used to profile Karafka.
665
+ - Introduces a requirement that the end user code **needs** to be [thread-safe](https://github.com/karafka/karafka/wiki/FAQ#does-karafka-require-gems-to-be-thread-safe).
666
+ - Introduces a [Pro subscription](https://github.com/karafka/karafka/wiki/Build-vs-Buy) with a [commercial license](https://github.com/karafka/karafka/blob/master/LICENSE-COMM) to fund further ecosystem development.
667
+
668
+ ### Deletions
669
+
670
+ This section describes things that are **no longer** part of the Karafka ecosystem.
671
+
672
+ Karafka 2.0:
673
+
674
+ - Removes topics mappers concept completely.
675
+ - Removes pidfiles support.
676
+ - Removes daemonization support.
677
+ - Removes support for using `sidekiq-backend` due to introduction of [multi-threading](https://github.com/karafka/karafka/wiki/Concurrency-and-multithreading).
678
+ - Removes the `Responders` concept in favour of WaterDrop producer usage.
679
+ - Removes completely all the callbacks in favour of finalizer method `#shutdown`.
680
+ - Removes single message consumption mode in favour of [documentation](https://github.com/karafka/karafka/wiki/Consuming-messages#one-at-a-time) on how to do it easily by yourself.
681
+
682
+ ### Changes
683
+
684
+ This section describes things that were **changed** in Karafka but are still present.
685
+
686
+ Karafka 2.0:
687
+
688
+ - Uses only instrumentation that comes from Karafka. This applies also to notifications coming natively from `librdkafka`. They are now piped through Karafka prior to being dispatched.
689
+ - Integrates WaterDrop `2.x` tightly with autoconfiguration inheritance and an option to redefine it.
690
+ - Integrates with the `karafka-testing` gem for RSpec that also has been updated.
691
+ - Updates `cli info` to reflect the `2.0` details.
692
+ - Stops validating `kafka` configuration beyond minimum as the rest is handled by `librdkafka`.
693
+ - No longer uses `dry-validation`.
694
+ - No longer uses `dry-monitor`.
695
+ - No longer uses `dry-configurable`.
696
+ - Lowers general external dependencies three **heavily**.
697
+ - Renames `Karafka::Params::BatchMetadata` to `Karafka::Messages::BatchMetadata`.
698
+ - Renames `Karafka::Params::Params` to `Karafka::Messages::Message`.
699
+ - Renames `#params_batch` in consumers to `#messages`.
700
+ - Renames `Karafka::Params::Metadata` to `Karafka::Messages::Metadata`.
701
+ - Renames `Karafka::Fetcher` to `Karafka::Runner` and align notifications key names.
702
+ - Renames `StdoutListener` to `LoggerListener`.
703
+ - Reorganizes [monitoring and logging](https://github.com/karafka/karafka/wiki/Monitoring-and-logging) to match new concepts.
704
+ - Notifies on fatal worker processing errors.
705
+ - Contains updated install templates for Rails and no-non Rails.
706
+ - Changes how the routing style (`0.5`) behaves. It now builds a single consumer group instead of one per topic.
707
+ - Introduces changes that will allow me to build full web-UI in the upcoming `2.1`.
708
+ - Contains updated example apps.
709
+ - Standardizes error hooks for all error reporting (`error.occurred`).
710
+ - Changes license to `LGPL-3.0`.
711
+ - Introduces a `karafka-core` dependency that contains common code used across the ecosystem.
712
+ - Contains updated [wiki](https://github.com/karafka/karafka/wiki) on everything I could think of.
713
+
714
+ ## Older releases
715
+
716
+ This changelog tracks Karafka `2.0` and higher changes.
717
+
718
+ If you are looking for changes in the unsupported releases, we recommend checking the [`1.4`](https://github.com/karafka/karafka/blob/1.4/CHANGELOG.md) branch of the Karafka repository.