Class: Karafka::Web::Pro::Ui::Lib::Search::Matchers::RawPayloadIncludes
- Inherits:
-
Base
- Object
- Base
- Karafka::Web::Pro::Ui::Lib::Search::Matchers::RawPayloadIncludes
- Defined in:
- lib/karafka/web/pro/ui/lib/search/matchers/raw_payload_includes.rb
Overview
Note:
It is case sensitive
Note:
Ignores encoding issues
Note:
Decompresses if zlib is used
Checks for phrase existence in the raw payload If raw payload has a zlib
header, it tries to decompress it (without de-serializing). We decompress because internal web ui topics (including errors topic) use Ruby specific zlib compression.
Instance Method Summary collapse
-
#call(message, phrase) ⇒ Boolean
Does message raw payload contain the phrase.
Methods inherited from Base
Instance Method Details
#call(message, phrase) ⇒ Boolean
Returns does message raw payload contain the phrase.
25 26 27 28 29 30 31 32 33 |
# File 'lib/karafka/web/pro/ui/lib/search/matchers/raw_payload_includes.rb', line 25 def call(, phrase) # raw payload can be nil for tombstone events return false unless .raw_payload build_matchable_payload().include?(phrase) # String matching on compressed data may fail rescue Encoding::CompatibilityError false end |