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:

  • topic details

Returns:

  • boot or false if missing



128
129
130
# File 'lib/karafka/pro/routing/features/multiplexing/contracts/topic.rb', line 128

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

.max(data) ⇒ Integer, false

Returns max or false if missing.

Parameters:

  • topic details

Returns:

  • max or false if missing



122
123
124
# File 'lib/karafka/pro/routing/features/multiplexing/contracts/topic.rb', line 122

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

.min(data) ⇒ Integer, false

Returns min or false if missing.

Parameters:

  • topic details

Returns:

  • min or false if missing



116
117
118
# File 'lib/karafka/pro/routing/features/multiplexing/contracts/topic.rb', line 116

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