karafka 2.4.10 → 2.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7601c2daf3eaacae67697fe28dd403ba8bd41387df90da49691912dad7ba0963
4
- data.tar.gz: 23d6763195d2e6bf17c573859d133637c21f849e3def1eb0f852d5cb4554ae17
3
+ metadata.gz: 346743e75bc80a6a3e04361aa6b7b5caa540b31697bc25bb138baa490edd0a93
4
+ data.tar.gz: 6a87b0f7af16210b93732f55e98072b0c2eaf4541b700bb1929864b515a91747
5
5
  SHA512:
6
- metadata.gz: 56202acc444f3b69af7a8b643b9e28f77ffbcadeab70858b0ffaa4b4a7a264082c636ff5c0abbaba0ac1cd6f2fb72fd6924bf6e87fe3f6e57549d5f228786e91
7
- data.tar.gz: b39d96ef2bcd09079b044321058b4a741797673b815ff6508a8123a7a513f08ca364d05aa22dc994a25fe8c64d959bcd19342301156e97bf0b7d005d7abcb7db
6
+ metadata.gz: c20b7bb58d31b7771e593334783285edf13bfaff977350226aeb5a979fe1fd92482bb27acf72385a05a762d69581260196f953bdcea4aafbd1d50d0842fec9a2
7
+ data.tar.gz: 07b991c9048f20352c1670a5782c028757e177f7f062ce3a1ce113fd01a97184717b8c7d3612d515993cb048e21b3dcf1804b22852c1b6d9bccebb16463ca2aa
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Karafka Framework Changelog
2
2
 
3
+ ## 2.4.11 (2024-09-04)
4
+ - [Enhancement] Validate envelope target topic type for Scheduled Messages.
5
+ - [Enhancement] Support for enqueue_after_transaction_commit in rails active job.
6
+ - [Fix] Fix invalid reference to AppSignal version.
7
+
3
8
  ## 2.4.10 (2024-09-03)
4
9
  - **[Feature]** Provide Kafka based Scheduled Messages to be able to send messages in the future via a proxy topic.
5
10
  - [Enhancement] Introduce a `#assigned` hook for consumers to be able to trigger actions when consumer is built and assigned but before first consume/ticking, etc.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka (2.4.10)
4
+ karafka (2.4.11)
5
5
  base64 (~> 0.2)
6
6
  karafka-core (>= 2.4.3, < 2.5.0)
7
7
  karafka-rdkafka (>= 0.17.2)
@@ -48,16 +48,16 @@ GEM
48
48
  concurrent-ruby (~> 1.0)
49
49
  karafka-core (2.4.4)
50
50
  karafka-rdkafka (>= 0.15.0, < 0.18.0)
51
- karafka-rdkafka (0.17.3)
51
+ karafka-rdkafka (0.17.6)
52
52
  ffi (~> 1.15)
53
53
  mini_portile2 (~> 2.6)
54
54
  rake (> 12)
55
55
  karafka-testing (2.4.6)
56
56
  karafka (>= 2.4.0, < 2.5.0)
57
57
  waterdrop (>= 2.7.0)
58
- karafka-web (0.10.1)
58
+ karafka-web (0.10.2)
59
59
  erubi (~> 1.4)
60
- karafka (>= 2.4.9, < 2.5.0)
60
+ karafka (>= 2.4.10, < 2.5.0)
61
61
  karafka-core (>= 2.4.0, < 2.5.0)
62
62
  roda (~> 3.68, >= 3.69)
63
63
  tilt (~> 2.0)
@@ -97,7 +97,7 @@ GEM
97
97
  karafka-core (>= 2.4.3, < 3.0.0)
98
98
  karafka-rdkafka (>= 0.15.1)
99
99
  zeitwerk (~> 2.3)
100
- zeitwerk (2.6.17)
100
+ zeitwerk (2.6.18)
101
101
 
102
102
  PLATFORMS
103
103
  ruby
@@ -116,4 +116,4 @@ DEPENDENCIES
116
116
  simplecov
117
117
 
118
118
  BUNDLED WITH
119
- 2.5.11
119
+ 2.4.22
@@ -135,3 +135,4 @@ en:
135
135
  key_format: needs to be a non-empty string unique within the partition
136
136
  headers_schedule_target_epoch_in_the_past: 'scheduling cannot happen in the past'
137
137
  headers_format: are not correct
138
+ not_a_scheduled_messages_topic: 'the envelope topic is not a scheduled messages topic'
@@ -29,6 +29,12 @@ module ActiveJob
29
29
  def enqueue_at(_job, _timestamp)
30
30
  raise NotImplementedError, 'This queueing backend does not support scheduling jobs.'
31
31
  end
32
+
33
+ # @return [true] should we by default enqueue after the transaction and not during.
34
+ # Defaults to true to prevent weird issues during rollbacks, etc.
35
+ def enqueue_after_transaction_commit?
36
+ true
37
+ end
32
38
  end
33
39
  end
34
40
  end
@@ -148,7 +148,7 @@ module Karafka
148
148
  # compatibility checks.
149
149
  def version_4_or_newer?
150
150
  @version_4_or_newer ||=
151
- Gem::Version.new(Appsignal::VERSION) >= Gem::Version.new('4.0.0')
151
+ Gem::Version.new(::Appsignal::VERSION) >= Gem::Version.new('4.0.0')
152
152
  end
153
153
  end
154
154
  end
@@ -54,6 +54,22 @@ module Karafka
54
54
 
55
55
  [[[:headers], :schedule_target_epoch_in_the_past]]
56
56
  end
57
+
58
+ # Makes sure, that the target envelope topic we dispatch to is a scheduled messages topic
59
+ virtual do |data, errors|
60
+ next unless errors.empty?
61
+
62
+ scheduled_topics = Karafka::App
63
+ .routes
64
+ .flat_map(&:topics)
65
+ .flat_map(&:to_a)
66
+ .select(&:scheduled_messages?)
67
+ .map(&:name)
68
+
69
+ next if scheduled_topics.include?(data[:topic].to_s)
70
+
71
+ [[[:topic], :not_a_scheduled_messages_topic]]
72
+ end
57
73
  end
58
74
  end
59
75
  end
@@ -3,5 +3,5 @@
3
3
  # Main module namespace
4
4
  module Karafka
5
5
  # Current Karafka version
6
- VERSION = '2.4.10'
6
+ VERSION = '2.4.11'
7
7
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.10
4
+ version: 2.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -35,7 +35,7 @@ cert_chain:
35
35
  i9zWxov0mr44TWegTVeypcWGd/0nxu1+QHVNHJrpqlPBRvwQsUm7fwmRInGpcaB8
36
36
  ap8wNYvryYzrzvzUxIVFBVM5PacgkFqRmolCa8I7tdKQN+R1
37
37
  -----END CERTIFICATE-----
38
- date: 2024-09-03 00:00:00.000000000 Z
38
+ date: 2024-09-04 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: base64
metadata.gz.sig CHANGED
@@ -1,3 +1,3 @@
1
- ��ՑQ5�,h��п
2
- "�2A���M`�:k��gIzg#�u˪��u�ւJÍ2��#�GyЎ�KiE�_)� �H�>u�82�F�j�I��?���l�%�����W�0�D$��3k�=�
3
- dj���5��cY88��2�4��I$�1�y0�3�|�I���u\x��ͭ�[�q��6��ʶ�x�_�V~d�;a��I���r+~��|�I�H�_J-�̈$QyMd��Cm[_d��F�E{�|%���H�|`�qP�=�_ގ�?gZ{٭M�eZ�#���͎����* �9�^�8$�J���G-�Z�L2��1���X�x��)��(��ٽe��
1
+ &���b�0�U@��\,-�='���px��Zg��^~��F�~�Ӊn��ew�Z�k ������l���������W�p����A�s���� ��*�NR8p$ˮ��Y}<�O�����{�YR���EMF;��մd)�K�~ƠbE�*r-���\8���oD�<f�sTM/��MqMcd�c���t�[b\}z]��= !"A�/:��ն�v��f]���#{>�l0���|��W��Y�a$�'�Ğ�n�v�=oq�(�(�jV�•���r:> ���h�Y3<}�2�mZބQ��&d$��]n&���๠Hv��)'����
2
+ bb��V��lF������q�@��?���4dZ:��BQ��Ҡ��FO( ��OΜj
3
+ ��E�