This library spawns a child process which communicates with the DDSL command line tool.

Just a proof of concept.


gem install ddslbg

Note that this gem spawns a Java process running a standalone jar, so a working JRE is required.


Please see the main DDSL documentation for concepts and details.

Initialize the client

require 'ddslbg'
$ddsl =

Set a list of zookeepers to use

$ddsl.zookeeper_hosts = ['localhost:2181', '']

List available services


Toggle service state

service = {
  id: {environment: 'test', serviceType: 'http', name: 'cmd-tool', version: '0.1'},
  sl: {url: 'http://localhost:4321/hi', quality: 1.0, lastUpdated: 1347398923243, ip: ''}


Get service locations

service_request = {
  'sid' => {'environment' => 'test', 'serviceType' => 'telnet', 'name' => 'telnetServer', 'version' => '0.1'},
  'cid' => {'environment' => 'Client env', 'name' => 'client name', 'version' => 'version', 'ip' => 'ip-address'}


Set local fallbacks

fallbacks = {
  'ServiceId(test,telnet,telnetServer,0.1)' => '',
  'ServiceId(test,http,BarServer,1.0)'      => ''

$ddsl.fallback_urls = fallbacks

Cleanly disconnect

Use $ddsl.disconnect! to kill off the spawned process.