-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from zendesk/dasch-wrap-message
Wrap the rdkafka message
- Loading branch information
Showing
3 changed files
with
26 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require "forwardable" | ||
|
||
module Racecar | ||
class Message | ||
extend Forwardable | ||
|
||
def initialize(rdkafka_message) | ||
@rdkafka_message = rdkafka_message | ||
end | ||
|
||
def_delegators :@rdkafka_message, :topic, :partition, :offset, :key, :value, :headers | ||
|
||
def create_time | ||
@rdkafka_message.timestamp | ||
end | ||
|
||
def ==(other) | ||
@rdkafka_message == other.instance_variable_get(:@rdkafka_message) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters