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

Conversation

cwjohnston
Copy link
Contributor

As documented in issue #5, clients with subscriptions defined encounter
exceptions when they attempt to process check results as check requests.

With Sensu's forthcoming native silencing implementation, each client
definition will include a subscription for "client:$CLIENT_NAME". For the
purposes of this silencing implemetation, it's not important that the client
consume check requests from this subscription, but it is important that the
subscription is present in the client definition sent via keepalive messages.

When Sensu processes call subscribe() on the transport object, they pass a
queue type. Sensu server processes subscribe with type :direct while
Sensu client processes use type :fanout. This distinction makes it possible
for us to treat client subscriptions for this transport as a no-op.

As documented in [issue SimpleFinance#5][1], clients with subscriptions defined encounter
exceptions when they attempt to process check results as check requests.

With Sensu's forthcoming [native silencing implementation][2], each client
definition will include a subscription for "client:$CLIENT_NAME". For the
purposes of this silencing implementation, it's not important that the client
consume check requests from this subscription, but it is important that the
subscription is present in the client definition sent via keepalive messages.

When Sensu processes call `subscribe()` on the transport object, they pass a
queue type. Sensu server processes subscribe with type `:direct` while
Sensu client processes use type `:fanout`. This distinction makes it possible
for us to treat client subscriptions for this transport as a no-op.

[1]: SimpleFinance#5
[2]: sensu/sensu#1328
@cwjohnston
Copy link
Contributor Author

/cc @runningman84 and @troyready due to interest registered on sensu/sensu-settings#40

@runningman84
Copy link

@cwjohnston thanks for your help here! How can I use you updated file without waiting for a gem update? Where does sensu look for files? I think about putting the snssqs.rb file using chef somewhere in the filesystem until this get released.

@troyready
Copy link

@runningman84 clone cwjohnston's fork of the gem source (specifically the branch with the fix in it), build it, and install it with the sensu_gem sensu cookbook resource.

You could just use Chef to override this one file -- a little too hacky but admittedly nice in simplicity, e.g.:

# Place updated snssqs.rb in templates folder as snssqs.rb.erb
# Update snssqs_transport_lib path per your sensu install
  snssqs_transport_lib = 'C:\opt\sensu\embedded\lib\ruby\gems\2.0.0\gems\\'\
                         'sensu-transport-snssqs-2.0.2\lib\sensu\transport\\'\
                         'snssqs.rb'
  template snssqs_transport_lib

@tomwans
Copy link
Contributor

tomwans commented Aug 4, 2016

Looks good. Thanks all for looking out for our little transport :)

btw that chef hack is nice.

@tomwans tomwans merged commit ca0a569 into SimpleFinance:master Aug 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants