Module: Karafka::Routing::Features::Declaratives::Topic
- Defined in:
- lib/karafka/routing/features/declaratives/topic.rb
Overview
Extension for managing Kafka topic configuration
Instance Method Summary collapse
-
#config(active: true, partitions: 1, replication_factor: 1, **details) ⇒ Config
Defined structure.
-
#declaratives ⇒ Config
Config details.
-
#declaratives? ⇒ true
Declaratives is always active.
-
#to_h ⇒ Hash
Topic with all its native configuration options plus declaratives settings.
Instance Method Details
#config(active: true, partitions: 1, replication_factor: 1, **details) ⇒ Config
Returns defined structure.
14 15 16 17 18 19 20 21 |
# File 'lib/karafka/routing/features/declaratives/topic.rb', line 14 def config(active: true, partitions: 1, replication_factor: 1, **details) @declaratives ||= Config.new( active: active, partitions: partitions, replication_factor: replication_factor, details: details ) end |
#declaratives ⇒ Config
Returns config details.
24 25 26 |
# File 'lib/karafka/routing/features/declaratives/topic.rb', line 24 def declaratives config end |
#declaratives? ⇒ true
Returns declaratives is always active.
29 30 31 |
# File 'lib/karafka/routing/features/declaratives/topic.rb', line 29 def declaratives? declaratives.active? end |
#to_h ⇒ Hash
Returns topic with all its native configuration options plus declaratives settings.
35 36 37 38 39 |
# File 'lib/karafka/routing/features/declaratives/topic.rb', line 35 def to_h super.merge( declaratives: declaratives.to_h ).freeze end |