kafka_command 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +179 -0
- data/.env +1 -0
- data/.env.test +1 -0
- data/.gitignore +41 -0
- data/.rspec +1 -0
- data/.rubocop.yml +12 -0
- data/.ruby-version +1 -0
- data/Gemfile +17 -0
- data/Gemfile.lock +194 -0
- data/LICENSE +21 -0
- data/README.md +138 -0
- data/Rakefile +34 -0
- data/app/assets/config/manifest.js +3 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/images/kafka_command/cluster_view.png +0 -0
- data/app/assets/images/kafka_command/kafka.png +0 -0
- data/app/assets/images/kafka_command/topic_view.png +0 -0
- data/app/assets/javascripts/kafka_command/application.js +14 -0
- data/app/assets/stylesheets/kafka_command/application.css +27 -0
- data/app/assets/stylesheets/kafka_command/clusters.css +8 -0
- data/app/assets/stylesheets/kafka_command/topics.css +3 -0
- data/app/channels/application_cable/channel.rb +6 -0
- data/app/channels/application_cable/connection.rb +6 -0
- data/app/controllers/kafka_command/application_controller.rb +96 -0
- data/app/controllers/kafka_command/brokers_controller.rb +26 -0
- data/app/controllers/kafka_command/clusters_controller.rb +46 -0
- data/app/controllers/kafka_command/consumer_groups_controller.rb +44 -0
- data/app/controllers/kafka_command/topics_controller.rb +187 -0
- data/app/helpers/kafka_command/application_helper.rb +29 -0
- data/app/helpers/kafka_command/consumer_group_helper.rb +13 -0
- data/app/jobs/application_job.rb +6 -0
- data/app/mailers/application_mailer.rb +8 -0
- data/app/models/kafka_command/broker.rb +47 -0
- data/app/models/kafka_command/client.rb +102 -0
- data/app/models/kafka_command/cluster.rb +172 -0
- data/app/models/kafka_command/consumer_group.rb +142 -0
- data/app/models/kafka_command/consumer_group_partition.rb +23 -0
- data/app/models/kafka_command/group_member.rb +18 -0
- data/app/models/kafka_command/partition.rb +36 -0
- data/app/models/kafka_command/topic.rb +153 -0
- data/app/views/kafka_command/brokers/index.html.erb +38 -0
- data/app/views/kafka_command/clusters/_tabs.html.erb +9 -0
- data/app/views/kafka_command/clusters/index.html.erb +54 -0
- data/app/views/kafka_command/clusters/new.html.erb +115 -0
- data/app/views/kafka_command/configuration_error.html.erb +1 -0
- data/app/views/kafka_command/consumer_groups/index.html.erb +32 -0
- data/app/views/kafka_command/consumer_groups/show.html.erb +115 -0
- data/app/views/kafka_command/shared/_alert.html.erb +13 -0
- data/app/views/kafka_command/shared/_search_bar.html.erb +31 -0
- data/app/views/kafka_command/shared/_title.html.erb +6 -0
- data/app/views/kafka_command/topics/_form_fields.html.erb +49 -0
- data/app/views/kafka_command/topics/edit.html.erb +17 -0
- data/app/views/kafka_command/topics/index.html.erb +46 -0
- data/app/views/kafka_command/topics/new.html.erb +36 -0
- data/app/views/kafka_command/topics/show.html.erb +126 -0
- data/app/views/layouts/kafka_command/application.html.erb +50 -0
- data/bin/rails +16 -0
- data/config/initializers/kafka.rb +13 -0
- data/config/initializers/kafka_command.rb +11 -0
- data/config/routes.rb +11 -0
- data/docker-compose.yml +18 -0
- data/kafka_command.gemspec +27 -0
- data/lib/assets/.keep +0 -0
- data/lib/core_extensions/kafka/broker/attr_readers.rb +11 -0
- data/lib/core_extensions/kafka/broker_pool/attr_readers.rb +11 -0
- data/lib/core_extensions/kafka/client/attr_readers.rb +11 -0
- data/lib/core_extensions/kafka/cluster/attr_readers.rb +11 -0
- data/lib/core_extensions/kafka/protocol/metadata_response/partition_metadata/attr_readers.rb +15 -0
- data/lib/kafka_command/configuration.rb +150 -0
- data/lib/kafka_command/engine.rb +11 -0
- data/lib/kafka_command/errors.rb +6 -0
- data/lib/kafka_command/version.rb +5 -0
- data/lib/kafka_command.rb +13 -0
- data/lib/tasks/.keep +0 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +4 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/jobs/application_job.rb +2 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +15 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +36 -0
- data/spec/dummy/bin/update +31 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config/application.rb +19 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +61 -0
- data/spec/dummy/config/environments/production.rb +94 -0
- data/spec/dummy/config/environments/test.rb +46 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/assets.rb +14 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/content_security_policy.rb +25 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/kafka_command.yml +18 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/puma.rb +34 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/spring.rb +6 -0
- data/spec/dummy/config/ssl/test_ca_cert +1 -0
- data/spec/dummy/config/ssl/test_client_cert +1 -0
- data/spec/dummy/config/ssl/test_client_cert_key +1 -0
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/dummy/config.ru +5 -0
- data/spec/dummy/db/schema.rb +42 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/hey.log +0 -0
- data/spec/dummy/log/test.log +2227 -0
- data/spec/dummy/package.json +5 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/examples.txt +165 -0
- data/spec/fast_helper.rb +20 -0
- data/spec/fixtures/files/kafka_command_sasl.yml +10 -0
- data/spec/fixtures/files/kafka_command_ssl.yml +10 -0
- data/spec/fixtures/files/kafka_command_ssl_file_paths.yml +11 -0
- data/spec/fixtures/files/kafka_command_staging.yml +8 -0
- data/spec/lib/kafka_command/configuration_spec.rb +311 -0
- data/spec/models/kafka_command/broker_spec.rb +83 -0
- data/spec/models/kafka_command/client_spec.rb +306 -0
- data/spec/models/kafka_command/cluster_spec.rb +163 -0
- data/spec/models/kafka_command/consumer_group_partition_spec.rb +43 -0
- data/spec/models/kafka_command/consumer_group_spec.rb +236 -0
- data/spec/models/kafka_command/partition_spec.rb +95 -0
- data/spec/models/kafka_command/topic_spec.rb +311 -0
- data/spec/rails_helper.rb +63 -0
- data/spec/requests/json/brokers_spec.rb +50 -0
- data/spec/requests/json/clusters_spec.rb +58 -0
- data/spec/requests/json/consumer_groups_spec.rb +139 -0
- data/spec/requests/json/topics_spec.rb +274 -0
- data/spec/spec_helper.rb +109 -0
- data/spec/support/factory_bot.rb +5 -0
- data/spec/support/json_helper.rb +13 -0
- data/spec/support/kafka_helper.rb +93 -0
- metadata +326 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a39a1fa497e932e30fe3d92dddccfc9f4982b89e0008f7113d464a89bf44453c
|
4
|
+
data.tar.gz: bb5fe1f4e5b050564c10e46cbeb87737c46ea730eda381a0a6e611b1df2c0c0d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1b002a49cc861c6a37c7a9c39dbe6b4a46bef1881ec7327976ee88dc03f279fe4f777f7288f71ead5fc7621bc70de64bd434c307157a1fca226a69460447e4a3
|
7
|
+
data.tar.gz: c475d5ebf6669314eea5aeb2043c0e978c0f2e4ccf05917b01e48874a43bf58fb473f9f7575e07fe50886df9f7fcfd3eb4f9b2fa0e800cdd77164fc4e6da7866
|
@@ -0,0 +1,179 @@
|
|
1
|
+
version: 2
|
2
|
+
jobs:
|
3
|
+
lint:
|
4
|
+
environment:
|
5
|
+
RAILS_ENV: test
|
6
|
+
docker:
|
7
|
+
- image: circleci/ruby:2.5.1
|
8
|
+
steps:
|
9
|
+
- checkout
|
10
|
+
- restore_cache:
|
11
|
+
key: circlev2-{{ checksum "Gemfile.lock" }}
|
12
|
+
- run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
|
13
|
+
- save_cache:
|
14
|
+
key: circlev2-{{ checksum "Gemfile.lock" }}
|
15
|
+
paths:
|
16
|
+
- vendor/bundle
|
17
|
+
- run: bundle exec rubocop
|
18
|
+
|
19
|
+
kafka-1.0:
|
20
|
+
environment:
|
21
|
+
RAILS_ENV: test
|
22
|
+
docker:
|
23
|
+
- image: circleci/ruby:2.5.1
|
24
|
+
- image: wurstmeister/zookeeper
|
25
|
+
- image: wurstmeister/kafka:2.11-1.0.2
|
26
|
+
environment:
|
27
|
+
KAFKA_ADVERTISED_HOST_NAME: localhost
|
28
|
+
KAFKA_ADVERTISED_PORT: 9092
|
29
|
+
KAFKA_PORT: 9092
|
30
|
+
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
|
31
|
+
KAFKA_DELETE_TOPIC_ENABLE: 'true'
|
32
|
+
- image: wurstmeister/kafka:2.11-1.0.2
|
33
|
+
environment:
|
34
|
+
KAFKA_ADVERTISED_HOST_NAME: localhost
|
35
|
+
KAFKA_ADVERTISED_PORT: 9093
|
36
|
+
KAFKA_PORT: 9093
|
37
|
+
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
|
38
|
+
KAFKA_DELETE_TOPIC_ENABLE: 'true'
|
39
|
+
- image: wurstmeister/kafka:2.11-1.0.2
|
40
|
+
environment:
|
41
|
+
KAFKA_ADVERTISED_HOST_NAME: localhost
|
42
|
+
KAFKA_ADVERTISED_PORT: 9094
|
43
|
+
KAFKA_PORT: 9094
|
44
|
+
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
|
45
|
+
KAFKA_DELETE_TOPIC_ENABLE: 'true'
|
46
|
+
steps:
|
47
|
+
- checkout
|
48
|
+
- restore_cache:
|
49
|
+
key: circlev2-{{ checksum "Gemfile.lock" }}
|
50
|
+
- run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
|
51
|
+
- save_cache:
|
52
|
+
key: circlev2-{{ checksum "Gemfile.lock" }}
|
53
|
+
paths:
|
54
|
+
- vendor/bundle
|
55
|
+
- run: bundle exec rspec
|
56
|
+
|
57
|
+
kafka-1.1:
|
58
|
+
environment:
|
59
|
+
RAILS_ENV: test
|
60
|
+
docker:
|
61
|
+
- image: circleci/ruby:2.5.1
|
62
|
+
- image: wurstmeister/zookeeper
|
63
|
+
- image: wurstmeister/kafka:2.11-1.1.1
|
64
|
+
environment:
|
65
|
+
KAFKA_ADVERTISED_HOST_NAME: localhost
|
66
|
+
KAFKA_ADVERTISED_PORT: 9092
|
67
|
+
KAFKA_PORT: 9092
|
68
|
+
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
|
69
|
+
KAFKA_DELETE_TOPIC_ENABLE: 'true'
|
70
|
+
- image: wurstmeister/kafka:2.11-1.1.1
|
71
|
+
environment:
|
72
|
+
KAFKA_ADVERTISED_HOST_NAME: localhost
|
73
|
+
KAFKA_ADVERTISED_PORT: 9093
|
74
|
+
KAFKA_PORT: 9093
|
75
|
+
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
|
76
|
+
KAFKA_DELETE_TOPIC_ENABLE: 'true'
|
77
|
+
- image: wurstmeister/kafka:2.11-1.1.1
|
78
|
+
environment:
|
79
|
+
KAFKA_ADVERTISED_HOST_NAME: localhost
|
80
|
+
KAFKA_ADVERTISED_PORT: 9094
|
81
|
+
KAFKA_PORT: 9094
|
82
|
+
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
|
83
|
+
KAFKA_DELETE_TOPIC_ENABLE: 'true'
|
84
|
+
steps:
|
85
|
+
- checkout
|
86
|
+
- restore_cache:
|
87
|
+
key: circlev2-{{ checksum "Gemfile.lock" }}
|
88
|
+
- run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
|
89
|
+
- save_cache:
|
90
|
+
key: circlev2-{{ checksum "Gemfile.lock" }}
|
91
|
+
paths:
|
92
|
+
- vendor/bundle
|
93
|
+
- run: bundle exec rspec
|
94
|
+
|
95
|
+
kafka-2.0:
|
96
|
+
environment:
|
97
|
+
RAILS_ENV: test
|
98
|
+
docker:
|
99
|
+
- image: circleci/ruby:2.5.1
|
100
|
+
- image: wurstmeister/zookeeper
|
101
|
+
- image: wurstmeister/kafka:2.11-2.0.1
|
102
|
+
environment:
|
103
|
+
KAFKA_ADVERTISED_HOST_NAME: localhost
|
104
|
+
KAFKA_ADVERTISED_PORT: 9092
|
105
|
+
KAFKA_PORT: 9092
|
106
|
+
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
|
107
|
+
KAFKA_DELETE_TOPIC_ENABLE: 'true'
|
108
|
+
- image: wurstmeister/kafka:2.11-2.0.1
|
109
|
+
environment:
|
110
|
+
KAFKA_ADVERTISED_HOST_NAME: localhost
|
111
|
+
KAFKA_ADVERTISED_PORT: 9093
|
112
|
+
KAFKA_PORT: 9093
|
113
|
+
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
|
114
|
+
KAFKA_DELETE_TOPIC_ENABLE: 'true'
|
115
|
+
- image: wurstmeister/kafka:2.11-2.0.1
|
116
|
+
environment:
|
117
|
+
KAFKA_ADVERTISED_HOST_NAME: localhost
|
118
|
+
KAFKA_ADVERTISED_PORT: 9094
|
119
|
+
KAFKA_PORT: 9094
|
120
|
+
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
|
121
|
+
KAFKA_DELETE_TOPIC_ENABLE: 'true'
|
122
|
+
steps:
|
123
|
+
- checkout
|
124
|
+
- restore_cache:
|
125
|
+
key: circlev2-{{ checksum "Gemfile.lock" }}
|
126
|
+
- run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
|
127
|
+
- save_cache:
|
128
|
+
key: circlev2-{{ checksum "Gemfile.lock" }}
|
129
|
+
paths:
|
130
|
+
- vendor/bundle
|
131
|
+
- run: bundle exec rspec
|
132
|
+
|
133
|
+
kafka-2.1:
|
134
|
+
environment:
|
135
|
+
RAILS_ENV: test
|
136
|
+
docker:
|
137
|
+
- image: circleci/ruby:2.5.1
|
138
|
+
- image: wurstmeister/zookeeper
|
139
|
+
- image: wurstmeister/kafka:2.12-2.1.0
|
140
|
+
environment:
|
141
|
+
KAFKA_ADVERTISED_HOST_NAME: localhost
|
142
|
+
KAFKA_ADVERTISED_PORT: 9092
|
143
|
+
KAFKA_PORT: 9092
|
144
|
+
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
|
145
|
+
KAFKA_DELETE_TOPIC_ENABLE: 'true'
|
146
|
+
- image: wurstmeister/kafka:2.12-2.1.0
|
147
|
+
environment:
|
148
|
+
KAFKA_ADVERTISED_HOST_NAME: localhost
|
149
|
+
KAFKA_ADVERTISED_PORT: 9093
|
150
|
+
KAFKA_PORT: 9093
|
151
|
+
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
|
152
|
+
KAFKA_DELETE_TOPIC_ENABLE: 'true'
|
153
|
+
- image: wurstmeister/kafka:2.12-2.1.0
|
154
|
+
environment:
|
155
|
+
KAFKA_ADVERTISED_HOST_NAME: localhost
|
156
|
+
KAFKA_ADVERTISED_PORT: 9094
|
157
|
+
KAFKA_PORT: 9094
|
158
|
+
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
|
159
|
+
KAFKA_DELETE_TOPIC_ENABLE: 'true'
|
160
|
+
steps:
|
161
|
+
- checkout
|
162
|
+
- restore_cache:
|
163
|
+
key: circlev2-{{ checksum "Gemfile.lock" }}
|
164
|
+
- run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
|
165
|
+
- save_cache:
|
166
|
+
key: circlev2-{{ checksum "Gemfile.lock" }}
|
167
|
+
paths:
|
168
|
+
- vendor/bundle
|
169
|
+
- run: bundle exec rspec
|
170
|
+
|
171
|
+
workflows:
|
172
|
+
version: 2
|
173
|
+
test:
|
174
|
+
jobs:
|
175
|
+
- lint
|
176
|
+
- kafka-1.0
|
177
|
+
- kafka-1.1
|
178
|
+
- kafka-2.0
|
179
|
+
- kafka-2.1
|
data/.env.test
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
SEED_BROKERS=localhost:9092,localhost:9093,localhost:9094
|
data/.gitignore
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
2
|
+
#
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global'
|
4
|
+
|
5
|
+
# Ignore bundler config.
|
6
|
+
/.bundle
|
7
|
+
|
8
|
+
# Ignore the default SQLite database.
|
9
|
+
/db/*.sqlite3
|
10
|
+
/db/*.sqlite3-journal
|
11
|
+
|
12
|
+
# Ignore all logfiles and tempfiles.
|
13
|
+
/log/*
|
14
|
+
/tmp/*
|
15
|
+
!/log/.keep
|
16
|
+
!/tmp/.keep
|
17
|
+
|
18
|
+
# Ignore uploaded files in development
|
19
|
+
/storage/*
|
20
|
+
|
21
|
+
/node_modules
|
22
|
+
/yarn-error.log
|
23
|
+
|
24
|
+
/public/assets
|
25
|
+
.byebug_history
|
26
|
+
|
27
|
+
# Ignore master key for decrypting credentials and more.
|
28
|
+
/config/master.key
|
29
|
+
|
30
|
+
# ignore spec examples
|
31
|
+
/spec/examples.txt
|
32
|
+
|
33
|
+
.env.local
|
34
|
+
.env.test.local
|
35
|
+
|
36
|
+
spec/dummy/db/*.sqlite3
|
37
|
+
spec/dummy/db/*.sqlite3-journal
|
38
|
+
spec/dummy/db/log/*.log
|
39
|
+
spec/dummy/log/*
|
40
|
+
spec/dummy/tmp/
|
41
|
+
spec/dummy/.sass-cache
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/.rubocop.yml
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.1
|
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
5
|
+
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
group :development, :test do
|
9
|
+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
10
|
+
gem 'dotenv-rails'
|
11
|
+
gem 'pry-rails'
|
12
|
+
gem 'pry-byebug'
|
13
|
+
gem 'rubocop-rails_config'
|
14
|
+
gem 'rubocop-rspec'
|
15
|
+
gem 'rspec-rails'
|
16
|
+
gem 'sqlite3'
|
17
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,194 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
kafka_command (0.0.1)
|
5
|
+
rails (>= 4)
|
6
|
+
rails-ujs
|
7
|
+
ruby-kafka (> 0.6.3)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
actioncable (5.2.1)
|
13
|
+
actionpack (= 5.2.1)
|
14
|
+
nio4r (~> 2.0)
|
15
|
+
websocket-driver (>= 0.6.1)
|
16
|
+
actionmailer (5.2.1)
|
17
|
+
actionpack (= 5.2.1)
|
18
|
+
actionview (= 5.2.1)
|
19
|
+
activejob (= 5.2.1)
|
20
|
+
mail (~> 2.5, >= 2.5.4)
|
21
|
+
rails-dom-testing (~> 2.0)
|
22
|
+
actionpack (5.2.1)
|
23
|
+
actionview (= 5.2.1)
|
24
|
+
activesupport (= 5.2.1)
|
25
|
+
rack (~> 2.0)
|
26
|
+
rack-test (>= 0.6.3)
|
27
|
+
rails-dom-testing (~> 2.0)
|
28
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
29
|
+
actionview (5.2.1)
|
30
|
+
activesupport (= 5.2.1)
|
31
|
+
builder (~> 3.1)
|
32
|
+
erubi (~> 1.4)
|
33
|
+
rails-dom-testing (~> 2.0)
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
35
|
+
activejob (5.2.1)
|
36
|
+
activesupport (= 5.2.1)
|
37
|
+
globalid (>= 0.3.6)
|
38
|
+
activemodel (5.2.1)
|
39
|
+
activesupport (= 5.2.1)
|
40
|
+
activerecord (5.2.1)
|
41
|
+
activemodel (= 5.2.1)
|
42
|
+
activesupport (= 5.2.1)
|
43
|
+
arel (>= 9.0)
|
44
|
+
activestorage (5.2.1)
|
45
|
+
actionpack (= 5.2.1)
|
46
|
+
activerecord (= 5.2.1)
|
47
|
+
marcel (~> 0.3.1)
|
48
|
+
activesupport (5.2.1)
|
49
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
50
|
+
i18n (>= 0.7, < 2)
|
51
|
+
minitest (~> 5.1)
|
52
|
+
tzinfo (~> 1.1)
|
53
|
+
arel (9.0.0)
|
54
|
+
ast (2.4.0)
|
55
|
+
builder (3.2.3)
|
56
|
+
byebug (10.0.2)
|
57
|
+
coderay (1.1.2)
|
58
|
+
concurrent-ruby (1.1.3)
|
59
|
+
crass (1.0.4)
|
60
|
+
diff-lcs (1.3)
|
61
|
+
digest-crc (0.4.1)
|
62
|
+
dotenv (2.5.0)
|
63
|
+
dotenv-rails (2.5.0)
|
64
|
+
dotenv (= 2.5.0)
|
65
|
+
railties (>= 3.2, < 6.0)
|
66
|
+
erubi (1.7.1)
|
67
|
+
globalid (0.4.1)
|
68
|
+
activesupport (>= 4.2.0)
|
69
|
+
i18n (1.1.1)
|
70
|
+
concurrent-ruby (~> 1.0)
|
71
|
+
jaro_winkler (1.5.1)
|
72
|
+
loofah (2.2.3)
|
73
|
+
crass (~> 1.0.2)
|
74
|
+
nokogiri (>= 1.5.9)
|
75
|
+
mail (2.7.1)
|
76
|
+
mini_mime (>= 0.1.1)
|
77
|
+
marcel (0.3.3)
|
78
|
+
mimemagic (~> 0.3.2)
|
79
|
+
method_source (0.9.2)
|
80
|
+
mimemagic (0.3.2)
|
81
|
+
mini_mime (1.0.1)
|
82
|
+
mini_portile2 (2.3.0)
|
83
|
+
minitest (5.11.3)
|
84
|
+
nio4r (2.3.1)
|
85
|
+
nokogiri (1.8.5)
|
86
|
+
mini_portile2 (~> 2.3.0)
|
87
|
+
parallel (1.12.1)
|
88
|
+
parser (2.5.3.0)
|
89
|
+
ast (~> 2.4.0)
|
90
|
+
powerpack (0.1.2)
|
91
|
+
pry (0.12.2)
|
92
|
+
coderay (~> 1.1.0)
|
93
|
+
method_source (~> 0.9.0)
|
94
|
+
pry-byebug (3.6.0)
|
95
|
+
byebug (~> 10.0)
|
96
|
+
pry (~> 0.10)
|
97
|
+
pry-rails (0.3.7)
|
98
|
+
pry (>= 0.10.4)
|
99
|
+
rack (2.0.6)
|
100
|
+
rack-test (1.1.0)
|
101
|
+
rack (>= 1.0, < 3)
|
102
|
+
rails (5.2.1)
|
103
|
+
actioncable (= 5.2.1)
|
104
|
+
actionmailer (= 5.2.1)
|
105
|
+
actionpack (= 5.2.1)
|
106
|
+
actionview (= 5.2.1)
|
107
|
+
activejob (= 5.2.1)
|
108
|
+
activemodel (= 5.2.1)
|
109
|
+
activerecord (= 5.2.1)
|
110
|
+
activestorage (= 5.2.1)
|
111
|
+
activesupport (= 5.2.1)
|
112
|
+
bundler (>= 1.3.0)
|
113
|
+
railties (= 5.2.1)
|
114
|
+
sprockets-rails (>= 2.0.0)
|
115
|
+
rails-dom-testing (2.0.3)
|
116
|
+
activesupport (>= 4.2.0)
|
117
|
+
nokogiri (>= 1.6)
|
118
|
+
rails-html-sanitizer (1.0.4)
|
119
|
+
loofah (~> 2.2, >= 2.2.2)
|
120
|
+
rails-ujs (0.1.0)
|
121
|
+
railties (>= 3.1)
|
122
|
+
railties (5.2.1)
|
123
|
+
actionpack (= 5.2.1)
|
124
|
+
activesupport (= 5.2.1)
|
125
|
+
method_source
|
126
|
+
rake (>= 0.8.7)
|
127
|
+
thor (>= 0.19.0, < 2.0)
|
128
|
+
rainbow (3.0.0)
|
129
|
+
rake (12.3.1)
|
130
|
+
rspec-core (3.8.0)
|
131
|
+
rspec-support (~> 3.8.0)
|
132
|
+
rspec-expectations (3.8.2)
|
133
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
134
|
+
rspec-support (~> 3.8.0)
|
135
|
+
rspec-mocks (3.8.0)
|
136
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
137
|
+
rspec-support (~> 3.8.0)
|
138
|
+
rspec-rails (3.8.1)
|
139
|
+
actionpack (>= 3.0)
|
140
|
+
activesupport (>= 3.0)
|
141
|
+
railties (>= 3.0)
|
142
|
+
rspec-core (~> 3.8.0)
|
143
|
+
rspec-expectations (~> 3.8.0)
|
144
|
+
rspec-mocks (~> 3.8.0)
|
145
|
+
rspec-support (~> 3.8.0)
|
146
|
+
rspec-support (3.8.0)
|
147
|
+
rubocop (0.60.0)
|
148
|
+
jaro_winkler (~> 1.5.1)
|
149
|
+
parallel (~> 1.10)
|
150
|
+
parser (>= 2.5, != 2.5.1.1)
|
151
|
+
powerpack (~> 0.1)
|
152
|
+
rainbow (>= 2.2.2, < 4.0)
|
153
|
+
ruby-progressbar (~> 1.7)
|
154
|
+
unicode-display_width (~> 1.4.0)
|
155
|
+
rubocop-rails_config (0.2.6)
|
156
|
+
railties (>= 3.0)
|
157
|
+
rubocop (~> 0.56)
|
158
|
+
rubocop-rspec (1.30.1)
|
159
|
+
rubocop (>= 0.60.0)
|
160
|
+
ruby-kafka (0.7.4)
|
161
|
+
digest-crc
|
162
|
+
ruby-progressbar (1.10.0)
|
163
|
+
sprockets (3.7.2)
|
164
|
+
concurrent-ruby (~> 1.0)
|
165
|
+
rack (> 1, < 3)
|
166
|
+
sprockets-rails (3.2.1)
|
167
|
+
actionpack (>= 4.0)
|
168
|
+
activesupport (>= 4.0)
|
169
|
+
sprockets (>= 3.0.0)
|
170
|
+
sqlite3 (1.3.13)
|
171
|
+
thor (0.20.3)
|
172
|
+
thread_safe (0.3.6)
|
173
|
+
tzinfo (1.2.5)
|
174
|
+
thread_safe (~> 0.1)
|
175
|
+
unicode-display_width (1.4.0)
|
176
|
+
websocket-driver (0.7.0)
|
177
|
+
websocket-extensions (>= 0.1.0)
|
178
|
+
websocket-extensions (0.1.3)
|
179
|
+
|
180
|
+
PLATFORMS
|
181
|
+
ruby
|
182
|
+
|
183
|
+
DEPENDENCIES
|
184
|
+
dotenv-rails
|
185
|
+
kafka_command!
|
186
|
+
pry-byebug
|
187
|
+
pry-rails
|
188
|
+
rspec-rails
|
189
|
+
rubocop-rails_config
|
190
|
+
rubocop-rspec
|
191
|
+
sqlite3
|
192
|
+
|
193
|
+
BUNDLED WITH
|
194
|
+
1.16.1
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2018 Jason Dougherty
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
# Kafka Command
|
2
|
+
A simple Kafka management UI designed for use with Rails.
|
3
|
+
|
4
|
+
[![CircleCI](https://circleci.com/gh/jasondoc3/kafka_command.svg?style=svg&circle-token=b30f42578f9568fefa4f28f6d8ecb590feed4ac2)](https://circleci.com/gh/jasondoc3/kafka_command)
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile
|
9
|
+
|
10
|
+
```rb
|
11
|
+
gem 'kafka_command'
|
12
|
+
```
|
13
|
+
|
14
|
+
## Compatibility
|
15
|
+
|
16
|
+
### Rails
|
17
|
+
|
18
|
+
Designed for Rails 5. Should work with Rails 4.
|
19
|
+
|
20
|
+
### Kafka
|
21
|
+
|
22
|
+
Fully compatible with Kafka versions `1.0`, `1.1`, `2.0`, and `2.1`. Limited functionality for `0.11`.
|
23
|
+
|
24
|
+
### ruby-kafka
|
25
|
+
|
26
|
+
Requires `ruby-kafka` version `> 0.6.3`
|
27
|
+
|
28
|
+
## Screenshots
|
29
|
+
|
30
|
+
### Cluster View
|
31
|
+
![cluster](/app/assets/images/kafka_command/cluster_view.png)
|
32
|
+
|
33
|
+
### Topics View
|
34
|
+
![topic](/app/assets/images/kafka_command/topic_view.png)
|
35
|
+
|
36
|
+
## Usage
|
37
|
+
|
38
|
+
Mount KafkaCommand inside your application's `config/routes.rb` file. Make sure it is configured.
|
39
|
+
|
40
|
+
```rb
|
41
|
+
Rails.application.routes.draw do
|
42
|
+
mount KafkaCommand::Engine, at: '/kafka'
|
43
|
+
end
|
44
|
+
```
|
45
|
+
|
46
|
+
KafkaCommand can manage multiple clusters.
|
47
|
+
|
48
|
+
It provides the ability to:
|
49
|
+
|
50
|
+
* List topics
|
51
|
+
* Show topic metadata
|
52
|
+
* Replication factor
|
53
|
+
* Partitions
|
54
|
+
* Offsets
|
55
|
+
* List consumer groups
|
56
|
+
* Show consumer group metadata
|
57
|
+
* Offsets
|
58
|
+
* Members
|
59
|
+
* Lag
|
60
|
+
* List brokers
|
61
|
+
* Create Topics
|
62
|
+
* Alter topics
|
63
|
+
* Add partitions (Not supported on Kafka 0.11)
|
64
|
+
* Edit basic topic configurations
|
65
|
+
* Delete topics
|
66
|
+
|
67
|
+
This project is in an early state, and more functionality is planned for future releases.
|
68
|
+
|
69
|
+
## Configuration
|
70
|
+
Add `kafka_command.yml` to your application's config directory. Kafka command can be configured with multiple Rails environments.
|
71
|
+
|
72
|
+
```yaml
|
73
|
+
development: # Rails environment
|
74
|
+
clusters:
|
75
|
+
my_cluster: # Cluster name
|
76
|
+
description: 'Development Cluster'
|
77
|
+
version: 1.0
|
78
|
+
seed_brokers:
|
79
|
+
- localhost:9092
|
80
|
+
my_other_cluster:
|
81
|
+
description: 'Development Cluster'
|
82
|
+
version: 2.0
|
83
|
+
seed_brokers:
|
84
|
+
- localhost:9092
|
85
|
+
production:
|
86
|
+
clusters:
|
87
|
+
prod:
|
88
|
+
version: 1.1
|
89
|
+
description: 'Production Cluster'
|
90
|
+
seed_brokers: kafka1:9092,kafka2:9093 # Alternate seed brokers configuration
|
91
|
+
secondary:
|
92
|
+
version: 1.1
|
93
|
+
description: 'Secondary Cluster'
|
94
|
+
seed_brokers: <%= ENV['SEED_BROKERS'] %>
|
95
|
+
```
|
96
|
+
|
97
|
+
### Cluster configuration options
|
98
|
+
|
99
|
+
Below is a list of available options for each cluster.
|
100
|
+
|
101
|
+
#### Required
|
102
|
+
|
103
|
+
* `seed_brokers`
|
104
|
+
|
105
|
+
#### Optional
|
106
|
+
* `version`
|
107
|
+
* `description`
|
108
|
+
* `socket_timeout`
|
109
|
+
* `connect_timeout`
|
110
|
+
|
111
|
+
#### SSL Authentication
|
112
|
+
* `ssl_ca_cert` - Required if client cert and key are present.
|
113
|
+
* `ssl_ca_cert_file_path` - Alternative to ca cert option.
|
114
|
+
* `ssl_client_cert` - Required if client cert key is present.
|
115
|
+
* `ssl_client_cert_file_path` - Alternative to client cert option.
|
116
|
+
* `ssl_client_cert_key` - Required if client cert is present.
|
117
|
+
* `ssl_client_cert_key_file_path` - Alternative to client cert key option.
|
118
|
+
|
119
|
+
#### SASL Authentication
|
120
|
+
* `sasl_scram_username`
|
121
|
+
* `sasl_scram_password`
|
122
|
+
|
123
|
+
## Development
|
124
|
+
|
125
|
+
### Testing
|
126
|
+
To run the specs, set the `SEED_BROKERS` environment variable. The specs will only run if connected to a Kafka Broker.
|
127
|
+
|
128
|
+
```
|
129
|
+
SEED_BROKERS=localhost:9092 bundle exec rspec
|
130
|
+
```
|
131
|
+
|
132
|
+
### Contributing
|
133
|
+
Everyone is encouraged to help improve this project. Here are a few ways you can help:
|
134
|
+
|
135
|
+
- Report bugs
|
136
|
+
- Fix bugs and submit pull requests
|
137
|
+
- Write, clarify, or fix documentation
|
138
|
+
- Suggest or add new features
|
data/Rakefile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'bundler/setup'
|
5
|
+
rescue LoadError
|
6
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'rdoc/task'
|
10
|
+
|
11
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
12
|
+
rdoc.rdoc_dir = 'rdoc'
|
13
|
+
rdoc.title = 'KafkaCommand'
|
14
|
+
rdoc.options << '--line-numbers'
|
15
|
+
rdoc.rdoc_files.include('README.md')
|
16
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
17
|
+
end
|
18
|
+
|
19
|
+
APP_RAKEFILE = File.expand_path('spec/dummy/Rakefile', __dir__)
|
20
|
+
load 'rails/tasks/engine.rake'
|
21
|
+
|
22
|
+
load 'rails/tasks/statistics.rake'
|
23
|
+
|
24
|
+
require 'bundler/gem_tasks'
|
25
|
+
|
26
|
+
require 'rake/testtask'
|
27
|
+
|
28
|
+
Rake::TestTask.new(:test) do |t|
|
29
|
+
t.libs << 'test'
|
30
|
+
t.pattern = 'test/**/*_test.rb'
|
31
|
+
t.verbose = false
|
32
|
+
end
|
33
|
+
|
34
|
+
task default: :test
|
File without changes
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,14 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
|
5
|
+
// vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require rails-ujs
|
14
|
+
//= require_tree .
|