Class: Karafka::Web::Pro::Commanding::Matchers::SchemaVersion

Inherits:
Base
  • Object
show all
Defined in:
lib/karafka/web/pro/commanding/matchers/schema_version.rb

Overview

Matcher that checks if the message schema version matches the current dispatcher schema version. This ensures compatibility between command producers and consumers. This is a required matcher that always applies.

Instance Method Summary collapse

Methods inherited from Base

#apply?, #initialize

Constructor Details

This class inherits a constructor from Karafka::Web::Pro::Commanding::Matchers::Base

Instance Method Details

#matches?Boolean

Returns true if schema version matches.

Returns:

  • (Boolean)

    true if schema version matches



44
45
46
# File 'lib/karafka/web/pro/commanding/matchers/schema_version.rb', line 44

def matches?
  message.payload[:schema_version] == Dispatcher::SCHEMA_VERSION
end