karafka 2.5.2 → 2.5.4.rc1
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 +4 -4
- data/CHANGELOG.md +16 -0
- data/config/locales/errors.yml +14 -0
- data/karafka.gemspec +15 -4
- data/lib/active_job/queue_adapters/karafka_adapter.rb +2 -2
- data/lib/karafka/active_job/consumer.rb +2 -2
- data/lib/karafka/active_job/current_attributes.rb +2 -2
- data/lib/karafka/active_job/deserializer.rb +1 -1
- data/lib/karafka/active_job/dispatcher.rb +2 -2
- data/lib/karafka/admin/configs/resource.rb +7 -1
- data/lib/karafka/admin/consumer_groups.rb +6 -8
- data/lib/karafka/admin/contracts/replication.rb +149 -0
- data/lib/karafka/admin/replication.rb +462 -0
- data/lib/karafka/admin/topics.rb +5 -4
- data/lib/karafka/admin.rb +57 -12
- data/lib/karafka/app.rb +3 -3
- data/lib/karafka/base_consumer.rb +1 -1
- data/lib/karafka/cli/base.rb +1 -1
- data/lib/karafka/cli/console.rb +1 -1
- data/lib/karafka/cli/contracts/server.rb +1 -1
- data/lib/karafka/cli/help.rb +1 -1
- data/lib/karafka/cli/install.rb +2 -1
- data/lib/karafka/cli/server.rb +1 -1
- data/lib/karafka/cli/swarm.rb +1 -1
- data/lib/karafka/connection/client.rb +19 -18
- data/lib/karafka/connection/manager.rb +1 -0
- data/lib/karafka/connection/proxy.rb +1 -1
- data/lib/karafka/connection/rebalance_manager.rb +1 -1
- data/lib/karafka/connection/status.rb +1 -0
- data/lib/karafka/constraints.rb +1 -1
- data/lib/karafka/contracts/base.rb +1 -1
- data/lib/karafka/deserializers/payload.rb +1 -1
- data/lib/karafka/helpers/async.rb +1 -1
- data/lib/karafka/helpers/config_importer.rb +3 -3
- data/lib/karafka/helpers/multi_delegator.rb +3 -0
- data/lib/karafka/instrumentation/assignments_tracker.rb +2 -1
- data/lib/karafka/instrumentation/callbacks/error.rb +2 -2
- data/lib/karafka/instrumentation/callbacks/statistics.rb +3 -3
- data/lib/karafka/instrumentation/logger.rb +6 -6
- data/lib/karafka/instrumentation/logger_listener.rb +0 -2
- data/lib/karafka/instrumentation/monitor.rb +2 -2
- data/lib/karafka/instrumentation/vendors/appsignal/base.rb +1 -1
- data/lib/karafka/instrumentation/vendors/appsignal/metrics_listener.rb +4 -0
- data/lib/karafka/instrumentation/vendors/datadog/logger_listener.rb +32 -16
- data/lib/karafka/instrumentation/vendors/datadog/metrics_listener.rb +2 -2
- data/lib/karafka/instrumentation/vendors/kubernetes/base_listener.rb +1 -1
- data/lib/karafka/instrumentation/vendors/kubernetes/liveness_listener.rb +3 -15
- data/lib/karafka/licenser.rb +1 -1
- data/lib/karafka/messages/builders/batch_metadata.rb +1 -1
- data/lib/karafka/messages/messages.rb +32 -0
- data/lib/karafka/pro/active_job/consumer.rb +2 -2
- data/lib/karafka/pro/active_job/dispatcher.rb +3 -3
- data/lib/karafka/pro/cleaner/messages/messages.rb +1 -1
- data/lib/karafka/pro/cleaner.rb +3 -3
- data/lib/karafka/pro/cli/contracts/server.rb +1 -1
- data/lib/karafka/pro/cli/parallel_segments/base.rb +4 -3
- data/lib/karafka/pro/cli/parallel_segments/collapse.rb +1 -1
- data/lib/karafka/pro/cli/parallel_segments/distribute.rb +1 -1
- data/lib/karafka/pro/cli/parallel_segments.rb +1 -1
- data/lib/karafka/pro/connection/manager.rb +1 -2
- data/lib/karafka/pro/connection/multiplexing/listener.rb +1 -0
- data/lib/karafka/pro/contracts/base.rb +1 -1
- data/lib/karafka/pro/encryption/cipher.rb +3 -2
- data/lib/karafka/pro/encryption/contracts/config.rb +1 -1
- data/lib/karafka/pro/encryption/messages/parser.rb +1 -1
- data/lib/karafka/pro/encryption/setup/config.rb +1 -1
- data/lib/karafka/pro/iterator/tpl_builder.rb +1 -1
- data/lib/karafka/pro/iterator.rb +1 -1
- data/lib/karafka/pro/loader.rb +1 -1
- data/lib/karafka/pro/processing/coordinator.rb +1 -1
- data/lib/karafka/pro/processing/filters/base.rb +1 -0
- data/lib/karafka/pro/processing/filters/delayer.rb +1 -1
- data/lib/karafka/pro/processing/filters/expirer.rb +1 -1
- data/lib/karafka/pro/processing/filters/inline_insights_delayer.rb +1 -1
- data/lib/karafka/pro/processing/jobs/consume_non_blocking.rb +1 -1
- data/lib/karafka/pro/processing/jobs/eofed_non_blocking.rb +1 -1
- data/lib/karafka/pro/processing/jobs/periodic.rb +1 -1
- data/lib/karafka/pro/processing/jobs/revoked_non_blocking.rb +1 -1
- data/lib/karafka/pro/processing/jobs_builder.rb +1 -1
- data/lib/karafka/pro/processing/jobs_queue.rb +0 -2
- data/lib/karafka/pro/processing/offset_metadata/fetcher.rb +1 -0
- data/lib/karafka/pro/processing/partitioner.rb +1 -1
- data/lib/karafka/pro/processing/strategies/base.rb +1 -1
- data/lib/karafka/pro/processing/strategies/default.rb +2 -2
- data/lib/karafka/pro/processing/strategies/dlq/default.rb +1 -1
- data/lib/karafka/pro/processing/strategies/vp/default.rb +1 -1
- data/lib/karafka/pro/processing/strategy_selector.rb +1 -0
- data/lib/karafka/pro/processing/virtual_partitions/distributors/balanced.rb +4 -2
- data/lib/karafka/pro/processing/virtual_partitions/distributors/consistent.rb +4 -2
- data/lib/karafka/pro/recurring_tasks/consumer.rb +3 -2
- data/lib/karafka/pro/recurring_tasks/contracts/config.rb +2 -2
- data/lib/karafka/pro/recurring_tasks/contracts/task.rb +1 -1
- data/lib/karafka/pro/recurring_tasks/deserializer.rb +1 -1
- data/lib/karafka/pro/recurring_tasks/dispatcher.rb +1 -1
- data/lib/karafka/pro/recurring_tasks/executor.rb +2 -1
- data/lib/karafka/pro/recurring_tasks/schedule.rb +5 -2
- data/lib/karafka/pro/recurring_tasks/serializer.rb +6 -5
- data/lib/karafka/pro/recurring_tasks/setup/config.rb +2 -2
- data/lib/karafka/pro/recurring_tasks/task.rb +1 -1
- data/lib/karafka/pro/routing/features/dead_letter_queue/topic.rb +3 -0
- data/lib/karafka/pro/routing/features/multiplexing/subscription_groups_builder.rb +1 -1
- data/lib/karafka/pro/routing/features/multiplexing.rb +5 -5
- data/lib/karafka/pro/routing/features/offset_metadata.rb +4 -4
- data/lib/karafka/pro/routing/features/parallel_segments/builder.rb +1 -1
- data/lib/karafka/pro/routing/features/patterns/patterns.rb +1 -1
- data/lib/karafka/pro/routing/features/periodic_job/topic.rb +1 -1
- data/lib/karafka/pro/routing/features/recurring_tasks/builder.rb +1 -1
- data/lib/karafka/pro/routing/features/swarm.rb +1 -1
- data/lib/karafka/pro/routing/features/throttling/topic.rb +3 -1
- data/lib/karafka/pro/scheduled_messages/consumer.rb +1 -1
- data/lib/karafka/pro/scheduled_messages/contracts/config.rb +2 -2
- data/lib/karafka/pro/scheduled_messages/contracts/message.rb +1 -1
- data/lib/karafka/pro/scheduled_messages/daily_buffer.rb +3 -2
- data/lib/karafka/pro/scheduled_messages/day.rb +1 -0
- data/lib/karafka/pro/scheduled_messages/deserializers/headers.rb +1 -1
- data/lib/karafka/pro/scheduled_messages/deserializers/payload.rb +1 -1
- data/lib/karafka/pro/scheduled_messages/max_epoch.rb +1 -0
- data/lib/karafka/pro/scheduled_messages/proxy.rb +1 -1
- data/lib/karafka/pro/scheduled_messages/serializer.rb +3 -3
- data/lib/karafka/pro/scheduled_messages/setup/config.rb +2 -2
- data/lib/karafka/pro/scheduled_messages/state.rb +1 -0
- data/lib/karafka/pro/scheduled_messages/tracker.rb +1 -0
- data/lib/karafka/process.rb +4 -4
- data/lib/karafka/processing/executor.rb +1 -1
- data/lib/karafka/processing/inline_insights/tracker.rb +1 -0
- data/lib/karafka/processing/jobs_queue.rb +1 -1
- data/lib/karafka/processing/result.rb +1 -0
- data/lib/karafka/processing/strategies/dlq.rb +1 -1
- data/lib/karafka/processing/strategy_selector.rb +1 -0
- data/lib/karafka/routing/activity_manager.rb +1 -0
- data/lib/karafka/routing/builder.rb +3 -1
- data/lib/karafka/routing/consumer_group.rb +19 -1
- data/lib/karafka/routing/contracts/consumer_group.rb +3 -2
- data/lib/karafka/routing/contracts/topic.rb +5 -2
- data/lib/karafka/routing/features/dead_letter_queue/contracts/topic.rb +1 -1
- data/lib/karafka/routing/features/declaratives/topic.rb +5 -2
- data/lib/karafka/routing/features/deserializers/topic.rb +3 -3
- data/lib/karafka/routing/features/inline_insights.rb +5 -5
- data/lib/karafka/routing/router.rb +1 -1
- data/lib/karafka/routing/subscription_group.rb +2 -2
- data/lib/karafka/routing/subscription_groups_builder.rb +18 -2
- data/lib/karafka/routing/topic.rb +3 -3
- data/lib/karafka/server.rb +1 -1
- data/lib/karafka/setup/attributes_map.rb +4 -2
- data/lib/karafka/setup/config.rb +21 -10
- data/lib/karafka/setup/config_proxy.rb +209 -0
- data/lib/karafka/setup/contracts/config.rb +1 -1
- data/lib/karafka/swarm/liveness_listener.rb +1 -0
- data/lib/karafka/swarm/manager.rb +7 -6
- data/lib/karafka/swarm/node.rb +1 -1
- data/lib/karafka/swarm/supervisor.rb +1 -0
- data/lib/karafka/time_trackers/base.rb +1 -1
- data/lib/karafka/version.rb +1 -1
- data/lib/karafka.rb +2 -3
- metadata +8 -65
- data/.coditsu/ci.yml +0 -3
- data/.console_irbrc +0 -11
- data/.github/CODEOWNERS +0 -3
- data/.github/FUNDING.yml +0 -1
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -43
- data/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- data/.github/workflows/ci_linux_ubuntu_x86_64_gnu.yml +0 -278
- data/.github/workflows/ci_macos_arm64.yml +0 -151
- data/.github/workflows/push.yml +0 -35
- data/.github/workflows/trigger-wiki-refresh.yml +0 -30
- data/.github/workflows/verify-action-pins.yml +0 -16
- data/.gitignore +0 -69
- data/.rspec +0 -7
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/CODE_OF_CONDUCT.md +0 -46
- data/CONTRIBUTING.md +0 -32
- data/Gemfile +0 -28
- data/Gemfile.lock +0 -173
- data/Rakefile +0 -4
- data/SECURITY.md +0 -23
- data/bin/benchmarks +0 -99
- data/bin/clean_kafka +0 -43
- data/bin/create_token +0 -22
- data/bin/integrations +0 -341
- data/bin/record_rss +0 -50
- data/bin/rspecs +0 -26
- data/bin/scenario +0 -29
- data/bin/stress_many +0 -13
- data/bin/stress_one +0 -13
- data/bin/verify_kafka_warnings +0 -36
- data/bin/verify_license_integrity +0 -37
- data/bin/verify_topics_naming +0 -27
- data/bin/wait_for_kafka +0 -24
- data/docker-compose.yml +0 -25
- data/examples/payloads/avro/.gitkeep +0 -0
- data/examples/payloads/json/sample_set_01/enrollment_event.json +0 -579
- data/examples/payloads/json/sample_set_01/ingestion_event.json +0 -30
- data/examples/payloads/json/sample_set_01/transaction_event.json +0 -17
- data/examples/payloads/json/sample_set_01/user_event.json +0 -11
- data/examples/payloads/json/sample_set_02/download.json +0 -191
- data/examples/payloads/json/sample_set_03/event_type_1.json +0 -18
- data/examples/payloads/json/sample_set_03/event_type_2.json +0 -263
- data/examples/payloads/json/sample_set_03/event_type_3.json +0 -41
- data/log/.gitkeep +0 -0
- data/renovate.json +0 -21
data/.github/workflows/push.yml
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
name: Push Gem
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- v*
|
|
7
|
-
|
|
8
|
-
permissions:
|
|
9
|
-
contents: read
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
push:
|
|
13
|
-
if: github.repository_owner == 'karafka'
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
environment: deployment
|
|
16
|
-
|
|
17
|
-
permissions:
|
|
18
|
-
contents: write
|
|
19
|
-
id-token: write
|
|
20
|
-
|
|
21
|
-
steps:
|
|
22
|
-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
23
|
-
with:
|
|
24
|
-
fetch-depth: 0
|
|
25
|
-
|
|
26
|
-
- name: Set up Ruby
|
|
27
|
-
uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
|
|
28
|
-
with:
|
|
29
|
-
bundler-cache: false
|
|
30
|
-
|
|
31
|
-
- name: Bundle install
|
|
32
|
-
run: |
|
|
33
|
-
bundle install --jobs 4 --retry 3
|
|
34
|
-
|
|
35
|
-
- uses: rubygems/release-gem@1c162a739e8b4cb21a676e97b087e8268d8fc40b # v1.1.2
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
name: Trigger Wiki Refresh
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
release:
|
|
5
|
-
types: [published]
|
|
6
|
-
push:
|
|
7
|
-
branches: [master]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
trigger-wiki-refresh:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
environment: wiki-trigger
|
|
13
|
-
if: github.repository_owner == 'karafka'
|
|
14
|
-
steps:
|
|
15
|
-
- name: Trigger wiki refresh
|
|
16
|
-
uses: peter-evans/repository-dispatch@5fc4efd1a4797ddb68ffd0714a238564e4cc0e6f # v4.0.0
|
|
17
|
-
with:
|
|
18
|
-
token: ${{ secrets.WIKI_REPO_TOKEN }}
|
|
19
|
-
repository: karafka/wiki
|
|
20
|
-
event-type: sync-trigger
|
|
21
|
-
client-payload: |
|
|
22
|
-
{
|
|
23
|
-
"repository": "${{ github.repository }}",
|
|
24
|
-
"event_name": "${{ github.event_name }}",
|
|
25
|
-
"release_tag": "${{ github.event.release.tag_name || '' }}",
|
|
26
|
-
"release_name": "${{ github.event.release.name || '' }}",
|
|
27
|
-
"commit_sha": "${{ github.sha }}",
|
|
28
|
-
"commit_message": "Trigger Wiki Refresh",
|
|
29
|
-
"triggered_by": "${{ github.actor }}"
|
|
30
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
name: Verify Action Pins
|
|
2
|
-
on:
|
|
3
|
-
pull_request:
|
|
4
|
-
paths:
|
|
5
|
-
- '.github/workflows/**'
|
|
6
|
-
jobs:
|
|
7
|
-
verify_action_pins:
|
|
8
|
-
runs-on: ubuntu-latest
|
|
9
|
-
steps:
|
|
10
|
-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
11
|
-
- name: Check SHA pins
|
|
12
|
-
run: |
|
|
13
|
-
if grep -E -r "uses: .*/.*@(v[0-9]+|main|master)($|[[:space:]]|$)" --include="*.yml" --include="*.yaml" .github/workflows/ | grep -v "#"; then
|
|
14
|
-
echo "::error::Actions should use SHA pins, not tags or branch names"
|
|
15
|
-
exit 1
|
|
16
|
-
fi
|
data/.gitignore
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# bundler state
|
|
2
|
-
/.bundle
|
|
3
|
-
/vendor/bundle/
|
|
4
|
-
/vendor/ruby/
|
|
5
|
-
/ruby/
|
|
6
|
-
app.god
|
|
7
|
-
|
|
8
|
-
# minimal Rails specific artifacts
|
|
9
|
-
/.coditsu/local.yml
|
|
10
|
-
db/*.sqlite3
|
|
11
|
-
/log/development.log
|
|
12
|
-
/log/production.log
|
|
13
|
-
/log/test.log
|
|
14
|
-
/tmp/*
|
|
15
|
-
*.gem
|
|
16
|
-
*.~
|
|
17
|
-
|
|
18
|
-
# various artifacts
|
|
19
|
-
**.war
|
|
20
|
-
*.rbc
|
|
21
|
-
*.sassc
|
|
22
|
-
.byebug_history
|
|
23
|
-
.redcar/
|
|
24
|
-
.capistrano/
|
|
25
|
-
.sass-cache
|
|
26
|
-
/config/god/sidekiq.rb
|
|
27
|
-
/config/puma.rb
|
|
28
|
-
/coverage.data
|
|
29
|
-
/coverage/
|
|
30
|
-
/doc/api/
|
|
31
|
-
/doc/app/
|
|
32
|
-
/doc/yard
|
|
33
|
-
/doc/features.html
|
|
34
|
-
/doc/specs.html
|
|
35
|
-
/spec/tmp/*
|
|
36
|
-
/cache
|
|
37
|
-
/capybara*
|
|
38
|
-
/capybara-*.html
|
|
39
|
-
/gems
|
|
40
|
-
/specifications
|
|
41
|
-
rerun.txt
|
|
42
|
-
pickle-email-*.html
|
|
43
|
-
|
|
44
|
-
# If you find yourself ignoring temporary files generated by your text editor
|
|
45
|
-
# or operating system, you probably want to add a global ignore instead:
|
|
46
|
-
# git config --global core.excludesfile ~/.gitignore_global
|
|
47
|
-
#
|
|
48
|
-
# Here are some files you may want to ignore globally:
|
|
49
|
-
|
|
50
|
-
# scm revert files
|
|
51
|
-
**.orig
|
|
52
|
-
|
|
53
|
-
# Mac finder artifacts
|
|
54
|
-
.DS_Store
|
|
55
|
-
|
|
56
|
-
# Netbeans project directory
|
|
57
|
-
/nbproject
|
|
58
|
-
|
|
59
|
-
# RubyMine project files
|
|
60
|
-
.idea
|
|
61
|
-
|
|
62
|
-
# Textmate project files
|
|
63
|
-
/*.tmproj
|
|
64
|
-
|
|
65
|
-
# vim artifacts
|
|
66
|
-
**.swp
|
|
67
|
-
|
|
68
|
-
# documentation
|
|
69
|
-
.yardoc
|
data/.rspec
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
--require spec_helper
|
|
2
|
-
# Integration specs run with their one framework, not via RSpec
|
|
3
|
-
--exclude-pattern "spec/integrations/**/*_spec.rb"
|
|
4
|
-
# Do not run pro at the same time as default specs as it would cause state conflicts
|
|
5
|
-
--tag ~type:pro
|
|
6
|
-
# Do not run fork because they need to run in isolation
|
|
7
|
-
--tag ~mode:fork
|
data/.ruby-gemset
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
karafka
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.4.7
|
data/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
6
|
-
|
|
7
|
-
## Our Standards
|
|
8
|
-
|
|
9
|
-
Examples of behavior that contributes to creating a positive environment include:
|
|
10
|
-
|
|
11
|
-
* Using welcoming and inclusive language
|
|
12
|
-
* Being respectful of differing viewpoints and experiences
|
|
13
|
-
* Gracefully accepting constructive criticism
|
|
14
|
-
* Focusing on what is best for the community
|
|
15
|
-
* Showing empathy towards other community members
|
|
16
|
-
|
|
17
|
-
Examples of unacceptable behavior by participants include:
|
|
18
|
-
|
|
19
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
|
20
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
21
|
-
* Public or private harassment
|
|
22
|
-
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
|
23
|
-
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
24
|
-
|
|
25
|
-
## Our Responsibilities
|
|
26
|
-
|
|
27
|
-
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
|
28
|
-
|
|
29
|
-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
|
30
|
-
|
|
31
|
-
## Scope
|
|
32
|
-
|
|
33
|
-
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
|
34
|
-
|
|
35
|
-
## Enforcement
|
|
36
|
-
|
|
37
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at maciej@mensfeld.pl. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
|
38
|
-
|
|
39
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
|
40
|
-
|
|
41
|
-
## Attribution
|
|
42
|
-
|
|
43
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
|
44
|
-
|
|
45
|
-
[homepage]: http://contributor-covenant.org
|
|
46
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
data/CONTRIBUTING.md
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# Contributing
|
|
2
|
-
|
|
3
|
-
## Introduction
|
|
4
|
-
|
|
5
|
-
First, thank you for considering contributing to the Karafka ecosystem! It's people like you that make the open source community such a great community! 😊
|
|
6
|
-
|
|
7
|
-
We welcome any type of contribution, not only code. You can help with:
|
|
8
|
-
- **QA**: file bug reports, the more details you can give the better (e.g. screenshots with the console open)
|
|
9
|
-
- **Marketing**: writing blog posts, howto's, printing stickers, ...
|
|
10
|
-
- **Community**: presenting the project at meetups, organizing a dedicated meetup for the local community, ...
|
|
11
|
-
- **Code**: take a look at the [open issues](https://github.com/karafka/karafka/issues). Even if you can't write code, commenting on them, showing that you care about a given issue matters. It helps us triage them.
|
|
12
|
-
|
|
13
|
-
## Submitting code
|
|
14
|
-
|
|
15
|
-
Any code change should be submitted as a pull request. The description should explain what the code does and give steps to execute it. The pull request should also contain tests.
|
|
16
|
-
|
|
17
|
-
### Code review process
|
|
18
|
-
|
|
19
|
-
Each pull request must pass all the rspec specs and meet our quality requirements.
|
|
20
|
-
|
|
21
|
-
To check if everything is as it should be, we use [Coditsu](https://coditsu.io) that combines multiple linters and code analyzers for both code and documentation. Once you're done with your changes, submit a pull request.
|
|
22
|
-
|
|
23
|
-
### Contributing to Pro components
|
|
24
|
-
|
|
25
|
-
All of Karafka components are open-source. However, the `Pro` components are licenses under `LICENSE-COMM`.
|
|
26
|
-
|
|
27
|
-
By sending a pull request to the pro components, you are agreeing to transfer the copyright of your code to Maciej Mensfeld.
|
|
28
|
-
|
|
29
|
-
## Questions
|
|
30
|
-
|
|
31
|
-
If you have any questions, create an [issue](https://github.com/karafka/karafka/issues) (protip: do a quick search first to see if someone else didn't ask the same question before!).
|
|
32
|
-
You can also reach us at contact@karafka.io.
|
data/Gemfile
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
source 'https://rubygems.org'
|
|
4
|
-
|
|
5
|
-
gemspec
|
|
6
|
-
|
|
7
|
-
# Karafka gem does not require activejob, karafka-web or fugit to work
|
|
8
|
-
# They are added here because they are part of the integration suite
|
|
9
|
-
# Since some of those are only needed for some specs, they should never be required automatically
|
|
10
|
-
group :integrations, :test do
|
|
11
|
-
gem 'fugit', require: false
|
|
12
|
-
gem 'rspec', require: false
|
|
13
|
-
gem 'stringio'
|
|
14
|
-
gem 'warning'
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
group :integrations do
|
|
18
|
-
gem 'activejob', require: false
|
|
19
|
-
gem 'karafka-testing', '>= 2.5.0', require: false
|
|
20
|
-
gem 'karafka-web', '>= 0.11.1', require: false
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
group :test do
|
|
24
|
-
gem 'byebug'
|
|
25
|
-
gem 'factory_bot'
|
|
26
|
-
gem 'ostruct'
|
|
27
|
-
gem 'simplecov'
|
|
28
|
-
end
|
data/Gemfile.lock
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
karafka (2.5.2)
|
|
5
|
-
base64 (~> 0.2)
|
|
6
|
-
karafka-core (>= 2.5.6, < 2.6.0)
|
|
7
|
-
karafka-rdkafka (>= 0.22.0)
|
|
8
|
-
waterdrop (>= 2.8.9, < 3.0.0)
|
|
9
|
-
zeitwerk (~> 2.3)
|
|
10
|
-
|
|
11
|
-
GEM
|
|
12
|
-
remote: https://rubygems.org/
|
|
13
|
-
specs:
|
|
14
|
-
activejob (8.1.1)
|
|
15
|
-
activesupport (= 8.1.1)
|
|
16
|
-
globalid (>= 0.3.6)
|
|
17
|
-
activesupport (8.1.1)
|
|
18
|
-
base64
|
|
19
|
-
bigdecimal
|
|
20
|
-
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
21
|
-
connection_pool (>= 2.2.5)
|
|
22
|
-
drb
|
|
23
|
-
i18n (>= 1.6, < 2)
|
|
24
|
-
json
|
|
25
|
-
logger (>= 1.4.2)
|
|
26
|
-
minitest (>= 5.1)
|
|
27
|
-
securerandom (>= 0.3)
|
|
28
|
-
tzinfo (~> 2.0, >= 2.0.5)
|
|
29
|
-
uri (>= 0.13.1)
|
|
30
|
-
base64 (0.3.0)
|
|
31
|
-
bigdecimal (3.3.1)
|
|
32
|
-
byebug (12.0.0)
|
|
33
|
-
concurrent-ruby (1.3.5)
|
|
34
|
-
connection_pool (2.5.4)
|
|
35
|
-
diff-lcs (1.6.2)
|
|
36
|
-
docile (1.4.1)
|
|
37
|
-
drb (2.2.3)
|
|
38
|
-
erubi (1.13.1)
|
|
39
|
-
et-orbi (1.4.0)
|
|
40
|
-
tzinfo
|
|
41
|
-
factory_bot (6.5.6)
|
|
42
|
-
activesupport (>= 6.1.0)
|
|
43
|
-
ffi (1.17.2)
|
|
44
|
-
ffi (1.17.2-aarch64-linux-gnu)
|
|
45
|
-
ffi (1.17.2-aarch64-linux-musl)
|
|
46
|
-
ffi (1.17.2-arm-linux-gnu)
|
|
47
|
-
ffi (1.17.2-arm-linux-musl)
|
|
48
|
-
ffi (1.17.2-arm64-darwin)
|
|
49
|
-
ffi (1.17.2-x86-linux-gnu)
|
|
50
|
-
ffi (1.17.2-x86-linux-musl)
|
|
51
|
-
ffi (1.17.2-x86_64-darwin)
|
|
52
|
-
ffi (1.17.2-x86_64-linux-gnu)
|
|
53
|
-
ffi (1.17.2-x86_64-linux-musl)
|
|
54
|
-
fugit (1.12.1)
|
|
55
|
-
et-orbi (~> 1.4)
|
|
56
|
-
raabro (~> 1.4)
|
|
57
|
-
globalid (1.3.0)
|
|
58
|
-
activesupport (>= 6.1)
|
|
59
|
-
i18n (1.14.7)
|
|
60
|
-
concurrent-ruby (~> 1.0)
|
|
61
|
-
json (2.15.2)
|
|
62
|
-
karafka-core (2.5.7)
|
|
63
|
-
karafka-rdkafka (>= 0.20.0)
|
|
64
|
-
logger (>= 1.6.0)
|
|
65
|
-
karafka-rdkafka (0.22.2)
|
|
66
|
-
ffi (~> 1.15)
|
|
67
|
-
json (> 2.0)
|
|
68
|
-
logger
|
|
69
|
-
mini_portile2 (~> 2.6)
|
|
70
|
-
rake (> 12)
|
|
71
|
-
karafka-rdkafka (0.22.2-aarch64-linux-gnu)
|
|
72
|
-
ffi (~> 1.15)
|
|
73
|
-
json (> 2.0)
|
|
74
|
-
logger
|
|
75
|
-
mini_portile2 (~> 2.6)
|
|
76
|
-
rake (> 12)
|
|
77
|
-
karafka-rdkafka (0.22.2-arm64-darwin)
|
|
78
|
-
ffi (~> 1.15)
|
|
79
|
-
json (> 2.0)
|
|
80
|
-
logger
|
|
81
|
-
mini_portile2 (~> 2.6)
|
|
82
|
-
rake (> 12)
|
|
83
|
-
karafka-rdkafka (0.22.2-x86_64-linux-gnu)
|
|
84
|
-
ffi (~> 1.15)
|
|
85
|
-
json (> 2.0)
|
|
86
|
-
logger
|
|
87
|
-
mini_portile2 (~> 2.6)
|
|
88
|
-
rake (> 12)
|
|
89
|
-
karafka-rdkafka (0.22.2-x86_64-linux-musl)
|
|
90
|
-
ffi (~> 1.15)
|
|
91
|
-
json (> 2.0)
|
|
92
|
-
logger
|
|
93
|
-
mini_portile2 (~> 2.6)
|
|
94
|
-
rake (> 12)
|
|
95
|
-
karafka-testing (2.5.4)
|
|
96
|
-
karafka (>= 2.5.0, < 2.6.0)
|
|
97
|
-
waterdrop (>= 2.8.0)
|
|
98
|
-
karafka-web (0.11.3)
|
|
99
|
-
erubi (~> 1.4)
|
|
100
|
-
karafka (>= 2.5.0, < 2.6.0)
|
|
101
|
-
karafka-core (>= 2.5.0, < 2.6.0)
|
|
102
|
-
roda (~> 3.68, >= 3.69)
|
|
103
|
-
tilt (~> 2.0)
|
|
104
|
-
logger (1.7.0)
|
|
105
|
-
mini_portile2 (2.8.9)
|
|
106
|
-
minitest (5.26.0)
|
|
107
|
-
ostruct (0.6.3)
|
|
108
|
-
raabro (1.4.0)
|
|
109
|
-
rack (3.2.3)
|
|
110
|
-
rake (13.3.0)
|
|
111
|
-
roda (3.97.0)
|
|
112
|
-
rack
|
|
113
|
-
rspec (3.13.2)
|
|
114
|
-
rspec-core (~> 3.13.0)
|
|
115
|
-
rspec-expectations (~> 3.13.0)
|
|
116
|
-
rspec-mocks (~> 3.13.0)
|
|
117
|
-
rspec-core (3.13.6)
|
|
118
|
-
rspec-support (~> 3.13.0)
|
|
119
|
-
rspec-expectations (3.13.5)
|
|
120
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
121
|
-
rspec-support (~> 3.13.0)
|
|
122
|
-
rspec-mocks (3.13.6)
|
|
123
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
124
|
-
rspec-support (~> 3.13.0)
|
|
125
|
-
rspec-support (3.13.6)
|
|
126
|
-
securerandom (0.4.1)
|
|
127
|
-
simplecov (0.22.0)
|
|
128
|
-
docile (~> 1.1)
|
|
129
|
-
simplecov-html (~> 0.11)
|
|
130
|
-
simplecov_json_formatter (~> 0.1)
|
|
131
|
-
simplecov-html (0.13.2)
|
|
132
|
-
simplecov_json_formatter (0.1.4)
|
|
133
|
-
stringio (3.1.7)
|
|
134
|
-
tilt (2.6.1)
|
|
135
|
-
tzinfo (2.0.6)
|
|
136
|
-
concurrent-ruby (~> 1.0)
|
|
137
|
-
uri (1.0.4)
|
|
138
|
-
warning (1.5.0)
|
|
139
|
-
waterdrop (2.8.12)
|
|
140
|
-
karafka-core (>= 2.4.9, < 3.0.0)
|
|
141
|
-
karafka-rdkafka (>= 0.20.0)
|
|
142
|
-
zeitwerk (~> 2.3)
|
|
143
|
-
zeitwerk (2.7.3)
|
|
144
|
-
|
|
145
|
-
PLATFORMS
|
|
146
|
-
aarch64-linux-gnu
|
|
147
|
-
aarch64-linux-musl
|
|
148
|
-
arm-linux-gnu
|
|
149
|
-
arm-linux-musl
|
|
150
|
-
arm64-darwin
|
|
151
|
-
ruby
|
|
152
|
-
x86-linux-gnu
|
|
153
|
-
x86-linux-musl
|
|
154
|
-
x86_64-darwin
|
|
155
|
-
x86_64-linux-gnu
|
|
156
|
-
x86_64-linux-musl
|
|
157
|
-
|
|
158
|
-
DEPENDENCIES
|
|
159
|
-
activejob
|
|
160
|
-
byebug
|
|
161
|
-
factory_bot
|
|
162
|
-
fugit
|
|
163
|
-
karafka!
|
|
164
|
-
karafka-testing (>= 2.5.0)
|
|
165
|
-
karafka-web (>= 0.11.1)
|
|
166
|
-
ostruct
|
|
167
|
-
rspec
|
|
168
|
-
simplecov
|
|
169
|
-
stringio
|
|
170
|
-
warning
|
|
171
|
-
|
|
172
|
-
BUNDLED WITH
|
|
173
|
-
2.7.1
|
data/Rakefile
DELETED
data/SECURITY.md
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Security Policy
|
|
2
|
-
|
|
3
|
-
## Supported Versions
|
|
4
|
-
|
|
5
|
-
Please refer to the Karafka [EOL documentation](https://karafka.io/docs/Versions-Lifecycle-and-EOL/) page for detailed information on which versions are actively supported with security updates.
|
|
6
|
-
|
|
7
|
-
## Reporting a Vulnerability
|
|
8
|
-
|
|
9
|
-
If you have identified a potential security vulnerability in our projects, we encourage you to report it immediately. We take all reports of security issues seriously and will work diligently to address them.
|
|
10
|
-
|
|
11
|
-
To report a vulnerability, please send an email directly to contact@karafka.io.
|
|
12
|
-
|
|
13
|
-
We understand the importance of addressing security vulnerabilities promptly. You can expect a reply from us within 2 working days of your report. This initial response will confirm receipt of your report.
|
|
14
|
-
|
|
15
|
-
After acknowledging your report, we will:
|
|
16
|
-
|
|
17
|
-
- Evaluate the reported vulnerability in the context of our project.
|
|
18
|
-
- Provide you with regular updates on our progress.
|
|
19
|
-
- Upon completing our assessment, we will inform you of the outcome. This includes whether the vulnerability will be accepted or declined for further action.
|
|
20
|
-
|
|
21
|
-
Your report will be kept confidential and not disclosed to third parties without your consent, except as required by law.
|
|
22
|
-
|
|
23
|
-
We appreciate your assistance in keeping our projects and their users safe by responsibly reporting vulnerabilities. Together, we can maintain a high standard of security for our community.
|
data/bin/benchmarks
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
# Runner for running given benchmark cases
|
|
4
|
-
# Some of the cases require pre-populated data and we populate this in places that need it
|
|
5
|
-
# In other cases we generate this data in a background process, so the partitions data stream
|
|
6
|
-
# is consistent and we don't end up consuming huge batches of a single partition.
|
|
7
|
-
|
|
8
|
-
require 'open3'
|
|
9
|
-
require 'pathname'
|
|
10
|
-
|
|
11
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
12
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..'))
|
|
13
|
-
|
|
14
|
-
ROOT_PATH = Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '../')))
|
|
15
|
-
|
|
16
|
-
BENCHMARK_TOPICS = {
|
|
17
|
-
'benchmarks_00_01' => 1,
|
|
18
|
-
'benchmarks_00_05' => 5,
|
|
19
|
-
'benchmarks_01_05' => 5,
|
|
20
|
-
'benchmarks_00_10' => 10
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
# Load all the benchmarks
|
|
24
|
-
benchmarks = Dir[ROOT_PATH.join('spec/benchmarks/**/*.rb')]
|
|
25
|
-
|
|
26
|
-
# If filter is provided, apply
|
|
27
|
-
benchmarks.delete_if { |name| !name.include?(ARGV[0]) } if ARGV[0]
|
|
28
|
-
|
|
29
|
-
raise ArgumentError, "No benchmarks with filter: #{ARGV[0]}" if benchmarks.empty?
|
|
30
|
-
|
|
31
|
-
# We may skip seeding if we are running the benchmarks multiple times, then since we do not
|
|
32
|
-
# commit offsets we can skip generating more data
|
|
33
|
-
if ENV['SEED']
|
|
34
|
-
require 'spec/benchmarks_helper'
|
|
35
|
-
|
|
36
|
-
# We need to setup karafka here to have producer for data seeding
|
|
37
|
-
setup_karafka
|
|
38
|
-
|
|
39
|
-
# This takes some time but needs to run only once per benchmark session
|
|
40
|
-
puts 'Seeding benchmarks data...'
|
|
41
|
-
|
|
42
|
-
producer = Karafka::App.producer
|
|
43
|
-
|
|
44
|
-
# We make our data json compatible so we can also benchmark serialization
|
|
45
|
-
elements = Array.new(100_000) { { a: :b }.to_json }
|
|
46
|
-
|
|
47
|
-
topics = Karafka::Admin.cluster_info.topics.map { |details| details.fetch(:topic_name) }
|
|
48
|
-
|
|
49
|
-
BENCHMARK_TOPICS.each do |topic_name, partitions_count|
|
|
50
|
-
::Karafka::Admin.delete_topic(topic_name) if topics.include?(topic_name)
|
|
51
|
-
::Karafka::Admin.create_topic(topic_name, partitions_count, 1)
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# We do not populate data of benchmarks_0_10 as we use it with life-stream data only
|
|
55
|
-
%w[
|
|
56
|
-
benchmarks_00_01
|
|
57
|
-
benchmarks_00_05
|
|
58
|
-
].each do |topic_name|
|
|
59
|
-
partitions_count = topic_name.split('_').last.to_i
|
|
60
|
-
|
|
61
|
-
partitions_count.times do |partition|
|
|
62
|
-
puts "Seeding #{topic_name}:#{partition}"
|
|
63
|
-
|
|
64
|
-
elements.each_slice(10_000) do |data_slice|
|
|
65
|
-
data = data_slice.map do |data|
|
|
66
|
-
{ topic: topic_name, payload: data, partition: partition }
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
producer.buffer_many(data)
|
|
70
|
-
producer.flush_sync
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
# Selects requested benchmarks and runs them one after another
|
|
77
|
-
benchmarks.each do |benchmark_path|
|
|
78
|
-
puts "Running #{benchmark_path.gsub("#{ROOT_PATH}/spec/benchmarks/", '')}"
|
|
79
|
-
|
|
80
|
-
benchmark = "bundle exec ruby -r ./spec/benchmarks_helper.rb #{benchmark_path}"
|
|
81
|
-
|
|
82
|
-
Open3.popen3(benchmark) do |stdin, stdout, stderr, thread|
|
|
83
|
-
t1 = Thread.new do
|
|
84
|
-
while line = stdout.gets
|
|
85
|
-
puts(line)
|
|
86
|
-
end
|
|
87
|
-
rescue IOError
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
t2 = Thread.new do
|
|
91
|
-
while line = stderr.gets
|
|
92
|
-
puts(line)
|
|
93
|
-
end
|
|
94
|
-
rescue IOError
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
thread.join
|
|
98
|
-
end
|
|
99
|
-
end
|
data/bin/clean_kafka
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
# A script that removes most of the auto-generated Kafka topics with their data
|
|
4
|
-
# Useful when having long-running Kafka instance that cannot be fully nuked after running specs
|
|
5
|
-
|
|
6
|
-
# We use the same convention in other framework components (web, waterdrop), so it removes all of
|
|
7
|
-
# them as well.
|
|
8
|
-
|
|
9
|
-
require_relative '../spec/integrations_helper.rb'
|
|
10
|
-
|
|
11
|
-
setup_karafka
|
|
12
|
-
|
|
13
|
-
topics_for_removal = []
|
|
14
|
-
|
|
15
|
-
Karafka::Admin.cluster_info.topics.each do |topic|
|
|
16
|
-
topic_name = topic[:topic_name]
|
|
17
|
-
|
|
18
|
-
next unless topic_name.start_with?('it-')
|
|
19
|
-
|
|
20
|
-
topics_for_removal << topic_name
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
THREADS_COUNT = 3
|
|
24
|
-
QUEUE = SizedQueue.new(THREADS_COUNT)
|
|
25
|
-
TOPICS_TO_REMOVAL_COUNT = topics_for_removal.size
|
|
26
|
-
|
|
27
|
-
threads = Array.new(THREADS_COUNT) do
|
|
28
|
-
Thread.new do
|
|
29
|
-
while topic_name = QUEUE.pop
|
|
30
|
-
puts "Removing topic: #{topic_name} (#{topics_for_removal.count} left)"
|
|
31
|
-
Karafka::Admin.delete_topic(topic_name)
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
while topics_for_removal.size.positive?
|
|
37
|
-
topic_name = topics_for_removal.pop
|
|
38
|
-
|
|
39
|
-
QUEUE << topic_name
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
QUEUE.close
|
|
43
|
-
threads.each(&:join)
|
data/bin/create_token
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
require 'openssl'
|
|
4
|
-
require 'base64'
|
|
5
|
-
require 'json'
|
|
6
|
-
require 'date'
|
|
7
|
-
|
|
8
|
-
PRIVATE_KEY_LOCATION = File.join(Dir.home, '.ssh', 'karafka-pro', 'id_rsa')
|
|
9
|
-
|
|
10
|
-
# Name of the entity that acquires the license
|
|
11
|
-
ENTITY = ARGV[0]
|
|
12
|
-
|
|
13
|
-
raise ArgumentError, 'Entity missing' if ENTITY.nil? || ENTITY.empty?
|
|
14
|
-
|
|
15
|
-
pro_token_data = { entity: ENTITY }
|
|
16
|
-
|
|
17
|
-
# This code uses my private key to generate a new token for Karafka Pro capabilities
|
|
18
|
-
private_key = OpenSSL::PKey::RSA.new(File.read(PRIVATE_KEY_LOCATION))
|
|
19
|
-
|
|
20
|
-
bin_key = private_key.private_encrypt(pro_token_data.to_json)
|
|
21
|
-
|
|
22
|
-
puts Base64.encode64(bin_key)
|