Class: Karafka::Pro::Routing::Features::Multiplexing::Contracts::Topic

Inherits:
Contracts::Base
  • Object
show all
Defined in:
lib/karafka/pro/routing/features/multiplexing/contracts/topic.rb

Overview

Validates the subscription group multiplexing setup We validate it on the topic level as subscription groups are not built during the routing as they are pre-run dynamically built.

multiplexing attributes are optional since multiplexing may not be enabled

Class Method Summary collapse

Methods inherited from Contracts::Base

#validate!

Class Method Details

.boot(data) ⇒ Integer, false

Returns boot or false if missing.

Parameters:

  • data (Hash)

    topic details

Returns:

  • (Integer, false)

    boot or false if missing



104
105
106
# File 'lib/karafka/pro/routing/features/multiplexing/contracts/topic.rb', line 104

def boot(data)
  data[:subscription_group_details].fetch(:multiplexing_boot, false)
end

.max(data) ⇒ Integer, false

Returns max or false if missing.

Parameters:

  • data (Hash)

    topic details

Returns:

  • (Integer, false)

    max or false if missing



98
99
100
# File 'lib/karafka/pro/routing/features/multiplexing/contracts/topic.rb', line 98

def max(data)
  data[:subscription_group_details].fetch(:multiplexing_max, false)
end

.min(data) ⇒ Integer, false

Returns min or false if missing.

Parameters:

  • data (Hash)

    topic details

Returns:

  • (Integer, false)

    min or false if missing



92
93
94
# File 'lib/karafka/pro/routing/features/multiplexing/contracts/topic.rb', line 92

def min(data)
  data[:subscription_group_details].fetch(:multiplexing_min, false)
end