Class: Strum::Esb::Notice

Inherits:
Message
  • Object
show all
Defined in:
lib/strum/esb/notice.rb

Overview

Notice message

Constant Summary

Constants inherited from Message

Message::FROZEN_EXCHANGE_OPTIONS

Instance Attribute Summary

Attributes inherited from Message

#args, #exchange, #exchange_options, #headers, #payload, #rabbit_channel

Class Method Summary collapse

Methods inherited from Message

#extend_headers, #initialize, #prepare_publication_options, publish, #publish

Constructor Details

This class inherits a constructor from Strum::Esb::Message

Class Method Details

.call(payload, notice, resource = nil, exchange: Strum::Esb.config.notice_exchange, **opts) ⇒ Object



10
11
12
13
14
# File 'lib/strum/esb/notice.rb', line 10

def call(payload, notice, resource = nil, exchange: Strum::Esb.config.notice_exchange, **opts)
  headers = { notice: notice }
  headers[:resource] = resource if resource
  publish(headers: headers, payload: payload, exchange: exchange, **opts)
end