lib/smart_que/publisher.rb in smart-que-0.2.4 vs lib/smart_que/publisher.rb in smart-que-0.2.5
- old
+ new
@@ -41,14 +41,20 @@
end
# multicast message to queues based on topic subscription
def multicast(topic, payload = {})
- x_topic.publish(
- payload.to_json,
- routing_key: dot_formatted(topic)
- )
- log_message("multicast status: success, Topic : #{topic}, Content : #{payload}")
+ begin
+ x_topic.publish(
+ payload.to_json,
+ routing_key: dot_formatted(topic)
+ )
+ log_message("multicast status: success, Topic : #{topic}, Content : #{payload}")
+ :success
+ rescue => ex
+ log("#{ex.message}")
+ :error
+ end
end
# broadcast message to queues based on topic subscription
def broadcast(payload = {})
x_fanout.publish(
\ No newline at end of file