Skip to content
This repository has been archived by the owner on Nov 17, 2018. It is now read-only.

Treat fanout (client) subscriptions as a no-op #8

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/sensu/transport/snssqs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def statsd_time(stat)

# subscribe will begin "subscribing" to the consuming sqs queue.
#
# This method is intended for use by the Sensu server; fanout
# subscriptions initiated by the Sensu client process are
# treated as a no-op.
#
# What this really means is that we will start polling for
# messages from the SQS queue, and, depending on the message
# type, it will call the appropriate callback.
Expand All @@ -77,6 +81,11 @@ def statsd_time(stat)
#
# "funnel" and "type" parameters are completely ignored.
def subscribe(type, pipe, funnel = nil, options = {}, &callback)
if type == :fanout
self.logger.debug("skipping unsupported fanout subscription type=#{type}, pipe=#{pipe}, funnel=#{funnel}")
return
end

self.logger.info("subscribing to type=#{type}, pipe=#{pipe}, funnel=#{funnel}")

if pipe == KEEPALIVES_STR
Expand Down