karafka 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.github/FUNDING.yml +1 -0
  4. data/.github/workflows/ci.yml +40 -16
  5. data/.rspec +4 -0
  6. data/.ruby-version +1 -1
  7. data/CHANGELOG.md +459 -796
  8. data/Gemfile +3 -2
  9. data/Gemfile.lock +44 -32
  10. data/LICENSE +1 -1
  11. data/README.md +22 -17
  12. data/bin/integrations +86 -26
  13. data/bin/karafka +1 -13
  14. data/bin/rspecs +6 -0
  15. data/bin/verify_license_integrity +37 -0
  16. data/certs/cert_chain.pem +26 -0
  17. data/config/{errors.yml → locales/errors.yml} +34 -6
  18. data/config/locales/pro_errors.yml +34 -0
  19. data/docker-compose.yml +4 -30
  20. data/karafka.gemspec +17 -10
  21. data/lib/active_job/karafka.rb +3 -7
  22. data/lib/active_job/queue_adapters/karafka_adapter.rb +7 -1
  23. data/lib/karafka/active_job/consumer.rb +29 -6
  24. data/lib/karafka/active_job/current_attributes/loading.rb +36 -0
  25. data/lib/karafka/active_job/current_attributes/persistence.rb +28 -0
  26. data/lib/karafka/active_job/current_attributes.rb +42 -0
  27. data/lib/karafka/active_job/dispatcher.rb +34 -3
  28. data/lib/karafka/active_job/job_options_contract.rb +13 -2
  29. data/lib/karafka/admin.rb +246 -0
  30. data/lib/karafka/app.rb +30 -7
  31. data/lib/karafka/base_consumer.rb +124 -82
  32. data/lib/karafka/cli/base.rb +20 -0
  33. data/lib/karafka/cli/console.rb +13 -8
  34. data/lib/karafka/cli/info.rb +3 -2
  35. data/lib/karafka/cli/server.rb +55 -8
  36. data/lib/karafka/cli/topics.rb +146 -0
  37. data/lib/karafka/connection/client.rb +118 -61
  38. data/lib/karafka/connection/consumer_group_coordinator.rb +48 -0
  39. data/lib/karafka/connection/listener.rb +78 -30
  40. data/lib/karafka/connection/listeners_batch.rb +18 -2
  41. data/lib/karafka/connection/rebalance_manager.rb +3 -0
  42. data/lib/karafka/contracts/config.rb +1 -1
  43. data/lib/karafka/contracts/consumer_group.rb +22 -9
  44. data/lib/karafka/contracts/server_cli_options.rb +71 -11
  45. data/lib/karafka/contracts/topic.rb +65 -0
  46. data/lib/karafka/contracts.rb +1 -1
  47. data/lib/karafka/embedded.rb +36 -0
  48. data/lib/karafka/errors.rb +6 -4
  49. data/lib/karafka/helpers/colorize.rb +6 -0
  50. data/lib/karafka/instrumentation/callbacks/error.rb +3 -4
  51. data/lib/karafka/instrumentation/callbacks/statistics.rb +14 -4
  52. data/lib/karafka/instrumentation/logger_listener.rb +151 -22
  53. data/lib/karafka/instrumentation/notifications.rb +26 -7
  54. data/lib/karafka/instrumentation/proctitle_listener.rb +7 -16
  55. data/lib/karafka/instrumentation/vendors/datadog/dashboard.json +1 -1
  56. data/lib/karafka/instrumentation/vendors/datadog/logger_listener.rb +153 -0
  57. data/lib/karafka/instrumentation/vendors/datadog/{listener.rb → metrics_listener.rb} +62 -35
  58. data/lib/karafka/instrumentation/vendors/kubernetes/liveness_listener.rb +166 -0
  59. data/lib/karafka/licenser.rb +53 -50
  60. data/lib/karafka/messages/builders/batch_metadata.rb +8 -8
  61. data/lib/karafka/messages/builders/messages.rb +6 -2
  62. data/lib/karafka/messages/message.rb +14 -2
  63. data/lib/karafka/messages/messages.rb +5 -0
  64. data/lib/karafka/messages/parser.rb +14 -0
  65. data/lib/karafka/patches/rdkafka/bindings.rb +132 -0
  66. data/lib/karafka/pro/active_job/consumer.rb +10 -9
  67. data/lib/karafka/pro/active_job/dispatcher.rb +28 -3
  68. data/lib/karafka/pro/active_job/job_options_contract.rb +16 -3
  69. data/lib/karafka/pro/encryption/cipher.rb +58 -0
  70. data/lib/karafka/pro/encryption/contracts/config.rb +79 -0
  71. data/lib/karafka/pro/encryption/errors.rb +24 -0
  72. data/lib/karafka/pro/encryption/messages/middleware.rb +46 -0
  73. data/lib/karafka/pro/encryption/messages/parser.rb +56 -0
  74. data/lib/karafka/pro/encryption/setup/config.rb +48 -0
  75. data/lib/karafka/pro/encryption.rb +47 -0
  76. data/lib/karafka/pro/iterator.rb +253 -0
  77. data/lib/karafka/pro/loader.rb +52 -26
  78. data/lib/karafka/pro/performance_tracker.rb +10 -6
  79. data/lib/karafka/pro/processing/collapser.rb +62 -0
  80. data/lib/karafka/pro/processing/coordinator.rb +92 -16
  81. data/lib/karafka/pro/processing/filters/base.rb +61 -0
  82. data/lib/karafka/pro/processing/filters/delayer.rb +70 -0
  83. data/lib/karafka/pro/processing/filters/expirer.rb +51 -0
  84. data/lib/karafka/pro/processing/filters/throttler.rb +84 -0
  85. data/lib/karafka/pro/processing/filters/virtual_limiter.rb +52 -0
  86. data/lib/karafka/pro/processing/filters_applier.rb +104 -0
  87. data/lib/karafka/pro/processing/jobs/consume_non_blocking.rb +7 -5
  88. data/lib/karafka/pro/processing/jobs/revoked_non_blocking.rb +37 -0
  89. data/lib/karafka/pro/processing/jobs_builder.rb +22 -4
  90. data/lib/karafka/pro/processing/partitioner.rb +33 -24
  91. data/lib/karafka/pro/processing/scheduler.rb +27 -8
  92. data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_lrj_mom.rb +68 -0
  93. data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_lrj_mom_vp.rb +74 -0
  94. data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_mom.rb +72 -0
  95. data/lib/karafka/pro/processing/strategies/aj/dlq_ftr_mom_vp.rb +76 -0
  96. data/lib/karafka/pro/processing/strategies/aj/dlq_lrj_mom.rb +64 -0
  97. data/lib/karafka/pro/processing/strategies/aj/dlq_lrj_mom_vp.rb +68 -0
  98. data/lib/karafka/pro/processing/strategies/aj/dlq_mom.rb +64 -0
  99. data/lib/karafka/pro/processing/strategies/aj/dlq_mom_vp.rb +69 -0
  100. data/lib/karafka/pro/processing/strategies/aj/ftr_lrj_mom.rb +38 -0
  101. data/lib/karafka/pro/processing/strategies/aj/ftr_lrj_mom_vp.rb +64 -0
  102. data/lib/karafka/pro/processing/strategies/aj/ftr_mom.rb +38 -0
  103. data/lib/karafka/pro/processing/strategies/aj/ftr_mom_vp.rb +58 -0
  104. data/lib/karafka/pro/processing/strategies/aj/lrj_mom.rb +37 -0
  105. data/lib/karafka/pro/processing/strategies/aj/lrj_mom_vp.rb +79 -0
  106. data/lib/karafka/pro/processing/strategies/aj/mom.rb +36 -0
  107. data/lib/karafka/pro/processing/strategies/aj/mom_vp.rb +52 -0
  108. data/lib/karafka/pro/processing/strategies/base.rb +26 -0
  109. data/lib/karafka/pro/processing/strategies/default.rb +105 -0
  110. data/lib/karafka/pro/processing/strategies/dlq/default.rb +131 -0
  111. data/lib/karafka/pro/processing/strategies/dlq/ftr.rb +61 -0
  112. data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj.rb +75 -0
  113. data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_mom.rb +71 -0
  114. data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_mom_vp.rb +43 -0
  115. data/lib/karafka/pro/processing/strategies/dlq/ftr_lrj_vp.rb +41 -0
  116. data/lib/karafka/pro/processing/strategies/dlq/ftr_mom.rb +69 -0
  117. data/lib/karafka/pro/processing/strategies/dlq/ftr_mom_vp.rb +41 -0
  118. data/lib/karafka/pro/processing/strategies/dlq/ftr_vp.rb +40 -0
  119. data/lib/karafka/pro/processing/strategies/dlq/lrj.rb +63 -0
  120. data/lib/karafka/pro/processing/strategies/dlq/lrj_mom.rb +63 -0
  121. data/lib/karafka/pro/processing/strategies/dlq/lrj_mom_vp.rb +36 -0
  122. data/lib/karafka/pro/processing/strategies/dlq/lrj_vp.rb +39 -0
  123. data/lib/karafka/pro/processing/strategies/dlq/mom.rb +68 -0
  124. data/lib/karafka/pro/processing/strategies/dlq/mom_vp.rb +37 -0
  125. data/lib/karafka/pro/processing/strategies/dlq/vp.rb +40 -0
  126. data/lib/karafka/pro/processing/strategies/ftr/default.rb +104 -0
  127. data/lib/karafka/pro/processing/strategies/ftr/vp.rb +40 -0
  128. data/lib/karafka/pro/processing/strategies/lrj/default.rb +87 -0
  129. data/lib/karafka/pro/processing/strategies/lrj/ftr.rb +69 -0
  130. data/lib/karafka/pro/processing/strategies/lrj/ftr_mom.rb +67 -0
  131. data/lib/karafka/pro/processing/strategies/lrj/ftr_mom_vp.rb +40 -0
  132. data/lib/karafka/pro/processing/strategies/lrj/ftr_vp.rb +39 -0
  133. data/lib/karafka/pro/processing/strategies/lrj/mom.rb +80 -0
  134. data/lib/karafka/pro/processing/strategies/lrj/mom_vp.rb +38 -0
  135. data/lib/karafka/pro/processing/strategies/lrj/vp.rb +36 -0
  136. data/lib/karafka/pro/processing/strategies/mom/default.rb +46 -0
  137. data/lib/karafka/pro/processing/strategies/mom/ftr.rb +53 -0
  138. data/lib/karafka/pro/processing/strategies/mom/ftr_vp.rb +37 -0
  139. data/lib/karafka/pro/processing/strategies/mom/vp.rb +35 -0
  140. data/lib/karafka/pro/processing/strategies/vp/default.rb +104 -0
  141. data/lib/karafka/pro/{contracts/base.rb → processing/strategies.rb} +6 -5
  142. data/lib/karafka/pro/processing/strategy_selector.rb +84 -0
  143. data/lib/karafka/pro/processing/virtual_offset_manager.rb +147 -0
  144. data/lib/karafka/pro/routing/features/base.rb +24 -0
  145. data/lib/karafka/pro/routing/features/dead_letter_queue/contract.rb +50 -0
  146. data/lib/karafka/pro/routing/features/dead_letter_queue.rb +27 -0
  147. data/lib/karafka/pro/routing/{builder_extensions.rb → features/delaying/config.rb} +8 -11
  148. data/lib/karafka/pro/routing/features/delaying/contract.rb +38 -0
  149. data/lib/karafka/pro/routing/features/delaying/topic.rb +59 -0
  150. data/lib/karafka/pro/routing/features/delaying.rb +29 -0
  151. data/lib/karafka/pro/routing/features/expiring/config.rb +27 -0
  152. data/lib/karafka/pro/routing/features/expiring/contract.rb +38 -0
  153. data/lib/karafka/pro/routing/features/expiring/topic.rb +59 -0
  154. data/lib/karafka/pro/routing/features/expiring.rb +27 -0
  155. data/lib/karafka/pro/routing/features/filtering/config.rb +40 -0
  156. data/lib/karafka/pro/routing/features/filtering/contract.rb +41 -0
  157. data/lib/karafka/pro/routing/features/filtering/topic.rb +51 -0
  158. data/lib/karafka/pro/routing/features/filtering.rb +27 -0
  159. data/lib/karafka/pro/routing/features/long_running_job/config.rb +28 -0
  160. data/lib/karafka/pro/routing/features/long_running_job/contract.rb +37 -0
  161. data/lib/karafka/pro/routing/features/long_running_job/topic.rb +42 -0
  162. data/lib/karafka/pro/routing/features/long_running_job.rb +28 -0
  163. data/lib/karafka/pro/routing/features/throttling/config.rb +32 -0
  164. data/lib/karafka/pro/routing/features/throttling/contract.rb +41 -0
  165. data/lib/karafka/pro/routing/features/throttling/topic.rb +69 -0
  166. data/lib/karafka/pro/routing/features/throttling.rb +30 -0
  167. data/lib/karafka/pro/routing/features/virtual_partitions/config.rb +30 -0
  168. data/lib/karafka/pro/routing/features/virtual_partitions/contract.rb +52 -0
  169. data/lib/karafka/pro/routing/features/virtual_partitions/topic.rb +56 -0
  170. data/lib/karafka/pro/routing/features/virtual_partitions.rb +27 -0
  171. data/lib/karafka/process.rb +23 -8
  172. data/lib/karafka/processing/coordinator.rb +102 -23
  173. data/lib/karafka/processing/coordinators_buffer.rb +5 -1
  174. data/lib/karafka/processing/executor.rb +51 -21
  175. data/lib/karafka/processing/executors_buffer.rb +10 -26
  176. data/lib/karafka/processing/jobs/base.rb +6 -2
  177. data/lib/karafka/processing/jobs/consume.rb +8 -5
  178. data/lib/karafka/processing/jobs/idle.rb +24 -0
  179. data/lib/karafka/processing/jobs_builder.rb +2 -3
  180. data/lib/karafka/processing/jobs_queue.rb +14 -8
  181. data/lib/karafka/processing/partitioner.rb +3 -1
  182. data/lib/karafka/processing/result.rb +14 -1
  183. data/lib/karafka/processing/strategies/aj_dlq_mom.rb +44 -0
  184. data/lib/karafka/processing/strategies/aj_mom.rb +21 -0
  185. data/lib/karafka/processing/strategies/base.rb +52 -0
  186. data/lib/karafka/processing/strategies/default.rb +142 -0
  187. data/lib/karafka/processing/strategies/dlq.rb +88 -0
  188. data/lib/karafka/processing/strategies/dlq_mom.rb +49 -0
  189. data/lib/karafka/processing/strategies/mom.rb +29 -0
  190. data/lib/karafka/processing/strategy_selector.rb +47 -0
  191. data/lib/karafka/processing/worker.rb +8 -3
  192. data/lib/karafka/railtie.rb +24 -12
  193. data/lib/karafka/routing/activity_manager.rb +84 -0
  194. data/lib/karafka/routing/builder.rb +20 -0
  195. data/lib/karafka/routing/consumer_group.rb +38 -4
  196. data/lib/karafka/routing/consumer_mapper.rb +0 -10
  197. data/lib/karafka/routing/features/active_job/builder.rb +33 -0
  198. data/lib/karafka/routing/features/active_job/config.rb +15 -0
  199. data/lib/karafka/routing/features/active_job/contract.rb +41 -0
  200. data/lib/karafka/routing/features/active_job/topic.rb +33 -0
  201. data/lib/karafka/routing/features/active_job.rb +13 -0
  202. data/lib/karafka/routing/features/base/expander.rb +53 -0
  203. data/lib/karafka/routing/features/base.rb +34 -0
  204. data/lib/karafka/routing/features/dead_letter_queue/config.rb +19 -0
  205. data/lib/karafka/routing/features/dead_letter_queue/contract.rb +42 -0
  206. data/lib/karafka/routing/features/dead_letter_queue/topic.rb +41 -0
  207. data/lib/karafka/routing/features/dead_letter_queue.rb +16 -0
  208. data/lib/karafka/routing/features/declaratives/config.rb +18 -0
  209. data/lib/karafka/routing/features/declaratives/contract.rb +30 -0
  210. data/lib/karafka/routing/features/declaratives/topic.rb +44 -0
  211. data/lib/karafka/routing/features/declaratives.rb +14 -0
  212. data/lib/karafka/routing/features/manual_offset_management/config.rb +15 -0
  213. data/lib/karafka/routing/features/manual_offset_management/contract.rb +24 -0
  214. data/lib/karafka/routing/features/manual_offset_management/topic.rb +35 -0
  215. data/lib/karafka/routing/features/manual_offset_management.rb +18 -0
  216. data/lib/karafka/routing/proxy.rb +18 -20
  217. data/lib/karafka/routing/router.rb +27 -2
  218. data/lib/karafka/routing/subscription_group.rb +43 -5
  219. data/lib/karafka/routing/subscription_groups_builder.rb +6 -1
  220. data/lib/karafka/routing/topic.rb +17 -5
  221. data/lib/karafka/routing/topics.rb +8 -0
  222. data/lib/karafka/runner.rb +1 -0
  223. data/lib/karafka/serialization/json/deserializer.rb +1 -0
  224. data/lib/karafka/server.rb +58 -28
  225. data/lib/karafka/setup/attributes_map.rb +344 -0
  226. data/lib/karafka/setup/config.rb +48 -19
  227. data/lib/karafka/status.rb +35 -7
  228. data/lib/karafka/templates/karafka.rb.erb +14 -6
  229. data/lib/karafka/time_trackers/base.rb +1 -6
  230. data/lib/karafka/time_trackers/pause.rb +49 -19
  231. data/lib/karafka/time_trackers/poll.rb +7 -3
  232. data/lib/karafka/version.rb +1 -1
  233. data/lib/karafka.rb +56 -3
  234. data/renovate.json +6 -0
  235. data.tar.gz.sig +0 -0
  236. metadata +189 -61
  237. metadata.gz.sig +0 -0
  238. data/bin/wait_for_kafka +0 -20
  239. data/certs/mensfeld.pem +0 -25
  240. data/lib/karafka/active_job/routing/extensions.rb +0 -31
  241. data/lib/karafka/contracts/consumer_group_topic.rb +0 -42
  242. data/lib/karafka/instrumentation.rb +0 -21
  243. data/lib/karafka/pro/base_consumer.rb +0 -82
  244. data/lib/karafka/pro/contracts/consumer_group.rb +0 -34
  245. data/lib/karafka/pro/contracts/consumer_group_topic.rb +0 -33
  246. data/lib/karafka/pro/routing/topic_extensions.rb +0 -38
data/CHANGELOG.md CHANGED
@@ -1,6 +1,458 @@
1
1
  # Karafka framework changelog
2
2
 
3
- ## 2.0.0 (2022-08-5)
3
+ ## 2.1.0 (2023-05-22)
4
+ - **[Feature]** Provide ability to use CurrentAttributes with ActiveJob's Karafka adapter.
5
+ - **[Feature]** Introduce collective Virtual Partitions offset management.
6
+ - **[Feature]** Use virtual offsets to filter out messages that would be re-processed upon retries.
7
+ - [Improvement] No longer break processing on failing parallel virtual partitions in ActiveJob because it is compensated by virtual marking.
8
+ - [Improvement] Always use Virtual offset management for Pro ActiveJobs.
9
+ - [Improvement] Do not attempt to mark offsets on already revoked partitions.
10
+ - [Improvement] Make sure, that VP components are not injected into non VP strategies.
11
+ - [Improvement] Improve complex strategies inheritance flow.
12
+ - [Improvement] Optimize offset management for DLQ + MoM feature combinations.
13
+ - [Change] Removed `Karafka::Pro::BaseConsumer` in favor of `Karafka::BaseConsumer`. (#1345)
14
+ - [Fix] Fix for `max_messages` and `max_wait_time` not having reference in errors.yml (#1443)
15
+
16
+ ### Upgrade notes
17
+
18
+ 1. Upgrade to Karafka `2.0.41` prior to upgrading to `2.1.0`.
19
+ 2. Replace `Karafka::Pro::BaseConsumer` references to `Karafka::BaseConsumer`.
20
+ 3. Replace `Karafka::Instrumentation::Vendors::Datadog:Listener` with `Karafka::Instrumentation::Vendors::Datadog::MetricsListener`.
21
+
22
+ ## 2.0.41 (2023-14-19)
23
+ - **[Feature]** Provide `Karafka::Pro::Iterator` for anonymous topic/partitions iterations and messages lookups (#1389 and #1427).
24
+ - [Improvement] Optimize topic lookup for `read_topic` admin method usage.
25
+ - [Improvement] Report via `LoggerListener` information about the partition on which a given job has started and finished.
26
+ - [Improvement] Slightly normalize the `LoggerListener` format. Always report partition related operations as followed: `TOPIC_NAME/PARTITION`.
27
+ - [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.
28
+ - [Improvement] Report `client.software.name` and `client.software.version` according to `librdkafka` recommendation.
29
+ - [Improvement] Report ten longest integration specs after the suite execution.
30
+ - [Improvement] Prevent user originating errors related to statistics processing after listener loop crash from potentially crashing the listener loop and hanging Karafka process.
31
+
32
+ ## 2.0.40 (2023-04-13)
33
+ - [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.
34
+ - [Refactor] Require messages builder to accept partition and do not fetch it from messages.
35
+ - [Refactor] Use empty messages set for internal APIs (Idle) (so there always is `Karafka::Messages::Messages`)
36
+ - [Refactor] Allow for empty messages set initialization with -1001 and -1 on metadata (similar to `librdkafka`)
37
+
38
+ ## 2.0.39 (2023-04-11)
39
+ - **[Feature]** Provide ability to throttle/limit number of messages processed in a time unit (#1203)
40
+ - **[Feature]** Provide Delayed Topics (#1000)
41
+ - **[Feature]** Provide ability to expire messages (expiring topics)
42
+ - **[Feature]** Provide ability to apply filters after messages are polled and before enqueued. This is a generic filter API for any usage.
43
+ - [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.
44
+ - [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.
45
+ - [Improvement] Track active_job_id in instrumentation (#1372)
46
+ - [Improvement] Introduce new housekeeping job type called `Idle` for non-consumption execution flows.
47
+ - [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.
48
+ - [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.
49
+ - [Improvement] Normalize the DLQ behaviour with MoM. Always pause on dispatch for all the strategies.
50
+ - [Improvement] Improve the manual offset management and DLQ behaviour when no markings occur for OSS.
51
+ - [Improvement] Do not early stop ActiveJob work running under virtual partitions to prevent extensive reprocessing.
52
+ - [Improvement] Drastically increase number of scenarios covered by integration specs (OSS and Pro).
53
+ - [Improvement] Introduce a `Coordinator#synchronize` lock for cross virtual partitions operations.
54
+ - [Fix] Do not resume partition that is not paused.
55
+ - [Fix] Fix `LoggerListener` cases where logs would not include caller id (when available)
56
+ - [Fix] Fix not working benchmark tests.
57
+ - [Fix] Fix a case where when using manual offset management with a user pause would ignore the pause and seek to the next message.
58
+ - [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.
59
+ - [Fix] Make sure to resume always for all LRJ strategies on revocation.
60
+ - [Refactor] Make sure that coordinator is topic aware. Needed for throttling, delayed processing and expired jobs.
61
+ - [Refactor] Put Pro strategies into namespaces to better organize multiple combinations.
62
+ - [Refactor] Do not rely on messages metadata for internal topic and partition operations like `#seek` so they can run independently from the consumption flow.
63
+ - [Refactor] Hold a single topic/partition reference on a coordinator instead of in executor, coordinator and consumer.
64
+ - [Refactor] Move `#mark_as_consumed` and `#mark_as_consumed!`into `Strategies::Default` to be able to introduce marking for virtual partitions.
65
+
66
+ ## 2.0.38 (2023-03-27)
67
+ - [Improvement] Introduce `Karafka::Admin#read_watermark_offsets` to get low and high watermark offsets values.
68
+ - [Improvement] Track active_job_id in instrumentation (#1372)
69
+ - [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.
70
+ - [Improvement] Allow `#read_topic` to accept instance settings to overwrite any settings needed to customize reading behaviours.
71
+
72
+ ## 2.0.37 (2023-03-20)
73
+ - [Fix] Declarative topics execution on a secondary cluster run topics creation on the primary one (#1365)
74
+ - [Fix] Admin read operations commit offset when not needed (#1369)
75
+
76
+ ## 2.0.36 (2023-03-17)
77
+ - [Refactor] Rename internal naming of `Structurable` to `Declaratives` for declarative topics feature.
78
+ - [Fix] AJ + DLQ + MOM + LRJ is pausing indefinitely after the first job (#1362)
79
+
80
+ ## 2.0.35 (2023-03-13)
81
+ - **[Feature]** Allow for defining topics config via the DSL and its automatic creation via CLI command.
82
+ - **[Feature]** Allow for full topics reset and topics repartitioning via the CLI.
83
+
84
+ ## 2.0.34 (2023-03-04)
85
+ - [Improvement] Attach an `embedded` tag to Karafka processes started using the embedded API.
86
+ - [Change] Renamed `Datadog::Listener` to `Datadog::MetricsListener` for consistency. (#1124)
87
+
88
+ ### Upgrade notes
89
+
90
+ 1. Replace `Datadog::Listener` references to `Datadog::MetricsListener`.
91
+
92
+ ## 2.0.33 (2023-02-24)
93
+ - **[Feature]** Support `perform_all_later` in ActiveJob adapter for Rails `7.1+`
94
+ - **[Feature]** Introduce ability to assign and re-assign tags in consumer instances. This can be used for extra instrumentation that is context aware.
95
+ - **[Feature]** Introduce ability to assign and reassign tags to the `Karafka::Process`.
96
+ - [Improvement] When using `ActiveJob` adapter, automatically tag jobs with the name of the `ActiveJob` class that is running inside of the `ActiveJob` consumer.
97
+ - [Improvement] Make `::Karafka::Instrumentation::Notifications::EVENTS` list public for anyone wanting to re-bind those into a different notification bus.
98
+ - [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).
99
+ - [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.
100
+ - [Fix] Karafka monitor is prematurely cached (#1314)
101
+
102
+ ### Upgrade notes
103
+
104
+ Since `#tags` were introduced on consumers, the `#tags` method is now part of the consumers API.
105
+
106
+ This means, that in case you were using a method called `#tags` in your consumers, you will have to rename it:
107
+
108
+ ```ruby
109
+ class EventsConsumer < ApplicationConsumer
110
+ def consume
111
+ messages.each do |message|
112
+ tags << message.payload.tag
113
+ end
114
+
115
+ tags.each { |tags| puts tag }
116
+ end
117
+
118
+ private
119
+
120
+ # This will collide with the tagging API
121
+ # This NEEDS to be renamed not to collide with `#tags` method provided by the consumers API.
122
+ def tags
123
+ @tags ||= Set.new
124
+ end
125
+ end
126
+ ```
127
+
128
+ ## 2.0.32 (2023-02-13)
129
+ - [Fix] Many non-existing topic subscriptions propagate poll errors beyond client
130
+ - [Improvement] Ignore `unknown_topic_or_part` errors in dev when `allow.auto.create.topics` is on.
131
+ - [Improvement] Optimize temporary errors handling in polling for a better backoff policy
132
+
133
+ ## 2.0.31 (2023-02-12)
134
+ - [Feature] Allow for adding partitions via `Admin#create_partitions` API.
135
+ - [Fix] Do not ignore admin errors upon invalid configuration (#1254)
136
+ - [Fix] Topic name validation (#1300) - CandyFet
137
+ - [Improvement] Increase the `max_wait_timeout` on admin operations to five minutes to make sure no timeout on heavily loaded clusters.
138
+ - [Maintenance] Require `karafka-core` >= `2.0.11` and switch to shared RSpec locator.
139
+ - [Maintenance] Require `karafka-rdkafka` >= `0.12.1`
140
+
141
+ ## 2.0.30 (2023-01-31)
142
+ - [Improvement] Alias `--consumer-groups` with `--include-consumer-groups`
143
+ - [Improvement] Alias `--subscription-groups` with `--include-subscription-groups`
144
+ - [Improvement] Alias `--topics` with `--include-topics`
145
+ - [Improvement] Introduce `--exclude-consumer-groups` for ability to exclude certain consumer groups from running
146
+ - [Improvement] Introduce `--exclude-subscription-groups` for ability to exclude certain subscription groups from running
147
+ - [Improvement] Introduce `--exclude-topics` for ability to exclude certain topics from running
148
+
149
+ ## 2.0.29 (2023-01-30)
150
+ - [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.
151
+ - [Improvement] Extract the code loading capabilities of Karafka console from the executable, so web can use it to provide CLI commands.
152
+ - [Fix] Fix for: running karafka console results in NameError with Rails (#1280)
153
+ - [Fix] Make sure, that the `caller` for async errors is being published.
154
+ - [Change] Make sure that WaterDrop `2.4.10` or higher is used with this release to support Web-UI.
155
+
156
+ ## 2.0.28 (2023-01-25)
157
+ - **[Feature]** Provide the ability to use Dead Letter Queue with Virtual Partitions.
158
+ - [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.
159
+ - [Improvement] Introduce `#collapsed?` consumer method available for consumers using Virtual Partitions.
160
+ - [Improvement] Allow for customization of DLQ dispatched message details in Pro (#1266) via the `#enhance_dlq_message` consumer method.
161
+ - [Improvement] Include `original_consumer_group` in the DLQ dispatched messages in Pro.
162
+ - [Improvement] Use Karafka `client_id` as kafka `client.id` value by default
163
+
164
+ ### Upgrade notes
165
+
166
+ If you want to continue to use `karafka` as default for kafka `client.id`, assign it manually:
167
+
168
+ ```ruby
169
+ class KarafkaApp < Karafka::App
170
+ setup do |config|
171
+ # Other settings...
172
+ config.kafka = {
173
+ 'client.id': 'karafka'
174
+ }
175
+ ```
176
+
177
+ ## 2.0.27 (2023-01-11)
178
+ - Do not lock Ruby version in Karafka in favour of `karafka-core`.
179
+ - Make sure `karafka-core` version is at least `2.0.9` to make sure we run `karafka-rdkafka`.
180
+
181
+ ## 2.0.26 (2023-01-10)
182
+ - **[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.
183
+ - [Improvement] Early terminate on `read_topic` when reaching the last offset available on the request time.
184
+ - [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.
185
+ - [Improvement] Use Karafka defined routes topics when possible for `read_topic` admin API.
186
+ - [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.
187
+ - [Improvement] Replace `LoggerListener` pause notification with one based on `client.pause` instead of `consumer.consuming.pause`.
188
+ - [Improvement] Expand `LoggerListener` with `client.resume` notification.
189
+ - [Improvement] Replace random anonymous subscription groups ids with stable once.
190
+ - [Improvement] Add `consumer.consume`, `consumer.revoke` and `consumer.shutting_down` notification events and move the revocation logic calling to strategies.
191
+ - [Change] Rename job queue statistics `processing` key to `busy`. No changes needed because naming in the DataDog listener stays the same.
192
+ - [Fix] Fix proctitle listener state changes reporting on new states.
193
+ - [Fix] Make sure all files descriptors are closed in the integration specs.
194
+ - [Fix] Fix a case where empty subscription groups could leak into the execution flow.
195
+ - [Fix] Fix `LoggerListener` reporting so it does not end with `.`.
196
+ - [Fix] Run previously defined (if any) signal traps created prior to Karafka signals traps.
197
+
198
+ ## 2.0.25 (2023-01-10)
199
+ - Release yanked due to accidental release with local changes.
200
+
201
+ ## 2.0.24 (2022-12-19)
202
+ - **[Feature]** Provide out of the box encryption support for Pro.
203
+ - [Improvement] Add instrumentation upon `#pause`.
204
+ - [Improvement] Add instrumentation upon retries.
205
+ - [Improvement] Assign `#id` to consumers similar to other entities for ease of debugging.
206
+ - [Improvement] Add retries and pausing to the default `LoggerListener`.
207
+ - [Improvement] Introduce a new final `terminated` state that will kick in prior to exit but after all the instrumentation and other things are done.
208
+ - [Improvement] Ensure that state transitions are thread-safe and ensure state transitions can occur in one direction.
209
+ - [Improvement] Optimize status methods proxying to `Karafka::App`.
210
+ - [Improvement] Allow for easier state usage by introducing explicit `#to_s` for reporting.
211
+ - [Improvement] Change auto-generated id from `SecureRandom#uuid` to `SecureRandom#hex(6)`
212
+ - [Improvement] Emit statistic every 5 seconds by default.
213
+ - [Improvement] Introduce general messages parser that can be swapped when needed.
214
+ - [Fix] Do not trigger code reloading when `consumer_persistence` is enabled.
215
+ - [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.
216
+
217
+ ### Upgrade notes
218
+
219
+ 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`:
220
+
221
+ ```ruby
222
+ class KarafkaApp < Karafka::App
223
+ setup do |config|
224
+ # Other settings...
225
+ config.kafka = {
226
+ 'statistics.interval.ms': 0
227
+ }
228
+ end
229
+ end
230
+ ```
231
+
232
+ ## 2.0.23 (2022-12-07)
233
+ - [Maintenance] Align with `waterdrop` and `karafka-core`
234
+ - [Improvement] Provide `Admin#read_topic` API to get topic data without subscribing.
235
+ - [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`.
236
+ - [Fix] Fix a scenario where manual `#pause` would be overwritten by a resume initiated by the strategy.
237
+ - [Fix] Fix a scenario where manual `#pause` in LRJ would cause infinite pause.
238
+
239
+ ## 2.0.22 (2022-12-02)
240
+ - [Improvement] Load Pro components upon Karafka require so they can be altered prior to setup.
241
+ - [Improvement] Do not run LRJ jobs that were added to the jobs queue but were revoked meanwhile.
242
+ - [Improvement] Allow running particular named subscription groups similar to consumer groups.
243
+ - [Improvement] Allow running particular topics similar to consumer groups.
244
+ - [Improvement] Raise configuration error when trying to run Karafka with options leading to no subscriptions.
245
+ - [Fix] Fix `karafka info` subscription groups count reporting as it was misleading.
246
+ - [Fix] Allow for defining subscription groups with symbols similar to consumer groups and topics to align the API.
247
+ - [Fix] Do not allow for an explicit `nil` as a `subscription_group` block argument.
248
+ - [Fix] Fix instability in subscription groups static members ids when using `--consumer_groups` CLI flag.
249
+ - [Fix] Fix a case in routing, where anonymous subscription group could not be used inside of a consumer group.
250
+ - [Fix] Fix a case where shutdown prior to listeners build would crash the server initialization.
251
+ - [Fix] Duplicated logs in development environment for Rails when logger set to `$stdout`.
252
+
253
+ ## 20.0.21 (2022-11-25)
254
+ - [Improvement] Make revocation jobs for LRJ topics non-blocking to prevent blocking polling when someone uses non-revocation aware LRJ jobs and revocation happens.
255
+
256
+ ## 2.0.20 (2022-11-24)
257
+ - [Improvement] Support `group.instance.id` assignment (static group membership) for a case where a single consumer group has multiple subscription groups (#1173).
258
+
259
+ ## 2.0.19 (2022-11-20)
260
+ - **[Feature]** Provide ability to skip failing messages without dispatching them to an alternative topic (DLQ).
261
+ - [Improvement] Improve the integration with Ruby on Rails by preventing double-require of components.
262
+ - [Improvement] Improve stability of the shutdown process upon critical errors.
263
+ - [Improvement] Improve stability of the integrations spec suite.
264
+ - [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`.
265
+
266
+ ## 2.0.18 (2022-11-18)
267
+ - **[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.
268
+ - [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).
269
+ - [Improvement] Stabilize the shutdown procedure for consumer groups with many subscription groups that have non-aligned processing cost per batch.
270
+ - [Improvement] Remove double loading of Karafka via Rails railtie.
271
+ - [Fix] Fix invalid class references in YARD docs.
272
+ - [Fix] prevent parallel closing of many clients.
273
+ - [Fix] fix a case where information about revocation for a combination of LRJ + VP would not be dispatched until all VP work is done.
274
+
275
+ ## 2.0.17 (2022-11-10)
276
+ - [Fix] Few typos around DLQ and Pro DLQ Dispatch original metadata naming.
277
+ - [Fix] Narrow the components lookup to the appropriate scope (#1114)
278
+
279
+ ### Upgrade notes
280
+
281
+ 1. Replace `original-*` references from DLQ dispatched metadata with `original_*`
282
+
283
+ ```ruby
284
+ # DLQ topic consumption
285
+ def consume
286
+ messages.each do |broken_message|
287
+ topic = broken_message.metadata['original_topic'] # was original-topic
288
+ partition = broken_message.metadata['original_partition'] # was original-partition
289
+ offset = broken_message.metadata['original_offset'] # was original-offset
290
+
291
+ Rails.logger.error "This message is broken: #{topic}/#{partition}/#{offset}"
292
+ end
293
+ end
294
+ ```
295
+
296
+ ## 2.0.16 (2022-11-09)
297
+ - **[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.
298
+ - **[Feature]** Introduce **Dead Letter Queue** feature and Pro **Enhanced Dead Letter Queue** feature
299
+ - [Improvement] Align attributes available in the instrumentation bus for listener related events.
300
+ - [Improvement] Include consumer group id in consumption related events (#1093)
301
+ - [Improvement] Delegate pro components loading to Zeitwerk
302
+ - [Improvement] Include `Datadog::LoggerListener` for tracking logger data with DataDog (@bruno-b-martins)
303
+ - [Improvement] Include `seek_offset` in the `consumer.consume.error` event payload (#1113)
304
+ - [Refactor] Remove unused logger listener event handler.
305
+ - [Refactor] Internal refactoring of routing validations flow.
306
+ - [Refactor] Reorganize how routing related features are represented internally to simplify features management.
307
+ - [Refactor] Extract supported features combinations processing flow into separate strategies.
308
+ - [Refactor] Auto-create topics in the integration specs based on the defined routing
309
+ - [Refactor] Auto-inject Pro components via composition instead of requiring to use `Karafka::Pro::BaseConsumer` (#1116)
310
+ - [Fix] Fix a case where routing tags would not be injected when given routing definition would not be used with a block
311
+ - [Fix] Fix a case where using `#active_job_topic` without extra block options would cause `manual_offset_management` to stay false.
312
+ - [Fix] Fix a case when upon Pro ActiveJob usage with Virtual Partitions, correct offset would not be stored
313
+ - [Fix] Fix a case where upon Virtual Partitions usage, same underlying real partition would be resumed several times.
314
+ - [Fix] Fix LRJ enqueuing pause increases the coordinator counter (#115)
315
+ - [Fix] Release `ActiveRecord` connection to the pool after the work in non-dev envs (#1130)
316
+ - [Fix] Fix a case where post-initialization shutdown would not initiate shutdown procedures.
317
+ - [Fix] Prevent Karafka from committing offsets twice upon shutdown.
318
+ - [Fix] Fix for a case where fast consecutive stop signaling could hang the stopping listeners.
319
+ - [Specs] Split specs into regular and pro to simplify how resources are loaded
320
+ - [Specs] Add specs to ensure, that all the Pro components have a proper per-file license (#1099)
321
+
322
+ ### Upgrade notes
323
+
324
+ 1. Remove the `manual_offset_management` setting from the main config if you use it:
325
+
326
+ ```ruby
327
+ class KarafkaApp < Karafka::App
328
+ setup do |config|
329
+ # ...
330
+
331
+ # This line needs to be removed:
332
+ config.manual_offset_management = true
333
+ end
334
+ end
335
+ ```
336
+
337
+ 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.
338
+
339
+ ```ruby
340
+ class KarafkaApp < Karafka::App
341
+ routes.draw do
342
+ consumer_group :group_name do
343
+ topic :example do
344
+ consumer ExampleConsumer
345
+ manual_offset_management true
346
+ end
347
+
348
+ topic :example2 do
349
+ consumer ExampleConsumer2
350
+ manual_offset_management true
351
+ end
352
+ end
353
+ end
354
+ end
355
+ ```
356
+
357
+ 3. If you were using code to restart dead connections similar to this:
358
+
359
+ ```ruby
360
+ class ActiveRecordConnectionsCleaner
361
+ def on_error_occurred(event)
362
+ return unless event[:error].is_a?(ActiveRecord::StatementInvalid)
363
+
364
+ ::ActiveRecord::Base.clear_active_connections!
365
+ end
366
+ end
367
+
368
+ Karafka.monitor.subscribe(ActiveRecordConnectionsCleaner.new)
369
+ ```
370
+
371
+ It **should** be removed. This code is **no longer needed**.
372
+
373
+ ## 2.0.15 (2022-10-20)
374
+ - Sanitize admin config prior to any admin action.
375
+ - Make messages partitioner outcome for virtual partitions consistently distributed in regards to concurrency.
376
+ - Improve DataDog/StatsD metrics reporting by reporting per topic partition lags and trends.
377
+ - Replace synchronous offset commit with async on resuming paused partition (#1087).
378
+
379
+ ## 2.0.14 (2022-10-16)
380
+ - Prevent consecutive stop signals from starting multiple supervision shutdowns.
381
+ - Provide `Karafka::Embedded` to simplify the start/stop process when running Karafka from within other process (Puma, Sidekiq, etc).
382
+ - Fix a race condition when un-pausing a long-running-job exactly upon listener resuming would crash the listener loop (#1072).
383
+
384
+ ## 2.0.13 (2022-10-14)
385
+ - Early exit upon attempts to commit current or earlier offset twice.
386
+ - Add more integration specs covering edge cases.
387
+ - Strip non producer related config when default producer is initialized (#776)
388
+
389
+ ## 2.0.12 (2022-10-06)
390
+ - Commit stored offsets upon rebalance revocation event to reduce number of messages that are re-processed.
391
+ - Support cooperative-sticky rebalance strategy.
392
+ - Replace offset commit after each batch with a per-rebalance commit.
393
+ - User instrumentation to publish internal rebalance errors.
394
+
395
+ ## 2.0.11 (2022-09-29)
396
+ - 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.
397
+ - Fix support of Ruby 2.7.0 to 2.7.2 (#1045)
398
+
399
+ ## 2.0.10 (2022-09-23)
400
+ - Improve error recovery by delegating the recovery to the existing `librdkafka` instance.
401
+
402
+ ## 2.0.9 (2022-09-22)
403
+ - Fix Singleton not visible when used in PORO (#1034)
404
+ - Divide pristine specs into pristine and poro. Pristine will still have helpers loaded, poro will have nothing.
405
+ - 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.
406
+ - Implement small reliability improvements around marking as consumed.
407
+ - Introduce a config sanity check to make sure Virtual Partitions are not used with manual offset management.
408
+ - Fix a possibility of using `active_job_topic` with Virtual Partitions and manual offset management (ActiveJob still can use due to atomicity of jobs).
409
+ - Move seek offset ownership to the coordinator to allow Virtual Partitions further development.
410
+ - Improve client shutdown in specs.
411
+ - Do not reset client on network issue and rely on `librdkafka` to do so.
412
+ - Allow for nameless (anonymous) subscription groups (#1033)
413
+
414
+ ## 2.0.8 (2022-09-19)
415
+ - [Breaking change] Rename Virtual Partitions `concurrency` to `max_partitions` to avoid confusion (#1023).
416
+ - Allow for block based subscription groups management (#1030).
417
+
418
+ ## 2.0.7 (2022-09-05)
419
+ - [Breaking change] Redefine the Virtual Partitions routing DSL to accept concurrency
420
+ - 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
421
+ - Allow for creation of as many Virtual Partitions as needed, without taking global `concurrency` into consideration
422
+
423
+ ## 2.0.6 (2022-09-02)
424
+ - Improve client closing.
425
+ - Fix for: Multiple LRJ topics fetched concurrently block ability for LRJ to kick in (#1002)
426
+ - Introduce a pre-enqueue sync execution layer to prevent starvation cases for LRJ
427
+ - Close admin upon critical errors to prevent segmentation faults
428
+ - Add support for manual subscription group management (#852)
429
+
430
+ ## 2.0.5 (2022-08-23)
431
+ - Fix unnecessary double new line in the `karafka.rb` template for Ruby on Rails
432
+ - Fix a case where a manually paused partition would not be processed after rebalance (#988)
433
+ - Increase specs stability.
434
+ - Lower concurrency of execution of specs in Github CI.
435
+
436
+ ## 2.0.4 (2022-08-19)
437
+ - Fix hanging topic creation (#964)
438
+ - Fix conflict with other Rails loading libraries like `gruf` (#974)
439
+
440
+ ## 2.0.3 (2022-08-09)
441
+ - Update boot info on server startup.
442
+ - Update `karafka info` with more descriptive Ruby version info.
443
+ - Fix issue where when used with Rails in development, log would be too verbose.
444
+ - Fix issue where Zeitwerk with Rails would not load Pro components despite license being present.
445
+
446
+ ## 2.0.2 (2022-08-07)
447
+ - Bypass issue with Rails reload in development by releasing the connection (https://github.com/rails/rails/issues/44183).
448
+
449
+ ## 2.0.1 (2022-08-06)
450
+ - Provide `Karafka::Admin` for creation and destruction of topics and fetching cluster info.
451
+ - Update integration specs to always use one-time disposable topics.
452
+ - Remove no longer needed `wait_for_kafka` script.
453
+ - Add more integration specs for cover offset management upon errors.
454
+
455
+ ## 2.0.0 (2022-08-05)
4
456
 
5
457
  This changelog describes changes between `1.4` and `2.0`. Please refer to appropriate release notes for changes between particular `rc` releases.
6
458
 
@@ -30,7 +482,7 @@ Karafka 2.0:
30
482
  - Introduces official [EOL policies](https://github.com/karafka/karafka/wiki/Versions-Lifecycle-and-EOL).
31
483
  - Introduces [benchmarks](https://github.com/karafka/karafka/tree/master/spec/benchmarks) that can be used to profile Karafka.
32
484
  - 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).
33
- - 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.
485
+ - 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.
34
486
 
35
487
  ### Deletions
36
488
 
@@ -78,797 +530,8 @@ Karafka 2.0:
78
530
  - Introduces a `karafka-core` dependency that contains common code used across the ecosystem.
79
531
  - Contains updated [wiki](https://github.com/karafka/karafka/wiki) on everything I could think of.
80
532
 
81
- ### What's ahead
82
-
83
- Karafka 2.0 is just the beginning.
84
-
85
- There are several things in the plan already for 2.1 and beyond, including a web dashboard, at-rest encryption, transactions support, and more.
86
-
87
- ## 2.0.0.rc6 (2022-08-05)
88
- - Update licenser to use a gem based approach based on `karafka-license`.
89
- - Do not mark intermediate jobs as consumed when Karafka runs Enhanced Active Job with Virtual Partitions.
90
- - Improve development experience by adding fast cluster state changes refresh (#944)
91
- - Improve the license loading.
92
-
93
- ## 2.0.0.rc5 (2022-08-01)
94
- - Improve specs stability
95
- - Improve forceful shutdown
96
- - Add support for debug `TTIN` backtrace printing
97
- - Fix a case where logger listener would not intercept `warn` level
98
- - Require `rdkafka` >= `0.12`
99
- - Replace statistics decorator with the one from `karafka-core`
100
-
101
- ## 2.0.0.rc4 (2022-07-28)
102
- - Remove `dry-monitor`
103
- - Use `karafka-core`
104
- - Improve forceful shutdown resources finalization
105
- - Cache consumer client name
106
-
107
- ## 2.0.0.rc3 (2022-07-26)
108
- - Fix Pro partitioner hash function may not utilize all the threads (#907).
109
- - Improve virtual partitions messages distribution.
110
- - Add StatsD/DataDog optional monitoring listener + dashboard template.
111
- - Validate that Pro consumer is always used for Pro subscription.
112
- - Improve ActiveJob consumer shutdown behaviour.
113
- - Change default `max_wait_time` to 1 second.
114
- - Change default `max_messages` to 100 (#915).
115
- - Move logger listener polling reporting level to debug when no messages (#916).
116
- - Improve stability on aggressive rebalancing (multiple rebalances in a short period).
117
- - Improve specs stability.
118
- - Allow using `:key` and `:partition_key` for Enhanced Active Job partitioning.
119
-
120
- ## 2.0.0.rc2 (2022-07-19)
121
- - Fix `example_consumer.rb.erb` `#shutdown` and `#revoked` signatures to correct once.
122
- - Improve the install user experience (print status and created files).
123
- - Change default `max_wait_time` from 10s to 5s.
124
- - Remove direct dependency on `dry-configurable` in favour of a home-brew.
125
- - Remove direct dependency on `dry-validation` in favour of a home-brew.
126
-
127
- ## 2.0.0-rc1 (2022-07-08)
128
- - Extract consumption partitioner out of listener inline code.
129
- - Introduce virtual partitioner concept for parallel processing of data from a single topic partition.
130
- - Improve stability when there kafka internal errors occur while polling.
131
- - Fix a case where we would resume a LRJ partition upon rebalance where we would reclaim the partition while job was still running.
132
- - Do not revoke pauses for lost partitions. This will allow to un-pause reclaimed partitions when LRJ jobs are done.
133
- - Fail integrations by default (unless configured otherwise) if any errors occur during Karafka server execution.
134
-
135
- ## 2.0.0-beta5 (2022-07-05)
136
- - Always resume processing of a revoked partition upon assignment.
137
- - Improve specs stability.
138
- - Fix a case where revocation job would be executed on partition for which we never did any work.
139
- - Introduce a jobs group coordinator for easier jobs management.
140
- - Improve stability of resuming paused partitions that were revoked and re-assigned.
141
- - Optimize reaction time on partition ownership changes.
142
- - Fix a bug where despite setting long max wait time, we would return messages prior to it while not reaching the desired max messages count.
143
- - Add more integration specs related to polling limits.
144
- - Remove auto-detection of re-assigned partitions upon rebalance as for too fast rebalances it could not be accurate enough. It would also mess up in case of rebalances that would happen right after a `#seek` was issued for a partition.
145
- - Optimize the removal of pre-buffered lost partitions data.
146
- - Always run `#revoked` when rebalance with revocation happens.
147
- - Evict executors upon rebalance, to prevent race-conditions.
148
- - Align topics names for integration specs.
149
-
150
- ## 2.0.0-beta4 (2022-06-20)
151
- - Rename job internal api methods from `#prepare` to `#before_call` and from `#teardown` to `#after_call` to abstract away jobs execution from any type of executors and consumers logic
152
- - Remove ability of running `before_consume` and `after_consume` completely. Those should be for internal usage only.
153
- - Reorganize how Pro consumer and Pro AJ consumers inherit.
154
- - Require WaterDrop `2.3.1`.
155
- - Add more integration specs for rebalancing and max poll exceeded.
156
- - Move `revoked?` state from PRO to regular Karafka.
157
- - Use return value of `mark_as_consumed!` and `mark_as_consumed` as indicator of partition ownership + use it to switch the ownership state.
158
- - Do not remove rebalance manager upon client reset and recovery. This will allow us to keep the notion of lost partitions, so we can run revocation jobs for blocking jobs that exceeded the max poll interval.
159
- - Run revocation jobs upon reaching max poll interval for blocking jobs.
160
- - Early exit `poll` operation upon partition lost or max poll exceeded event.
161
- - Always reset consumer instances on timeout exceeded.
162
- - Wait for Kafka to create all the needed topics before running specs in CI.
163
-
164
- ## 2.0.0-beta3 (2022-06-14)
165
- - Jobs building responsibility extracted out of the listener code base.
166
- - Fix a case where specs supervisor would try to kill no longer running process (#868)
167
- - Fix an instable integration spec that could misbehave under load
168
- - Commit offsets prior to pausing partitions to ensure that the latest offset is always committed
169
- - Fix a case where consecutive CTRL+C (non-stop) would case an exception during forced shutdown
170
- - Add missing `consumer.prepared.error` into `LoggerListener`
171
- - Delegate partition resuming from the consumers to listeners threads.
172
- - Add support for Long-Running Jobs (LRJ) for ActiveJob [PRO]
173
- - Add support for Long-Running Jobs for consumers [PRO]
174
- - Allow `active_job_topic` to accept a block for extra topic related settings
175
- - Remove no longer needed logger threads
176
- - Auto-adapt number of processes for integration specs based on the number of CPUs
177
- - Introduce an integration spec runner that prints everything to stdout (better for development)
178
- - Introduce extra integration specs for various ActiveJob usage scenarios
179
- - Rename consumer method `#prepared` to `#prepare` to reflect better its use-case
180
- - For test and dev raise an error when expired license key is used (never for non dev)
181
- - Add worker related monitor events (`worker.process` and `worker.processed`)
182
- - Update `LoggerListener` to include more useful information about processing and polling messages
183
-
184
- ## 2.0.0-beta2 (2022-06-07)
185
- - Abstract away notion of topics groups (until now it was just an array)
186
- - Optimize how jobs queue is closed. Since we enqueue jobs only from the listeners, we can safely close jobs queue once listeners are done. By extracting this responsibility from listeners, we remove corner cases and race conditions. Note here: for non-blocking jobs we do wait for them to finish while running the `poll`. This ensures, that for async jobs that are long-living, we do not reach `max.poll.interval`.
187
- - `Shutdown` jobs are executed in workers to align all the jobs behaviours.
188
- - `Shutdown` jobs are always blocking.
189
- - Notion of `ListenersBatch` was introduced similar to `WorkersBatch` to abstract this concept.
190
- - Change default `shutdown_timeout` to be more than `max_wait_time` not to cause forced shutdown when no messages are being received from Kafka.
191
- - Abstract away scheduling of revocation and shutdown jobs for both default and pro schedulers
192
- - Introduce a second (internal) messages buffer to distinguish between raw messages buffer and karafka messages buffer
193
- - Move messages and their metadata remap process to the listener thread to allow for their inline usage
194
- - Change how we wait in the shutdown phase, so shutdown jobs can still use Kafka connection even if they run for a longer period of time. This will prevent us from being kicked out from the group early.
195
- - Introduce validation that ensures, that `shutdown_timeout` is more than `max_wait_time`. This will prevent users from ending up with a config that could lead to frequent forceful shutdowns.
196
-
197
- ## 2.0.0-beta1 (2022-05-22)
198
- - Update the jobs queue blocking engine and allow for non-blocking jobs execution
199
- - Provide `#prepared` hook that always runs before the fetching loop is unblocked
200
- - [Pro] Introduce performance tracker for scheduling optimizer
201
- - Provide ability to pause (`#pause`) and resume (`#resume`) given partitions from the consumers
202
- - Small integration specs refactoring + specs for pausing scenarios
203
-
204
- ## 2.0.0-alpha6 (2022-04-17)
205
- - Fix a bug, where upon missing boot file and Rails, railtie would fail with a generic exception (#818)
206
- - Fix an issue with parallel pristine specs colliding with each other during `bundle install` (#820)
207
- - Replace `consumer.consume` with `consumer.consumed` event to match the behaviour
208
- - Make sure, that offset committing happens before the `consumer.consumed` event is propagated
209
- - Fix for failing when not installed (just a dependency) (#817)
210
- - Evict messages from partitions that were lost upon rebalancing (#825)
211
- - Do **not** run `#revoked` on partitions that were lost and assigned back upon rebalancing (#825)
212
- - Remove potential duplicated that could occur upon rebalance with re-assigned partitions (#825)
213
- - Optimize integration test suite additional consumers shutdown process (#828)
214
- - Optimize messages eviction and duplicates removal on poll stopped due to lack of messages
215
- - Add static group membership integration spec
216
-
217
- ## 2.0.0-alpha5 (2022-04-03)
218
- - Rename StdoutListener to LoggerListener (#811)
219
-
220
- ## 2.0.0-alpha4 (2022-03-20)
221
- - Rails support without ActiveJob queue adapter usage (#805)
222
-
223
- ## 2.0.0-alpha3 (2022-03-16)
224
- - Restore 'app.initialized' state and add notification on it
225
- - Fix the installation flow for Rails and add integration tests for this scenario
226
- - Add more integration tests covering some edge cases
227
-
228
- ## 2.0.0-alpha2 (2022-02-19)
229
- - Require `kafka` keys to be symbols
230
- - [Pro] Added ActiveJob Pro adapter
231
- - Small updates to the license and docs
232
-
233
- ## 2.0.0-alpha1 (2022-01-30)
234
- - Change license to `LGPL-3.0`
235
- - [Pro] Introduce a Pro subscription
236
- - Switch from `ruby-kafka` to `librdkafka` as an underlying driver
237
- - Introduce fully automatic integration tests that go through the whole server lifecycle
238
- - Integrate WaterDrop tightly with autoconfiguration inheritance and an option to redefine it
239
- - Multi-threaded support for concurrent jobs consumption (when in separate topics and/or partitions)
240
- - Introduce subscriptions groups concept for better resources management
241
- - Remove completely all the callbacks in favour of finalizer method `#on_shutdown`
242
- - Provide `on_revoked` method for taking actions upon topic revoke
243
- - Remove single message consumption mode in favour of documentation on how to do it easily by yourself
244
- - Provide sync and async offset management with async preferred
245
- - Introduce seamless Ruby on Rails integration via `Rails::Railte`
246
- - Update `cli info` to reflect the `2.0` details
247
- - Remove responders in favour of WaterDrop `2.0` producer
248
- - Remove pidfiles support
249
- - Remove daemonization support
250
- - Stop validating `kafka` configuration beyond minimum as it is handled by `librdkafka`
251
- - Remove topics mappers concept
252
- - Reorganize monitoring to match new concepts
253
- - Notify on fatal worker processing errors
254
- - Rename `Karafka::Params::BatchMetadata` to `Karafka::Messages::BatchMetadata`
255
- - Rename `Karafka::Params::Params` to `Karafka::Messages::Message`
256
- - Rename `#params_batch` in consumers to `#messages`
257
- - Rename `Karafka::Params::Metadata` to `Karafka::Messages::Metadata`
258
- - Allow for processing work of multiple consumer groups by the same worker poll
259
- - Rename `Karafka::Fetcher` to `Karafka::Runner` and align notifications key names
260
- - Update install templates
261
- - `sidekiq-backend` is no longer supported
262
- - `testing` gem for RSpec has been updated
263
- - `WaterDrop` `2.1+` support
264
- - Simple routing style (`0.5`) now builds a single consumer group instead of one per topic
265
- - Example apps were updated
266
- - Hook for underlying statistics emitted from librdkafka have been added
267
- - Hook for underlying async errors emitted from librdkafka have been added
268
- - ActiveJob Rails adapter
269
- - Added benchmarks that can be used to profile Karafka
270
- - Standardize error hook for all error reporting
271
-
272
- ## 1.4.11 (2021-12-04)
273
- - Source code metadata url added to the gemspec
274
- - Gem bump
275
-
276
- ## 1.4.10 (2021-10-30)
277
- - update gems requirements in the gemspec (nijikon)
278
-
279
- ## 1.4.9 (2021-09-29)
280
- - fix `dry-configurable` deprecation warnings for default value as positional argument
281
-
282
- ## 1.4.8 (2021-09-08)
283
- - Allow 'rails' in Gemfile to enable rails-aware generator (rewritten)
284
-
285
- ## 1.4.7 (2021-09-04)
286
- - Update ruby-kafka to `1.4.0`
287
- - Support for `resolve_seed_brokers` option (with Azdaroth)
288
- - Set minimum `ruby-kafka` requirement to `1.3.0`
289
-
290
- ## 1.4.6 (2021-08-05)
291
- - #700 Fix Ruby 3 compatibility issues in Connection::Client#pause (MmKolodziej)
292
-
293
- ## 1.4.5 (2021-06-16)
294
- - Fixup logger checks for non-writeable logfile (ojab)
295
- - #689 - Update the stdout initialization message for framework initialization
296
-
297
- ## 1.4.4 (2021-04-19)
298
- - Remove Ruby 2.5 support and update minimum Ruby requirement to 2.6
299
- - Remove rake dependency
300
-
301
- ## 1.4.3 (2021-03-24)
302
- - Fixes for Ruby 3.0 compatibility
303
-
304
- ## 1.4.2 (2021-02-16)
305
- - Rescue Errno::EROFS in ensure_dir_exists (unasuke)
306
-
307
- ## 1.4.1 (2020-12-04)
308
- - Return non-zero exit code when printing usage
309
- - Add support for :assignment_strategy for consumers
310
-
311
- ## 1.4.0 (2020-09-05)
312
- - Rename `Karafka::Params::Metadata` to `Karafka::Params::BatchMetadata`
313
- - Rename consumer `#metadata` to `#batch_metadata`
314
- - Separate metadata (including Karafka native metadata) from the root of params (backwards compatibility preserved thanks to rabotyaga)
315
- - Remove metadata hash dependency
316
- - Remove params dependency on a hash in favour of PORO
317
- - Remove batch metadata dependency on a hash
318
- - Remove MultiJson in favour of JSON in the default deserializer
319
- - allow accessing all the metadata without accessing the payload
320
- - freeze params and underlying elements except for the mutable payload
321
- - provide access to raw payload after serialization
322
- - fixes a bug where a non-deserializable (error) params would be marked as deserialized after first unsuccessful deserialization attempt
323
- - fixes bug where karafka would mutate internal ruby-kafka state
324
- - fixes bug where topic name in metadata would not be mapped using topic mappers
325
- - simplifies the params and params batch API, before `#payload` usage, it won't be deserialized
326
- - removes the `#[]` API from params to prevent from accessing raw data in a different way than #raw_payload
327
- - makes the params batch operations consistent as params payload is deserialized only when accessed explicitly
328
-
329
- ## 1.3.7 (2020-08-11)
330
- - #599 - Allow metadata access without deserialization attempt (rabotyaga)
331
- - Sync with ruby-kafka `1.2.0` api
332
-
333
- ## 1.3.6 (2020-04-24)
334
- - #583 - Use Karafka.logger for CLI messages (prikha)
335
- - #582 - Cannot only define seed brokers in consumer groups
336
-
337
- ## 1.3.5 (2020-04-02)
338
- - #578 - ThreadError: can't be called from trap context patch
339
-
340
- ## 1.3.4 (2020-02-17)
341
- - `dry-configurable` upgrade (solnic)
342
- - Remove temporary `thor` patches that are no longer needed
343
-
344
- ## 1.3.3 (2019-12-23)
345
- - Require `delegate` to fix missing dependency in `ruby-kafka`
346
-
347
- ## 1.3.2 (2019-12-23)
348
- - #561 - Allow `thor` 1.0.x usage in Karafka
349
- - #567 - Ruby 2.7.0 support + unfreeze of a frozen string fix
350
-
351
- ## 1.3.1 (2019-11-11)
352
- - #545 - Makes sure the log directory exists when is possible (robertomiranda)
353
- - Ruby 2.6.5 support
354
- - #551 - add support for DSA keys
355
- - #549 - Missing directories after `karafka install` (nijikon)
356
-
357
- ## 1.3.0 (2019-09-09)
358
- - Drop support for Ruby 2.4
359
- - YARD docs tags cleanup
360
-
361
- ## 1.3.0.rc1 (2019-07-31)
362
- - Drop support for Kafka 0.10 in favor of native support for Kafka 0.11.
363
- - Update ruby-kafka to the 0.7 version
364
- - Support messages headers receiving
365
- - Message bus unification
366
- - Parser available in metadata
367
- - Cleanup towards moving to a non-global state app management
368
- - Drop Ruby 2.3 support
369
- - Support for Ruby 2.6.3
370
- - `Karafka::Loader` has been removed in favor of Zeitwerk
371
- - Schemas are now contracts
372
- - #393 - Reorganize responders - removed `multiple_usage` constrain
373
- - #388 - ssl_client_cert_chain sync
374
- - #300 - Store value in a value key and replace its content with parsed version - without root merge
375
- - #331 - Disallow building groups without topics
376
- - #340 - Instrumentation unification. Better and more consistent naming
377
- - #340 - Procline instrumentation for a nicer process name
378
- - #342 - Change default for `fetcher_max_queue_size` from `100` to `10` to lower max memory usage
379
- - #345 - Cleanup exceptions names
380
- - #341 - Split connection delegator into batch delegator and single_delegator
381
- - #351 - Rename `#retrieve!` to `#parse!` on params and `#parsed` to `parse!` on params batch.
382
- - #351 - Adds '#first' for params_batch that returns parsed first element from the params_batch object.
383
- - #360 - Single params consuming mode automatically parses data specs
384
- - #359 - Divide mark_as_consumed into mark_as_consumed and mark_as_consumed!
385
- - #356 - Provide a `#values` for params_batch to extract only values of objects from the params_batch
386
- - #363 - Too shallow ruby-kafka version lock
387
- - #354 - Expose consumer heartbeat
388
- - #377 - Remove the persistent setup in favor of persistence
389
- - #375 - Sidekiq Backend parser mismatch
390
- - #369 - Single consumer can support more than one topic
391
- - #288 - Drop dependency on `activesupport` gem
392
- - #371 - SASL over SSL
393
- - #392 - Move params redundant data to metadata
394
- - #335 - Metadata access from within the consumer
395
- - #402 - Delayed reconnection upon critical failures
396
- - #405 - `reconnect_timeout` value is now being validated
397
- - #437 - Specs ensuring that the `#437` won't occur in the `1.3` release
398
- - #426 - ssl client cert key password
399
- - #444 - add certificate and private key validation
400
- - #460 - Decouple responder "parser" (generator?) from topic.parser (benissimo)
401
- - #463 - Split parsers into serializers / deserializers
402
- - #473 - Support SASL OAuthBearer Authentication
403
- - #475 - Disallow subscribing to the same topic with multiple consumers
404
- - #485 - Setting shutdown_timeout to nil kills the app without waiting for anything
405
- - #487 - Make listeners as instances
406
- - #29 - Consumer class names must have the word "Consumer" in it in order to work (Sidekiq backend)
407
- - #491 - irb is missing for console to work
408
- - #502 - Karafka process hangs when sending multiple sigkills
409
- - #506 - ssl_verify_hostname sync
410
- - #483 - Upgrade dry-validation before releasing 1.3
411
- - #492 - Use Zeitwerk for code reload in development
412
- - #508 - Reset the consumers instances upon reconnecting to a cluster
413
- - [#530](https://github.com/karafka/karafka/pull/530) - expose ruby and ruby-kafka version
414
- - [534](https://github.com/karafka/karafka/pull/534) - Allow to use headers in the deserializer object
415
- - [#319](https://github.com/karafka/karafka/pull/328) - Support for exponential backoff in pause
416
-
417
- ## 1.2.11
418
- - [#470](https://github.com/karafka/karafka/issues/470) Karafka not working with dry-configurable 0.8
419
-
420
- ## 1.2.10
421
- - [#453](https://github.com/karafka/karafka/pull/453) require `Forwardable` module
422
-
423
- ## 1.2.9
424
- - Critical exceptions now will cause consumer to stop instead of retrying without a break
425
- - #412 - Fix dry-inflector dependency lock in gemspec
426
- - #414 - Backport to 1.2 the delayed retry upon failure
427
- - #437 - Raw message is no longer added to params after ParserError raised
428
-
429
- ## 1.2.8
430
- - #408 - Responder Topic Lookup Bug on Heroku
431
-
432
- ## 1.2.7
433
- - Unlock Ruby-kafka version with a warning
434
-
435
- ## 1.2.6
436
- - Lock WaterDrop to 1.2.3
437
- - Lock Ruby-Kafka to 0.6.x (support for 0.7 will be added in Karafka 1.3)
438
- - #382 - Full logging with AR, etc for development mode when there is Rails integration
439
-
440
- ## 1.2.5
441
- - #354 - Expose consumer heartbeat
442
- - #373 - Async producer not working properly with responders
443
-
444
- ## 1.2.4
445
- - #332 - Fetcher for max queue size
446
-
447
- ## 1.2.3
448
- - #313 - support PLAINTEXT and SSL for scheme
449
- - #288 - drop activesupport callbacks in favor of notifications
450
- - #320 - Pausing indefinitely with nil pause timeout doesn't work
451
- - #318 - Partition pausing doesn't work with custom topic mappers
452
- - Rename ConfigAdapter to ApiAdapter to better reflect what it does
453
- - #317 - Manual offset committing doesn't work with custom topic mappers
454
-
455
- ## 1.2.2
456
- - #312 - Broken for ActiveSupport 5.2.0
457
-
458
- ## 1.2.1
459
- - #304 - Unification of error instrumentation event details
460
- - #306 - Using file logger from within a trap context upon shutdown is impossible
461
-
462
- ## 1.2.0
463
- - Spec improvements
464
- - #260 - Specs missing randomization
465
- - #251 - Shutdown upon non responding (unreachable) cluster is not possible
466
- - #258 - Investigate lowering requirements on activesupport
467
- - #246 - Alias consumer#mark_as_consumed on controller
468
- - #259 - Allow forcing key/partition key on responders
469
- - #267 - Styling inconsistency
470
- - #242 - Support setting the max bytes to fetch per request
471
- - #247 - Support SCRAM once released
472
- - #271 - Provide an after_init option to pass a configuration block
473
- - #262 - Error in the monitor code for NewRelic
474
- - #241 - Performance metrics
475
- - #274 - Rename controllers to consumers
476
- - #184 - Seek to
477
- - #284 - Dynamic Params parent class
478
- - #275 - ssl_ca_certs_from_system
479
- - #296 - Instrument forceful exit with an error
480
- - Replaced some of the activesupport parts with dry-inflector
481
- - Lower ActiveSupport dependency
482
- - Remove configurators in favor of the after_init block configurator
483
- - Ruby 2.5.0 support
484
- - Renamed Karafka::Connection::Processor to Karafka::Connection::Delegator to match incoming naming conventions
485
- - Renamed Karafka::Connection::Consumer to Karafka::Connection::Client due to #274
486
- - Removed HashWithIndifferentAccess in favor of a regular hash
487
- - JSON parsing defaults now to string keys
488
- - Lower memory usage due to less params data internal details
489
- - Support multiple ```after_init``` blocks in favor of a single one
490
- - Renamed ```received_at``` to ```receive_time``` to follow ruby-kafka and WaterDrop conventions
491
- - Adjust internal setup to easier map Ruby-Kafka config changes
492
- - System callbacks reorganization
493
- - Added ```before_fetch_loop``` configuration block for early client usage (```#seek```, etc)
494
- - Renamed ```after_fetched``` to ```after_fetch``` to normalize the naming convention
495
- - Instrumentation on a connection delegator level
496
- - Added ```params_batch#last``` method to retrieve last element after unparsing
497
- - All params keys are now strings
498
-
499
- ## 1.1.2
500
- - #256 - Default kafka.seed_brokers configuration is created in invalid format
501
-
502
- ## 1.1.1
503
- - #253 - Allow providing a global per app parser in config settings
504
-
505
- ## 1.1.0
506
- - Gem bump
507
- - Switch from Celluloid to native Thread management
508
- - Improved shutdown process
509
- - Introduced optional fetch callbacks and moved current the ```after_received``` there as well
510
- - Karafka will raise Errors::InvalidPauseTimeout exception when trying to pause but timeout set to 0
511
- - Allow float for timeouts and other time based second settings
512
- - 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"
513
- - #232 - Remove unused ActiveSupport require
514
- - #214 - Expose consumer on a controller layer
515
- - #193 - Process shutdown callbacks
516
- - Fixed accessibility of ```#params_batch``` from the outside of the controller
517
- - connection_pool config options are no longer required
518
- - celluloid config options are no longer required
519
- - ```#perform``` is now renamed to ```#consume``` with warning level on using the old one (deprecated)
520
- - #235 - Rename perform to consume
521
- - Upgrade to ruby-kafka 0.5
522
- - Due to redesign of Waterdrop concurrency setting is no longer needed
523
- - #236 - Manual offset management
524
- - WaterDrop 1.0.0 support with async
525
- - 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.
526
- - Renamed ```batch_processing``` to ```batch_consuming``` to resemble Kafka concept of consuming messages.
527
- - Renamed ```after_received``` to ```after_fetched``` to normalize the naming conventions.
528
- - Responders support the per topic ```async``` option.
529
-
530
- ## 1.0.1
531
- - #210 - LoadError: cannot load such file -- [...]/karafka.rb
532
- - Ruby 2.4.2 as a default (+travis integration)
533
- - JRuby upgrade
534
- - Expanded persistence layer (moved to a namespace for easier future development)
535
- - #213 - Misleading error when non-existing dependency is required
536
- - #212 - Make params react to #topic, #partition, #offset
537
- - #215 - Consumer group route dynamic options are ignored
538
- - #217 - check RUBY_ENGINE constant if RUBY_VERSION is missing (#217)
539
- - #218 - add configuration setting to control Celluloid's shutdown timeout
540
- - Renamed Karafka::Routing::Mapper to Karafka::Routing::TopicMapper to match naming conventions
541
- - #219 - Allow explicit consumer group names, without prefixes
542
- - Fix to early removed pid upon shutdown of demonized process
543
- - max_wait_time updated to match https://github.com/zendesk/ruby-kafka/issues/433
544
- - #230 - Better uri validation for seed brokers (incompatibility as the kafka:// or kafka+ssl:// is required)
545
- - Small internal docs fixes
546
- - Dry::Validation::MissingMessageError: message for broker_schema? was not found
547
- - #238 - warning: already initialized constant Karafka::Schemas::URI_SCHEMES
548
-
549
- ## 1.0.0
550
-
551
- ### Closed issues:
552
-
553
- - #103 - Env for logger is loaded 2 early (on gem load not on app init)
554
- - #142 - Possibility to better control Kafka consumers (consumer groups management)
555
- - #150 - Add support for start_from_beginning on a per topic basis
556
- - #154 - Support for min_bytes and max_wait_time on messages consuming
557
- - #160 - Reorganize settings to better resemble ruby-kafka requirements
558
- - #164 - If we decide to have configuration per topic, topic uniqueness should be removed
559
- - #165 - Router validator
560
- - #166 - Params and route reorganization (new API)
561
- - #167 - Remove Sidekiq UI from Karafka
562
- - #168 - Introduce unique IDs of routes
563
- - #171 - Add kafka message metadata to params
564
- - #176 - Transform Karafka::Connection::Consumer into a module
565
- - #177 - Monitor not reacting when kafka killed with -9
566
- - #175 - Allow single consumer to subscribe to multiple topics
567
- - #178 - Remove parsing failover when cannot unparse data
568
- - #174 - Extended config validation
569
- - ~~#180 - Switch from JSON parser to yajl-ruby~~
570
- - #181 - When responder is defined and not used due to ```respond_with``` not being triggered in the perform, it won't raise an exception.
571
- - #188 - Rename name in config to client id
572
- - #186 - Support ruby-kafka ```ssl_ca_cert_file_path``` config
573
- - #189 - karafka console does not preserve history on exit
574
- - #191 - Karafka 0.6.0rc1 does not work with jruby / now it does :-)
575
- - Switch to multi json so everyone can use their favourite JSON parser
576
- - Added jruby support in general and in Travis
577
- - #196 - Topic mapper does not map topics when subscribing thanks to @webandtech
578
- - #96 - Karafka server - possibility to run it only for a certain topics
579
- - ~~karafka worker cli option is removed (please use sidekiq directly)~~ - restored, bad idea
580
- - (optional) pausing upon processing failures ```pause_timeout```
581
- - Karafka console main process no longer intercepts irb errors
582
- - Wiki updates
583
- - #204 - Long running controllers
584
- - Better internal API to handle multiple usage cases using ```Karafka::Controllers::Includer```
585
- - #207 - Rename before_enqueued to after_received
586
- - #147 - De-attach Karafka from Sidekiq by extracting Sidekiq backend
587
-
588
- ### New features and improvements
589
-
590
- - batch processing thanks to ```#batch_consuming``` flag and ```#params_batch``` on controllers
591
- - ```#topic``` method on an controller instance to make a clear distinction in between params and route details
592
- - Changed routing model (still compatible with 0.5) to allow better resources management
593
- - Lower memory requirements due to object creation limitation (2-3 times less objects on each new message)
594
- - Introduced the ```#batch_consuming``` config flag (config for #126) that can be set per each consumer_group
595
- - Added support for partition, offset and partition key in the params hash
596
- - ```name``` option in config renamed to ```client_id```
597
- - 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
598
-
599
- ### Incompatibilities
600
-
601
- - Default boot file is renamed from app.rb to karafka.rb
602
- - Removed worker glass as dependency (now and independent gem)
603
- - ```kafka.hosts``` option renamed to ```kafka.seed_brokers``` - you don't need to provide all the hosts to work with Kafka
604
- - ```start_from_beginning``` moved into kafka scope (```kafka.start_from_beginning```)
605
- - 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
606
- - 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.
607
- - ```batch_mode``` renamed to ```batch_fetching```
608
- - Renamed content to value to better resemble ruby-kafka internal messages naming convention
609
- - When having a responder with ```required``` topics and not using ```#respond_with``` at all, it will raise an exception
610
- - Renamed ```inline_mode``` to ```inline_processing``` to resemble other settings conventions
611
- - Renamed ```inline_processing``` to ```backend``` to reach 1.0 future compatibility
612
- - Single controller **needs** to be used for a single topic consumption
613
- - Renamed ```before_enqueue``` to ```after_received``` to better resemble internal logic, since for inline backend, there is no enqueue.
614
- - Due to the level on which topic and controller are related (class level), the dynamic worker selection is no longer available.
615
- - Renamed params #retrieve to params #retrieve! to better reflect what it does
616
-
617
- ### Other changes
618
- - PolishGeeksDevTools removed (in favour of Coditsu)
619
- - Waaaaaay better code quality thanks to switching from dev tools to Coditsu
620
- - Gem bump
621
- - Cleaner internal API
622
- - SRP
623
- - Better settings proxying and management between ruby-kafka and karafka
624
- - All internal validations are now powered by dry-validation
625
- - Better naming conventions to reflect Kafka reality
626
- - Removed Karafka::Connection::Message in favour of direct message details extraction from Kafka::FetchedMessage
627
-
628
- ## 0.5.0.3
629
- - #132 - When Kafka is gone, should reconnect after a time period
630
- - #136 - new ruby-kafka version + other gem bumps
631
- - ruby-kafka update
632
- - #135 - NonMatchingRouteError - better error description in the code
633
- - #140 - Move Capistrano Karafka to a different specific gem
634
- - #110 - Add call method on a responder class to alias instance build and call
635
- - #76 - Configs validator
636
- - #138 - Possibility to have no worker class defined if inline_mode is being used
637
- - #145 - Topic Mapper
638
- - Ruby update to 2.4.1
639
- - Gem bump x2
640
- - #158 - Update docs section on heroku usage
641
- - #150 - Add support for start_from_beginning on a per topic basis
642
- - #148 - Lower Karafka Sidekiq dependency
643
- - Allow karafka root to be specified from ENV
644
- - Handle SIGTERM as a shutdown command for kafka server to support Heroku deployment
645
-
646
- ## 0.5.0.2
647
- - Gems update x3
648
- - Default Ruby set to 2.3.3
649
- - ~~Default Ruby set to 2.4.0~~
650
- - Readme updates to match bug fixes and resolved issues
651
- - #95 - Allow options into responder
652
- - #98 - Use parser when responding on a topic
653
- - #114 - Option to configure waterdrop connection pool timeout and concurrency
654
- - #118 - Added dot in topic validation format
655
- - #119 - add support for authentication using SSL
656
- - #121 - JSON as a default for standalone responders usage
657
- - #122 - Allow on capistrano role customization
658
- - #125 - Add support to batch incoming messages
659
- - #130 - start_from_beginning flag on routes and default
660
- - #128 - Monitor caller_label not working with super on inheritance
661
- - Renamed *inline* to *inline_mode* to stay consistent with flags that change the way karafka works (#125)
662
- - Dry-configurable bump to 0.5 with fixed proc value evaluation on retrieve patch (internal change)
663
-
664
- ## 0.5.0.1
665
- - Fixed inconsistency in responders non-required topic definition. Now only required: false available
666
- - #101 - Responders fail when multiple_usage true and required false
667
- - fix error on startup from waterdrop #102
668
- - Waterdrop 0.3.2.1 with kafka.hosts instead of kafka_hosts
669
- - #105 - Karafka::Monitor#caller_label not working with inherited monitors
670
- - #99 - Standalone mode (without Sidekiq)
671
- - #97 - Buffer responders single topics before send (pre-validation)
672
- - Better control over consumer thanks to additional config options
673
- - #111 - Dynamic worker assignment based on the income params
674
- - Long shutdown time fix
675
-
676
- ## 0.5.0
677
- - Removed Zookeeper totally as dependency
678
- - Better group and partition rebalancing
679
- - Automatic thread management (no need for tuning) - each topic is a separate actor/thread
680
- - Moved from Poseidon into Ruby-Kafka
681
- - No more max_concurrency setting
682
- - After you define your App class and routes (and everything else) you need to add execute App.boot!
683
- - Manual consuming is no longer available (no more karafka consume command)
684
- - Karafka topics CLI is no longer available. No Zookeeper - no global topic discovery
685
- - Dropped ZK as dependency
686
- - karafka info command no longer prints details about Zookeeper
687
- - Better shutdown
688
- - No more autodiscovery via Zookeeper - instead, the whole cluster will be discovered directly from Kafka
689
- - No more support for Kafka 0.8
690
- - Support for Kafka 0.9
691
- - No more need for ActorCluster, since now we have a single thread (and Kafka connection) per topic
692
- - Ruby 2.2.* support dropped
693
- - Using App name as a Kafka client_id
694
- - Automatic Capistrano integration
695
- - Responders support for handling better responses pipe-lining and better responses flow description and design (see README for more details)
696
- - Gem bump
697
- - Readme updates
698
- - karafka flow CLI command for printing the application flow
699
- - Some internal refactoring
700
-
701
- ## 0.4.2
702
- - #87 - Re-consume mode with crone for better Rails/Rack integration
703
- - Moved Karafka server related stuff into separate Karafka::Server class
704
- - Renamed Karafka::Runner into Karafka::Fetcher
705
- - Gem bump
706
- - Added chroot option to Zookeeper options
707
- - Moved BROKERS_PATH into config from constant
708
- - Added Karafka consume CLI action for a short running single consumption round
709
- - Small fixes to close broken connections
710
- - Readme updates
711
-
712
- ## 0.4.1
713
- - Explicit throw(:abort) required to halt before_enqueue (like in Rails 5)
714
- - #61 - autodiscovery of Kafka brokers based on Zookeeper data
715
- - #63 - Graceful shutdown with current offset state during data processing
716
- - #65 - Example of NewRelic monitor is outdated
717
- - #71 - Setup should be executed after user code is loaded
718
- - Gem bump x3
719
- - Rubocop remarks
720
- - 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
721
- - Moved setup logic under setup/Setup namespace
722
- - Better defaults handling
723
- - #75 - Kafka and Zookeeper options as a hash
724
- - #82 - Karafka autodiscovery fails upon caching of configs
725
- - #81 - Switch config management to dry configurable
726
- - Version fix
727
- - Dropped support for Ruby 2.1.*
728
- - Ruby bump to 2.3.1
729
-
730
- ## 0.4.0
731
- - Added WaterDrop gem with default configuration
732
- - Refactoring of config logic to simplify adding new dependencies that need to be configured based on #setup data
733
- - Gem bump
734
- - Readme updates
735
- - Renamed cluster to actor_cluster for method names
736
- - Replaced SidekiqGlass with generic WorkerGlass lib
737
- - Application bootstrap in app.rb no longer required
738
- - Karafka.boot needs to be executed after all the application files are loaded (template updated)
739
- - Small loader refactor (no API changes)
740
- - Ruby 2.3.0 support (default)
741
- - No more rake tasks
742
- - Karafka CLI instead of rake tasks
743
- - Worker cli command allows passing additional options directly to Sidekiq
744
- - Renamed concurrency to max_concurrency - it describes better what happens - Karafka will use this number of threads only when required
745
- - 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)
746
- - Rubocop remarks
747
- - Removed Sinatra and Puma dependencies
748
- - Karafka Cli internal reorganization
749
- - Karafka Cli routes task
750
- - #37 - warn log for failed parsing of a message
751
- - #43 - wrong constant name
752
- - #44 - Method name conflict
753
- - #48 - Cannot load such file -- celluloid/current
754
- - #46 - Loading application
755
- - #45 - Set up monitor in config
756
- - #47 - rake karafka:run uses app.rb only
757
- - #53 - README update with Sinatra/Rails integration description
758
- - #41 - New Routing engine
759
- - #54 - Move Karafka::Workers::BaseWorker to Karafka::BaseWorker
760
- - #55 - ApplicationController and ApplicationWorker
761
-
762
- ## 0.3.2
763
- - Karafka::Params::Params lazy load merge keys with string/symbol names priorities fix
764
-
765
- ## 0.3.1
766
- - Renamed Karafka::Monitor to Karafka::Process to represent a Karafka process wrapper
767
- - Added Karafka::Monitoring that allows to add custom logging and monitoring with external libraries and systems
768
- - Moved logging functionality into Karafka::Monitoring default monitoring
769
- - Added possibility to provide own monitoring as long as in responds to #notice and #notice_error
770
- - Standardized logging format for all logs
771
-
772
- ## 0.3.0
773
- - Switched from custom ParserError for each parser to general catching of Karafka::Errors::ParseError and its descendants
774
- - Gem bump
775
- - 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.
776
- - 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)
777
- - Added full parameters lazy load - content is no longer loaded during #perform_async if params are not used in before_enqueue
778
- - No more namespaces for Redis by default (use separate DBs)
779
-
780
- ## 0.1.21
781
- - Sidekiq 4.0.1 bump
782
- - Gem bump
783
- - Added direct celluloid requirement to Karafka (removed from Sidekiq)
784
-
785
- ## 0.1.19
786
- - Internal call - schedule naming change
787
- - Enqueue to perform_async naming in controller to follow Sidekiq naming convention
788
- - Gem bump
789
-
790
- ## 0.1.18
791
- - Changed Redis configuration options into a single hash that is directly passed to Redis setup for Sidekiq
792
- - Added config.ru to provide a Sidekiq web UI (see README for more details)
793
-
794
- ## 0.1.17
795
- - 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.
796
- - Add an ability to use user-defined parsers for a messages
797
- - Lazy load params for before callbacks
798
- - Automatic loading/initializing all workers classes during startup (so Sidekiq won't fail with unknown workers exception)
799
- - Params are now private to controller
800
- - Added bootstrap method to app.rb
801
-
802
- ## 0.1.16
803
- - Cluster level error catching for all exceptions so actor is not killer
804
- - Cluster level error logging
805
- - Listener refactoring (QueueConsumer extracted)
806
- - 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
807
- - Added debug env for debugging purpose in applications
808
-
809
- ## 0.1.15
810
- - Fixed max_wait_ms vs socket_timeout_ms issue
811
- - Fixed closing queue connection after Poseidon::Errors::ProtocolError failure
812
- - Fixed wrong logging file selection based on env
813
- - Extracted Karafka::Connection::QueueConsumer object to wrap around queue connection
814
-
815
- ## 0.1.14
816
- - Rake tasks for listing all the topics on Kafka server (rake kafka:topics)
817
-
818
- ## 0.1.13
819
- - Ability to assign custom workers and use them bypassing Karafka::BaseWorker (or its descendants)
820
- - Gem bump
821
-
822
- ## 0.1.12
823
- - All internal errors went to Karafka::Errors namespace
824
-
825
- ## 0.1.11
826
- - Rescuing all the "before Sidekiq" processing so errors won't affect other incoming messages
827
- - Fixed dying actors after connection error
828
- - Added a new app status - "initializing"
829
- - Karafka::Status model cleanup
830
-
831
- ## 0.1.10
832
- - Added possibility to specify redis namespace in configuration (failover to app name)
833
- - Renamed redis_host to redis_url in configuration
834
-
835
- ## 0.1.9
836
- - Added worker logger
837
-
838
- ## 0.1.8
839
- - Dropped local env support in favour of [Envlogic](https://github.com/karafka/envlogic) - no changes in API
840
-
841
- ## 0.1.7
842
- - Karafka option for Redis hosts (not localhost only)
843
-
844
- ## 0.1.6
845
- - Added better concurency by clusterization of listeners
846
- - Added graceful shutdown
847
- - Added concurency that allows to handle bigger applications with celluloid
848
- - Karafka controllers no longer require group to be defined (created based on the topic and app name)
849
- - Karafka controllers no longer require topic to be defined (created based on the controller name)
850
- - Readme updates
851
-
852
- ## 0.1.5
853
- - Celluloid support for listeners
854
- - Multi target logging (STDOUT and file)
855
-
856
- ## 0.1.4
857
- - Renamed events to messages to follow Apache Kafka naming convention
858
-
859
- ## 0.1.3
860
- - Karafka::App.logger moved to Karafka.logger
861
- - README updates (Usage section was added)
862
-
863
- ## 0.1.2
864
- - Logging to log/environment.log
865
- - Karafka::Runner
866
-
867
- ## 0.1.1
868
- - README updates
869
- - Rake tasks updates
870
- - Rake installation task
871
- - Changelog file added
872
-
873
- ## 0.1.0
874
- - Initial framework code
533
+ ## Older releases
534
+
535
+ This changelog tracks Karafka `2.0` and higher changes.
536
+
537
+ 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.