Class: JetstreamBridge::Topology

Inherits:
Object
  • Object
show all
Defined in:
lib/jetstream_bridge/topology/topology.rb

Class Method Summary collapse

Class Method Details

.ensure!(jts) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/jetstream_bridge/topology/topology.rb', line 9

def self.ensure!(jts)
  cfg = JetstreamBridge.config
  subjects = [cfg.source_subject, cfg.destination_subject]
  subjects << cfg.dlq_subject if cfg.use_dlq
  Stream.ensure!(jts, cfg.stream_name, subjects)

  Logging.info(
    "Subjects ready: producer=#{cfg.source_subject}, consumer=#{cfg.destination_subject}. " \
    "Counterpart publishes on #{cfg.destination_subject} and subscribes on #{cfg.source_subject}.",
    tag: 'JetstreamBridge::Topology'
  )
end