code: function(services, opts) {
    opts = opts || {
      'https': true,
    };
  
    if(!opts.hasOwnProperty('https')) {
      opts.https = true;
    }
  
    this.config = opts;
    this.topics.parent = this;
  
    if(services !== undefined) {
      var serviceNamePrefix = "messagehub";
      var serviceIndex = 0;
      var serviceName;
  
      // Search for 'messagehub' prefix.
      for(var name in services) {
        if(name.substr(0, serviceNamePrefix.length) === serviceNamePrefix) {
          serviceName = name;
        }
      }
  
      if(services[serviceName]) {
        for(var index in services[serviceName]) {
          if(services[serviceName][index].hasOwnProperty("label")
            && services[serviceName][index].label == serviceName)
          {
            serviceIndex = index;
          }
        }
  
        this.apiKey = services[serviceName][serviceIndex].credentials.api_key;
        this.url = Url.parse(services[serviceName][serviceIndex].credentials.kafka_admin_url);
        this.consumerInstances = { };
      } else {
        throw new Error(serviceNamePrefix + '* is not provided in the services environment variable. ' +
                        'Make sure you have bound the Message Hub service to your Bluemix application');
      }
    } else {
      throw new Error('Provided services environment variable is undefined!');
    }
  }
docs: Client (Constructor)
  Constructs a new Client object, provided with Bluemix VCAP_SERVICES
  and additional options used to help connect to a particular service.
  @param services  Object retrieved from process.env.VCAP_SERVICES or cfenv package.
  @param opts      Additional options used to connect to a particular service.
  Current keys:
  - isStaging (Boolean): If set to true, the constructor will look for the
  "messagehubstaging" key, rather than "messagehub".