Ruby-Kafka 开源项目教程
ruby-kafkaA Ruby client library for Apache Kafka项目地址:https://gitcode.com/gh_mirrors/ru/ruby-kafka
1. 项目的目录结构及介绍
Ruby-Kafka 项目的目录结构如下:
ruby-kafka/
├── bin/
├── lib/
│ ├── kafka/
│ │ ├── async_producer.rb
│ │ ├── client.rb
│ │ ├── connection_builder.rb
│ │ ├── ...
│ ├── kafka.rb
├── spec/
├── .gitignore
├── .travis.yml
├── Gemfile
├── Gemfile.lock
├── LICENSE.txt
├── README.md
├── Rakefile
├── ruby-kafka.gemspec
目录结构介绍
bin/
: 包含可执行文件。lib/
: 包含项目的核心代码。kafka/
: 包含 Kafka 客户端的主要实现文件。kafka.rb
: 项目的入口文件。
spec/
: 包含测试文件。.gitignore
: Git 忽略文件配置。.travis.yml
: Travis CI 配置文件。Gemfile
: 依赖管理文件。Gemfile.lock
: 依赖锁定文件。LICENSE.txt
: 许可证文件。README.md
: 项目说明文档。Rakefile
: Rake 任务配置文件。ruby-kafka.gemspec
: Gem 包配置文件。
2. 项目的启动文件介绍
项目的启动文件位于 lib/kafka.rb
。这个文件是 Ruby-Kafka 库的入口点,负责加载项目的核心模块和类。
require "kafka/version"
require "kafka/client"
require "kafka/async_producer"
require "kafka/connection_builder"
require "kafka/consumer"
require "kafka/producer"
require "kafka/topic_subscriber"
require "kafka/offset_manager"
require "kafka/instrumenter"
require "kafka/logger"
require "kafka/cluster"
require "kafka/fetch_operation"
require "kafka/protocol"
require "kafka/ssl_context"
require "kafka/sasl"
require "kafka/connection"
require "kafka/compressor"
require "kafka/partitioner"
require "kafka/fetcher"
require "kafka/heartbeat"
require "kafka/metadata"
require "kafka/offset_fetch"
require "kafka/offset_commit"
require "kafka/offset_store"
require "kafka/assignment_coordinator"
require "kafka/consumer_group"
require "kafka/consumer_group_member"
require "kafka/consumer_group_protocol"
require "kafka/consumer_group_state_machine"
require "kafka/consumer_group_member_metadata"
require "kafka/consumer_group_member_assignment"
require "kafka/consumer_group_metadata"
require "kafka/consumer_group_coordinator"
require "kafka/consumer_group_member_coordinator"
require "kafka/consumer_group_member_assignment_coordinator"
require "kafka/consumer_group_member_metadata_coordinator"
require "kafka/consumer_group_member_assignment_metadata"
require "kafka/consumer_group_member_metadata_assignment"
require "kafka/consumer_group_member_assignment_metadata_coordinator"
require "kafka/consumer_group_member_metadata_assignment_coordinator"
require "kafka/consumer_group_member_assignment_metadata_assignment"
require "kafka/consumer_group_member_metadata_assignment_metadata"
require "kafka/consumer_group_member_assignment_metadata_assignment_coordinator"
require "kafka/consumer_group_member_metadata_assignment_metadata_coordinator"
require "kafka/consumer_group_member_assignment_metadata_assignment_metadata"
require "kafka/consumer_group_member_metadata_assignment_metadata_assignment"
require "kafka/consumer_group_member_assignment_metadata_assignment_metadata_coordinator"
require "kafka/consumer_group_member_metadata_assignment_metadata_assignment_coordinator"
require "kafka/consumer_group_member_assignment_metadata_assignment_metadata_assignment"
require "kafka/consumer_group_member_metadata_assignment_metadata_assignment_metadata"
require "kafka/consumer_group_member_assignment_metadata_assignment_metadata_assignment_coordinator"
require "kafka/consumer_group_member_metadata_assignment_metadata_
ruby-kafkaA Ruby client library for Apache Kafka项目地址:https://gitcode.com/gh_mirrors/ru/ruby-kafka