Module: Messages
- Defined in:
- app/messages/messages.rb,
app/messages/messages/broker.rb
Overview
rabbitmq messages
Defined Under Namespace
Classes: Broker
Class Method Summary collapse
-
.publish(objects, configuration) ⇒ Object
Errors are logged and reported rather than raised so a broker outage cannot fail the request that triggered the message (same approach as Emq::PublishingJob).
Class Method Details
.publish(objects, configuration) ⇒ Object
Errors are logged and reported rather than raised so a broker outage cannot fail the request that triggered the message (same approach as Emq::PublishingJob).
7 8 9 10 11 12 13 14 |
# File 'app/messages/messages.rb', line 7 def self.publish(objects, configuration) Array(objects).each do |object| ::Broker::Handle.publish(Message::Message.new(object:, configuration:)) end rescue StandardError => e Rails.logger.error("Failed to publish message to RabbitMQ: #{e.}") ExceptionNotifier.notify_exception(e) end |