Skip to content

Commit

Permalink
feat: Add Kafka.version_info and Kafka.librdkafka_version methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ukdave committed Dec 18, 2024
1 parent 09d67c8 commit 9bbd286
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog

## [Unreleased]
### Added
- Add `Kafka.version_info` and `Kafka.librdkafka_version` methods.

### Changed
- Update `Kafka::Consumer#poll` and `Kafka::Consumer#each` to automatically raise a `Kafka::ConsumerException` if the
message is an error. Pass `raise_on_error: false` to maintain the previous behaviour.
Expand Down
8 changes: 8 additions & 0 deletions src/crafka.cr
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ module Kafka

Log = ::Log.for("crafka")

def self.version_info
"crafka v#{VERSION}, librdkafka v#{librdkafka_version}"
end

def self.librdkafka_version
String.new(LibRdKafka.version_str)
end

class KafkaException < Exception
def initialize(@err : Int32 | String); end

Expand Down

0 comments on commit 9bbd286

Please sign in to comment.