deimos-temp-fork 0.0.1
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 +7 -0
- data/.circleci/config.yml +83 -0
- data/.gitignore +41 -0
- data/.gitmodules +0 -0
- data/.rspec +1 -0
- data/.rubocop.yml +333 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +349 -0
- data/CODE_OF_CONDUCT.md +77 -0
- data/Dockerfile +23 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +286 -0
- data/Guardfile +22 -0
- data/LICENSE.md +195 -0
- data/README.md +1099 -0
- data/Rakefile +13 -0
- data/bin/deimos +4 -0
- data/deimos-ruby.gemspec +44 -0
- data/docker-compose.yml +71 -0
- data/docs/ARCHITECTURE.md +140 -0
- data/docs/CONFIGURATION.md +236 -0
- data/docs/DATABASE_BACKEND.md +147 -0
- data/docs/INTEGRATION_TESTS.md +52 -0
- data/docs/PULL_REQUEST_TEMPLATE.md +35 -0
- data/docs/UPGRADING.md +128 -0
- data/lib/deimos-temp-fork.rb +95 -0
- data/lib/deimos/active_record_consume/batch_consumption.rb +164 -0
- data/lib/deimos/active_record_consume/batch_slicer.rb +27 -0
- data/lib/deimos/active_record_consume/message_consumption.rb +79 -0
- data/lib/deimos/active_record_consume/schema_model_converter.rb +52 -0
- data/lib/deimos/active_record_consumer.rb +67 -0
- data/lib/deimos/active_record_producer.rb +87 -0
- data/lib/deimos/backends/base.rb +32 -0
- data/lib/deimos/backends/db.rb +41 -0
- data/lib/deimos/backends/kafka.rb +33 -0
- data/lib/deimos/backends/kafka_async.rb +33 -0
- data/lib/deimos/backends/test.rb +20 -0
- data/lib/deimos/batch_consumer.rb +7 -0
- data/lib/deimos/config/configuration.rb +381 -0
- data/lib/deimos/config/phobos_config.rb +137 -0
- data/lib/deimos/consume/batch_consumption.rb +150 -0
- data/lib/deimos/consume/message_consumption.rb +94 -0
- data/lib/deimos/consumer.rb +104 -0
- data/lib/deimos/instrumentation.rb +76 -0
- data/lib/deimos/kafka_message.rb +60 -0
- data/lib/deimos/kafka_source.rb +128 -0
- data/lib/deimos/kafka_topic_info.rb +102 -0
- data/lib/deimos/message.rb +79 -0
- data/lib/deimos/metrics/datadog.rb +47 -0
- data/lib/deimos/metrics/mock.rb +39 -0
- data/lib/deimos/metrics/provider.rb +36 -0
- data/lib/deimos/monkey_patches/phobos_cli.rb +35 -0
- data/lib/deimos/monkey_patches/phobos_producer.rb +51 -0
- data/lib/deimos/poll_info.rb +9 -0
- data/lib/deimos/producer.rb +224 -0
- data/lib/deimos/railtie.rb +8 -0
- data/lib/deimos/schema_backends/avro_base.rb +140 -0
- data/lib/deimos/schema_backends/avro_local.rb +30 -0
- data/lib/deimos/schema_backends/avro_schema_coercer.rb +119 -0
- data/lib/deimos/schema_backends/avro_schema_registry.rb +34 -0
- data/lib/deimos/schema_backends/avro_validation.rb +21 -0
- data/lib/deimos/schema_backends/base.rb +150 -0
- data/lib/deimos/schema_backends/mock.rb +42 -0
- data/lib/deimos/shared_config.rb +63 -0
- data/lib/deimos/test_helpers.rb +360 -0
- data/lib/deimos/tracing/datadog.rb +35 -0
- data/lib/deimos/tracing/mock.rb +40 -0
- data/lib/deimos/tracing/provider.rb +29 -0
- data/lib/deimos/utils/db_poller.rb +150 -0
- data/lib/deimos/utils/db_producer.rb +243 -0
- data/lib/deimos/utils/deadlock_retry.rb +68 -0
- data/lib/deimos/utils/inline_consumer.rb +150 -0
- data/lib/deimos/utils/lag_reporter.rb +175 -0
- data/lib/deimos/utils/schema_controller_mixin.rb +115 -0
- data/lib/deimos/version.rb +5 -0
- data/lib/generators/deimos/active_record/templates/migration.rb.tt +28 -0
- data/lib/generators/deimos/active_record/templates/model.rb.tt +5 -0
- data/lib/generators/deimos/active_record_generator.rb +79 -0
- data/lib/generators/deimos/db_backend/templates/migration +25 -0
- data/lib/generators/deimos/db_backend/templates/rails3_migration +31 -0
- data/lib/generators/deimos/db_backend_generator.rb +48 -0
- data/lib/generators/deimos/db_poller/templates/migration +11 -0
- data/lib/generators/deimos/db_poller/templates/rails3_migration +16 -0
- data/lib/generators/deimos/db_poller_generator.rb +48 -0
- data/lib/tasks/deimos.rake +34 -0
- data/spec/active_record_batch_consumer_spec.rb +481 -0
- data/spec/active_record_consume/batch_slicer_spec.rb +42 -0
- data/spec/active_record_consume/schema_model_converter_spec.rb +105 -0
- data/spec/active_record_consumer_spec.rb +154 -0
- data/spec/active_record_producer_spec.rb +85 -0
- data/spec/backends/base_spec.rb +10 -0
- data/spec/backends/db_spec.rb +54 -0
- data/spec/backends/kafka_async_spec.rb +11 -0
- data/spec/backends/kafka_spec.rb +11 -0
- data/spec/batch_consumer_spec.rb +256 -0
- data/spec/config/configuration_spec.rb +248 -0
- data/spec/consumer_spec.rb +209 -0
- data/spec/deimos_spec.rb +169 -0
- data/spec/generators/active_record_generator_spec.rb +56 -0
- data/spec/handlers/my_batch_consumer.rb +10 -0
- data/spec/handlers/my_consumer.rb +10 -0
- data/spec/kafka_listener_spec.rb +55 -0
- data/spec/kafka_source_spec.rb +381 -0
- data/spec/kafka_topic_info_spec.rb +111 -0
- data/spec/message_spec.rb +19 -0
- data/spec/phobos.bad_db.yml +73 -0
- data/spec/phobos.yml +77 -0
- data/spec/producer_spec.rb +498 -0
- data/spec/rake_spec.rb +19 -0
- data/spec/schema_backends/avro_base_shared.rb +199 -0
- data/spec/schema_backends/avro_local_spec.rb +32 -0
- data/spec/schema_backends/avro_schema_registry_spec.rb +32 -0
- data/spec/schema_backends/avro_validation_spec.rb +24 -0
- data/spec/schema_backends/base_spec.rb +33 -0
- data/spec/schemas/com/my-namespace/Generated.avsc +71 -0
- data/spec/schemas/com/my-namespace/MyNestedSchema.avsc +62 -0
- data/spec/schemas/com/my-namespace/MySchema-key.avsc +13 -0
- data/spec/schemas/com/my-namespace/MySchema.avsc +18 -0
- data/spec/schemas/com/my-namespace/MySchemaCompound-key.avsc +18 -0
- data/spec/schemas/com/my-namespace/MySchemaWithBooleans.avsc +18 -0
- data/spec/schemas/com/my-namespace/MySchemaWithDateTimes.avsc +33 -0
- data/spec/schemas/com/my-namespace/MySchemaWithId.avsc +28 -0
- data/spec/schemas/com/my-namespace/MySchemaWithUniqueId.avsc +32 -0
- data/spec/schemas/com/my-namespace/Wibble.avsc +43 -0
- data/spec/schemas/com/my-namespace/Widget.avsc +27 -0
- data/spec/schemas/com/my-namespace/WidgetTheSecond.avsc +27 -0
- data/spec/schemas/com/my-namespace/request/CreateTopic.avsc +11 -0
- data/spec/schemas/com/my-namespace/request/Index.avsc +11 -0
- data/spec/schemas/com/my-namespace/request/UpdateRequest.avsc +11 -0
- data/spec/schemas/com/my-namespace/response/CreateTopic.avsc +11 -0
- data/spec/schemas/com/my-namespace/response/Index.avsc +11 -0
- data/spec/schemas/com/my-namespace/response/UpdateResponse.avsc +11 -0
- data/spec/spec_helper.rb +267 -0
- data/spec/utils/db_poller_spec.rb +320 -0
- data/spec/utils/db_producer_spec.rb +514 -0
- data/spec/utils/deadlock_retry_spec.rb +74 -0
- data/spec/utils/inline_consumer_spec.rb +31 -0
- data/spec/utils/lag_reporter_spec.rb +76 -0
- data/spec/utils/platform_schema_validation_spec.rb +0 -0
- data/spec/utils/schema_controller_mixin_spec.rb +84 -0
- data/support/deimos-solo.png +0 -0
- data/support/deimos-with-name-next.png +0 -0
- data/support/deimos-with-name.png +0 -0
- data/support/flipp-logo.png +0 -0
- metadata +551 -0
data/.ruby-gemset
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
deimos
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.5.3
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## UNRELEASED
|
|
9
|
+
### Roadmap :car:
|
|
10
|
+
|
|
11
|
+
- TestHelper does not automatically reset Deimos config before each test. [#120](https://github.com/flipp-oss/deimos/pull/120).
|
|
12
|
+
**Please note that this is a breaking change**
|
|
13
|
+
|
|
14
|
+
## 1.10.2 - 2021-07-20
|
|
15
|
+
|
|
16
|
+
- ### Fixes :wrench:
|
|
17
|
+
|
|
18
|
+
- Fixed issue where producers would stay in an error state after e.g. authorization failures for one topic that wouldn't apply to other topics.
|
|
19
|
+
|
|
20
|
+
## 1.10.1 - 2021-06-21
|
|
21
|
+
|
|
22
|
+
- ### Fixes :wrench:
|
|
23
|
+
|
|
24
|
+
- Fixed crash when trying to decode a nil payload (e.g. during instrumentation of `send_produce_error`.)
|
|
25
|
+
|
|
26
|
+
## 1.10.0 - 2021-03-22
|
|
27
|
+
|
|
28
|
+
- ### Roadmap :car:
|
|
29
|
+
|
|
30
|
+
- Extracted the configuration piece into a separate gem, [fig_tree](https://www.github.com/flipp-oss/fig_tree).
|
|
31
|
+
- Added a `save_record` method to ActiveRecordConsumer in case calling code wants to work with the record before saving.
|
|
32
|
+
|
|
33
|
+
- ### Fixes :wrench:
|
|
34
|
+
|
|
35
|
+
- Fixed a regression where the default values for consumer / Phobos listener configs were not correct (they were all nil). This is technically a breaking change, but it puts the configs back the way they were at version 1.4 and matches the documentation.
|
|
36
|
+
|
|
37
|
+
## 1.9.2 - 2021-01-29
|
|
38
|
+
|
|
39
|
+
- ### Fixes :wrench:
|
|
40
|
+
|
|
41
|
+
- Fix for `uninitialized constant ActiveSupport::Autoload` in certain circumstances
|
|
42
|
+
- Removed unnecessary monkey patch which was crashing on newer versions of ruby-kafka
|
|
43
|
+
|
|
44
|
+
## 1.9.0 - 2021-01-28
|
|
45
|
+
|
|
46
|
+
- ### Roadmap :car:
|
|
47
|
+
|
|
48
|
+
- Bumped the version of ruby-kafka to latest
|
|
49
|
+
|
|
50
|
+
- ### Fixes :wrench:
|
|
51
|
+
|
|
52
|
+
- Prevents DB Poller from reconnecting to DB if there is an open transaction
|
|
53
|
+
- Replaces `before` by `prepend_before` for more consistent test setups.
|
|
54
|
+
- Adds validation in the `kafka_producers` method (fixes [#90](https://github.com/flipp-oss/deimos/issues/90))
|
|
55
|
+
|
|
56
|
+
## 1.8.7 - 2021-01-14
|
|
57
|
+
|
|
58
|
+
- ### Roadmap :car:
|
|
59
|
+
- Update Phobos version to allow version 1.9 or 2.x.
|
|
60
|
+
|
|
61
|
+
## 1.8.6 - 2021-01-14
|
|
62
|
+
|
|
63
|
+
- ### Fixes :wrench:
|
|
64
|
+
- Fix for configuration bug with Ruby 3.0 (** instead of passing hash)
|
|
65
|
+
|
|
66
|
+
## 1.8.5 - 2021-01-13
|
|
67
|
+
|
|
68
|
+
- ### Fixes :wrench:
|
|
69
|
+
- Fixes for Rails 6.1 (remove usage of `update_attributes!`)
|
|
70
|
+
|
|
71
|
+
## 1.8.4 - 2020-12-02
|
|
72
|
+
|
|
73
|
+
### Features :star:
|
|
74
|
+
- Add overridable "process_message?" method to ActiveRecordConsumer to allow for skipping of saving/updating records
|
|
75
|
+
|
|
76
|
+
### Fixes :wrench:
|
|
77
|
+
|
|
78
|
+
- Do not apply type coercion to `timestamp-millis` and `timestamp-micros` logical types (fixes [#97](https://github.com/flipp-oss/deimos/issues/97))
|
|
79
|
+
|
|
80
|
+
## 1.8.3 - 2020-11-18
|
|
81
|
+
|
|
82
|
+
### Fixes :wrench:
|
|
83
|
+
- Do not resend already sent messages when splitting up batches
|
|
84
|
+
(fixes [#24](https://github.com/flipp-oss/deimos/issues/24))
|
|
85
|
+
- KafkaSource crashing on bulk-imports if import hooks are disabled
|
|
86
|
+
(fixes [#73](https://github.com/flipp-oss/deimos/issues/73))
|
|
87
|
+
- #96 Use string-safe encoding for partition keys
|
|
88
|
+
- Retry on offset seek failures in inline consumer
|
|
89
|
+
(fixes [#5](Inline consumer should use retries when seeking))
|
|
90
|
+
|
|
91
|
+
## 1.8.2 - 2020-09-25
|
|
92
|
+
|
|
93
|
+
### Features :star:
|
|
94
|
+
- Add "disabled" config field to consumers to allow disabling
|
|
95
|
+
individual consumers without having to comment out their
|
|
96
|
+
entries and possibly affecting unit tests.
|
|
97
|
+
|
|
98
|
+
### Fixes :wrench:
|
|
99
|
+
- Prepend topic_prefix while encoding messages
|
|
100
|
+
(fixes [#37](https://github.com/flipp-oss/deimos/issues/37))
|
|
101
|
+
- Raise error if producing without a topic
|
|
102
|
+
(fixes [#50](https://github.com/flipp-oss/deimos/issues/50))
|
|
103
|
+
- Don't try to load producers/consumers when running rake tasks involving webpacker or assets
|
|
104
|
+
|
|
105
|
+
## 1.8.2-beta2 - 2020-09-15
|
|
106
|
+
|
|
107
|
+
### Features :star:
|
|
108
|
+
|
|
109
|
+
- Add details on using schema backend directly in README.
|
|
110
|
+
- Default to the provided schema if topic is not provided when
|
|
111
|
+
encoding to `AvroSchemaRegistry`.
|
|
112
|
+
- Add mapping syntax for the `schema` call in `SchemaControllerMixin`.
|
|
113
|
+
|
|
114
|
+
## 1.8.2-beta1 - 2020-09-09
|
|
115
|
+
|
|
116
|
+
### Features :star:
|
|
117
|
+
|
|
118
|
+
- Added the ability to specify the topic for `publish`
|
|
119
|
+
and `publish_list` in a producer
|
|
120
|
+
|
|
121
|
+
## 1.8.1-beta9 - 2020-08-27
|
|
122
|
+
|
|
123
|
+
### Fixes :wrench:
|
|
124
|
+
- Moved the TestHelpers hook to `before(:suite)` to allow for
|
|
125
|
+
overriding e.g. in integration tests.
|
|
126
|
+
|
|
127
|
+
## 1.8.1-beta7 - 2020-08-25
|
|
128
|
+
|
|
129
|
+
### Fixes :wrench:
|
|
130
|
+
- Fix for crash when sending pending metrics with DB producer.
|
|
131
|
+
- Fix for compacting messages if all the keys are already unique
|
|
132
|
+
(fixes [#75](https://github.com/flipp-oss/deimos/issues/75))
|
|
133
|
+
|
|
134
|
+
## 1.8.1-beta6 - 2020-08-13
|
|
135
|
+
|
|
136
|
+
### Fixes :wrench:
|
|
137
|
+
|
|
138
|
+
- Fix for consuming nil payloads with Ruby 2.3.
|
|
139
|
+
|
|
140
|
+
## 1.8.1-beta5 - 2020-08-13
|
|
141
|
+
|
|
142
|
+
### Fixes :wrench:
|
|
143
|
+
- Fix regression bug which introduces backwards incompatibility
|
|
144
|
+
with ActiveRecordProducer's `record_attributes` method.
|
|
145
|
+
|
|
146
|
+
## 1.8.1-beta4 - 2020-08-12
|
|
147
|
+
|
|
148
|
+
### Fixes :wrench:
|
|
149
|
+
- Fix regression bug where arrays were not being encoded
|
|
150
|
+
|
|
151
|
+
## 1.8.1-beta3 - 2020-08-05
|
|
152
|
+
|
|
153
|
+
### Fixes :wrench:
|
|
154
|
+
- Simplify decoding messages and handle producer not found
|
|
155
|
+
- Consolidate types in sub-records recursively
|
|
156
|
+
(fixes [#72](https://github.com/flipp-oss/deimos/issues/72))
|
|
157
|
+
|
|
158
|
+
## 1.8.1-beta2 - 2020-07-28
|
|
159
|
+
|
|
160
|
+
### Features :star:
|
|
161
|
+
- Add `SchemaControllerMixin` to encode and decode schema-encoded
|
|
162
|
+
payloads in Rails controllers.
|
|
163
|
+
|
|
164
|
+
## 1.8.1-beta1 - 2020-07-22
|
|
165
|
+
|
|
166
|
+
### Fixes :wrench:
|
|
167
|
+
- Retry deleting messages without resending the batch if the
|
|
168
|
+
delete fails (fixes [#34](https://github.com/flipp-oss/deimos/issues/34))
|
|
169
|
+
- Delete messages in batches rather than all at once to
|
|
170
|
+
cut down on the chance of a deadlock.
|
|
171
|
+
|
|
172
|
+
### Features :star:
|
|
173
|
+
- Add `last_processed_at` to `kafka_topic_info` to ensure
|
|
174
|
+
that wait metrics are accurate in cases where records
|
|
175
|
+
get created with an old `created_at` time (e.g. for
|
|
176
|
+
long-running transactions).
|
|
177
|
+
- Add generator for ActiveRecord models and migrations (fixes [#6](https://github.com/flipp-oss/deimos/issues/6))
|
|
178
|
+
|
|
179
|
+
## 1.8.0-beta2 - 2020-07-08
|
|
180
|
+
|
|
181
|
+
### Fixes :wrench:
|
|
182
|
+
- Fix crash with batch consumption due to not having ActiveSupport::Concern
|
|
183
|
+
|
|
184
|
+
### Features :star:
|
|
185
|
+
- Add `first_offset` to the metadata sent via the batch
|
|
186
|
+
|
|
187
|
+
## 1.8.0-beta1 - 2020-07-06
|
|
188
|
+
### Features :star:
|
|
189
|
+
- Added `ActiveRecordConsumer` batch mode
|
|
190
|
+
|
|
191
|
+
### Fixes :wrench:
|
|
192
|
+
- Fixes `send_produce_error` to decode `failed_messages` with built-in decoder.
|
|
193
|
+
- Lag calculation can be incorrect if no messages are being consumed.
|
|
194
|
+
- Fixed bug where printing messages on a MessageSizeTooLarge
|
|
195
|
+
error didn't work.
|
|
196
|
+
|
|
197
|
+
### Roadmap
|
|
198
|
+
- Moved SignalHandler and Executor to the `sigurd` gem.
|
|
199
|
+
|
|
200
|
+
## 1.7.0-beta1 - 2020-05-12
|
|
201
|
+
### Features :star:
|
|
202
|
+
- Added the DB Poller feature / process.
|
|
203
|
+
|
|
204
|
+
## 1.6.4 - 2020-05-11
|
|
205
|
+
- Fixed the payload logging fix for errored messages as well.
|
|
206
|
+
|
|
207
|
+
## 1.6.3 - 2020-05-04
|
|
208
|
+
### Fixes :wrench:
|
|
209
|
+
- Fixed the payload logging fix.
|
|
210
|
+
|
|
211
|
+
## 1.6.2 - 2020-05-04
|
|
212
|
+
### Fixes :wrench:
|
|
213
|
+
- When saving records via `ActiveRecordConsumer`, update `updated_at` to today's time
|
|
214
|
+
even if nothing else was saved.
|
|
215
|
+
- When logging payloads and metadata, decode them first.
|
|
216
|
+
- Fixes bug in `KafkaSource` that crashes when importing a mix of existing and new records with the `:on_duplicate_key_update` option.
|
|
217
|
+
|
|
218
|
+
## [1.6.1] - 2020-04-20
|
|
219
|
+
### Fixes :wrench:
|
|
220
|
+
- Re-consuming a message after crashing would try to re-decode message keys.
|
|
221
|
+
|
|
222
|
+
# [1.6.0] - 2020-03-05
|
|
223
|
+
### Roadmap :car:
|
|
224
|
+
- Removed `was_message_sent?` method from `TestHelpers`.
|
|
225
|
+
|
|
226
|
+
# [1.6.0-beta1] - 2020-02-05
|
|
227
|
+
### Roadmap :car:
|
|
228
|
+
- Updated dependency for Phobos to 1.9.0-beta3. This ensures compatibility with
|
|
229
|
+
Phobos 2.0.
|
|
230
|
+
### Fixes :wrench:
|
|
231
|
+
- Fixed RSpec warning when using `test_consume_invalid_message`.
|
|
232
|
+
|
|
233
|
+
# [1.5.0-beta2] - 2020-01-17
|
|
234
|
+
### Roadmap :car:
|
|
235
|
+
- Added schema backends, which should simplify Avro encoding and make it
|
|
236
|
+
more flexible for unit tests and local development.
|
|
237
|
+
### Features :star:
|
|
238
|
+
- Add `:test` producer backend which replaces the existing TestHelpers
|
|
239
|
+
functionality of writing messages to an in-memory hash.
|
|
240
|
+
|
|
241
|
+
# [1.4.0-beta7] - 2019-12-16
|
|
242
|
+
### Fixes :wrench:
|
|
243
|
+
- Clone loggers when assigning to multiple levels.
|
|
244
|
+
|
|
245
|
+
# [1.4.0-beta6] - 2019-12-16
|
|
246
|
+
### Features :star:
|
|
247
|
+
- Added default for max_bytes_per_partition.
|
|
248
|
+
|
|
249
|
+
# [1.4.0-beta4] - 2019-11-26
|
|
250
|
+
### Features :star:
|
|
251
|
+
- Added `define_settings` to define settings without invoking callbacks.
|
|
252
|
+
|
|
253
|
+
# [1.4.0-beta2] - 2019-11-22
|
|
254
|
+
### Fixes :wrench:
|
|
255
|
+
- Settings with default_proc were being called immediately
|
|
256
|
+
instead of being lazy-evaluated.
|
|
257
|
+
|
|
258
|
+
# [1.4.0-beta1] - 2019-11-22
|
|
259
|
+
### Roadmap :car:
|
|
260
|
+
- Complete revamp of configuration method.
|
|
261
|
+
|
|
262
|
+
# [1.3.0-beta5] - 2020-01-14
|
|
263
|
+
### Features :star:
|
|
264
|
+
- Added `db_producer.insert` and `db_producer.process` metrics.
|
|
265
|
+
|
|
266
|
+
# [1.3.0-beta4] - 2019-12-02
|
|
267
|
+
### Fixes :wrench:
|
|
268
|
+
- Fixed bug where by running `rake deimos:start` without
|
|
269
|
+
specifying a producer backend would crash.
|
|
270
|
+
|
|
271
|
+
# [1.3.0-beta3] - 2019-11-26
|
|
272
|
+
### Fixes :wrench:
|
|
273
|
+
- Fixed bug in TestHelpers where key_decoder was not stubbed out.
|
|
274
|
+
|
|
275
|
+
# [1.3.0-beta2] - 2019-11-22
|
|
276
|
+
### Fixes :wrench:
|
|
277
|
+
- Fixed bug where consumers would require a key config in all cases
|
|
278
|
+
even though it's optional if they don't use keys.
|
|
279
|
+
|
|
280
|
+
# [1.3.0-beta1] - 2019-11-21
|
|
281
|
+
### Features :star:
|
|
282
|
+
- Added `fetch_record` and `assign_key` methods to ActiveRecordConsumer.
|
|
283
|
+
|
|
284
|
+
# [1.2.0-beta1] - 2019-09-12
|
|
285
|
+
### Features :star:
|
|
286
|
+
- Added `fatal_error` to both global config and consumer classes.
|
|
287
|
+
- Changed `pending_db_messages_max_wait` metric to send per topic.
|
|
288
|
+
- Added config to compact messages in the DB producer.
|
|
289
|
+
- Added config to log messages in the DB producer.
|
|
290
|
+
- Added config to provide a separate logger to the DB producer.
|
|
291
|
+
|
|
292
|
+
# [1.1.0-beta2] - 2019-09-11
|
|
293
|
+
### Fixes :wrench:
|
|
294
|
+
- Fixed bug where ActiveRecordConsumer was not using `unscoped` to update
|
|
295
|
+
via primary key and causing duplicate record errors.
|
|
296
|
+
|
|
297
|
+
# [1.1.0-beta1] - 2019-09-10
|
|
298
|
+
### Features :star:
|
|
299
|
+
- Added BatchConsumer.
|
|
300
|
+
|
|
301
|
+
## [1.0.0] - 2019-09-03
|
|
302
|
+
### Roadmap :car:
|
|
303
|
+
- Official release of Deimos 1.0!
|
|
304
|
+
|
|
305
|
+
## [1.0.0-beta26] - 2019-08-29
|
|
306
|
+
- Recover from Kafka::MessageSizeTooLarge in the DB producer.
|
|
307
|
+
- Shut down sync producers correctly when persistent_connections is true.
|
|
308
|
+
- Notify when messages fail to produce in the DB producer.
|
|
309
|
+
- Delete messages on failure and rely on notification.
|
|
310
|
+
|
|
311
|
+
## [1.0.0-beta25] - 2019-08-28
|
|
312
|
+
- Fix bug where crashing would cause producers to stay disabled
|
|
313
|
+
|
|
314
|
+
## [1.0.0-beta24] - 2019-08-26
|
|
315
|
+
- Reconnect DB backend if database goes away.
|
|
316
|
+
- Sleep only 5 seconds between attempts instead of using exponential backoff.
|
|
317
|
+
- Fix for null payload being Avro-encoded.
|
|
318
|
+
|
|
319
|
+
## [1.0.0-beta23] - 2019-08-22
|
|
320
|
+
- Fix bug where nil payloads were not being saved to the DB.
|
|
321
|
+
- Fix DB producer rake task looking at THREADS env var instead of THREAD_COUNT.
|
|
322
|
+
- Debug messages in the DB producer if debug logs are turned on.
|
|
323
|
+
- Changed logger in specs to info.
|
|
324
|
+
|
|
325
|
+
## [1.0.0-beta22] - 2019-08-09
|
|
326
|
+
- Add `pending_db_messages_max_wait` metric for the DB producer.
|
|
327
|
+
- Fix mock metrics to allow optional option hashes.
|
|
328
|
+
|
|
329
|
+
## [1.0.0-beta21] - 2019-08-08
|
|
330
|
+
- Handle Phobos `persistent_connections` setting in handling buffer overflows
|
|
331
|
+
|
|
332
|
+
## [1.0.0-beta20] - 2019-08-07
|
|
333
|
+
- Catch buffer overflows when producing via the DB producer and split the
|
|
334
|
+
batch up.
|
|
335
|
+
|
|
336
|
+
## [1.0.0-beta19] - 2019-08-06
|
|
337
|
+
- Fix for DB producer crashing on error in Rails 3.
|
|
338
|
+
|
|
339
|
+
## [1.0.0-beta18] - 2019-08-02
|
|
340
|
+
- Fixed crash when sending metrics in a couple of places.
|
|
341
|
+
|
|
342
|
+
## [1.0.0-beta17] - 2019-07-31
|
|
343
|
+
- Added `rails deimos:db_producer` rake task.
|
|
344
|
+
- Fixed the DB producer so it runs inline instead of on a separate thread.
|
|
345
|
+
Calling code should run it on a thread manually if that is the desired
|
|
346
|
+
behavior.
|
|
347
|
+
|
|
348
|
+
## [1.0.0-beta15] - 2019-07-08
|
|
349
|
+
- Initial release.
|
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
|
10
|
+
appearance, race, religion, or sexual identity and orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
|
15
|
+
include:
|
|
16
|
+
|
|
17
|
+
* Using welcoming and inclusive language
|
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
|
19
|
+
* Gracefully accepting constructive criticism
|
|
20
|
+
* Focusing on what is best for the community
|
|
21
|
+
* Showing empathy towards other community members
|
|
22
|
+
|
|
23
|
+
Examples of unacceptable behavior by participants include:
|
|
24
|
+
|
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
+
advances
|
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
* Public or private harassment
|
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
|
30
|
+
address, without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Our Responsibilities
|
|
35
|
+
|
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
+
response to any instances of unacceptable behavior.
|
|
39
|
+
|
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
+
threatening, offensive, or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies within all project spaces, and it also applies when
|
|
49
|
+
an individual is representing the project or its community in public spaces.
|
|
50
|
+
Examples of representing a project or community include using an official
|
|
51
|
+
project e-mail address, posting via an official social media account, or acting
|
|
52
|
+
as an appointed representative at an online or offline event. Representation of
|
|
53
|
+
a project may be further defined and clarified by project maintainers.
|
|
54
|
+
|
|
55
|
+
## Enforcement
|
|
56
|
+
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
+
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
|
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
|
63
|
+
|
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
+
members of the project's leadership.
|
|
67
|
+
|
|
68
|
+
## Attribution
|
|
69
|
+
|
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
|
72
|
+
|
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
|
74
|
+
|
|
75
|
+
For answers to common questions about this code of conduct, see
|
|
76
|
+
https://www.contributor-covenant.org/faq
|
|
77
|
+
|
data/Dockerfile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
FROM ruby:2.5.5-stretch
|
|
2
|
+
|
|
3
|
+
RUN apt-get update && \
|
|
4
|
+
apt-get -y install curl git openssh-client openssl nodejs awscli
|
|
5
|
+
RUN apt-get install -yq libpq-dev net-tools mysql-client wait-for-it
|
|
6
|
+
ENV DOCKERIZE_VERSION v0.6.1
|
|
7
|
+
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
|
|
8
|
+
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
|
|
9
|
+
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
|
|
10
|
+
|
|
11
|
+
WORKDIR /opt/deimos
|
|
12
|
+
COPY deimos.gemspec /opt/deimos/deimos.gemspec
|
|
13
|
+
COPY lib/deimos/version.rb /opt/deimos/lib/deimos/version.rb
|
|
14
|
+
COPY Gemfile /opt/deimos/Gemfile
|
|
15
|
+
COPY Gemfile.lock /opt/deimos/Gemfile.lock
|
|
16
|
+
|
|
17
|
+
RUN bundle install
|
|
18
|
+
|
|
19
|
+
ADD . .
|
|
20
|
+
|
|
21
|
+
ENTRYPOINT ["bundle", "exec"]
|
|
22
|
+
|
|
23
|
+
CMD ["bundle", "exec", "rspec"]
|