lib/advanced_sneakers_activejob/publisher.rb in advanced-sneakers-activejob-0.1.0 vs lib/advanced_sneakers_activejob/publisher.rb in advanced-sneakers-activejob-0.2.0
- old
+ new
@@ -18,11 +18,11 @@
def initialize
@mutex = Mutex.new
at_exit { wait_for_unrouted_messages_processing(timeout: WAIT_FOR_UNROUTED_MESSAGES_AT_EXIT_TIMEOUT) }
end
- def publish(message, routing_key:, headers: {}, **properties)
+ def publish(message, routing_key: nil, headers: {}, **properties)
ensure_connection!
logger.debug "Publishing <#{message}> to [#{publish_exchange.name}] with routing_key [#{routing_key}]"
params = properties.deep_symbolize_keys.merge(
@@ -33,10 +33,10 @@
)
publish_exchange.publish(message, params)
end
- def publish_delayed(message, routing_key:, delay:, headers: {}, **properties)
+ def publish_delayed(message, delay:, routing_key: nil, headers: {}, **properties)
ensure_connection!
logger.debug "Publishing <#{message}> to [#{publish_delayed_exchange.name}] with routing_key [#{routing_key}] and delay [#{delay}]"
params = properties.deep_symbolize_keys.merge(