A ruby gem to integration SRV-based service discovery into your application


Add this line to your application's Gemfile:

gem 'srvy'

And then execute:

$ bundle

Or install it yourself as:

$ gem install srvy


$srvy = # default configuration, using the locally configured resolver

# picks a single server by randomized with weight in the highest priority group
$srvy.get_single("") # => ""

# to get all services in the highest priority group 
$srvy.get_many("") # => ["", ""]

# get all records, including lower priority (e.g. backup) services
$srvy.get_all("") # => ["", ""]


I havent currently thought of a good api to signal to Srvy that you want to use lower priority services... currently the only way is to use get_all and pick the services out yourself.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request