docs: function startClient(topic, share) {
    var opts = {id: 'CLIENT_' + uuid.v4().substring(0, 7)};
    if (parsed.service) {
      opts.service = parsed.service;
    } else if (!bluemixServiceLookup(opts, false)) {
      opts.service = 'amqp://localhost';
    }
  
    var checkService = false;
    if (parsed['keystore']) {
      /** the keystore to use for a TLS/SSL connection */
      opts.sslKeystore = parsed['keystore'];
      checkService = true;
    }
    if (parsed['keystore-passphrase']) {
      /** the keystore-passphrase to use for a TLS/SSL connection */
      opts.sslKeystorePassphrase = parsed['keystore-passphrase'];
      checkService = true;
    }
    if (parsed['client-certificate']) {
      /** the client-certificate to use for a TLS/SSL connection */
      opts.sslClientCertificate = parsed['client-certificate'];
      checkService = true;
    }
    if (parsed['client-key']) {
      /** the client-key to use for a TLS/SSL connection */
      opts.sslClientKey = parsed['client-key'];
      checkService = true;
    }
    if (parsed['client-key-passphrase']) {
      /** the client-key-passphrase to use for a TLS/SSL connection */
      opts.sslClientKeyPassphrase = parsed['client-key-passphrase'];
      checkService = true;
    }
    if (parsed['trust-certificate']) {
      /** the trust-certificate to use for a TLS/SSL connection */
      opts.sslTrustCertificate = parsed['trust-certificate'];
      checkService = true;
    }
    if (parsed['verify-name'] === false) {
      /**
       * Indicate not to additionally check the MQ Light server's
       * common name in the certificate matches the actual server's DNS name.
       */
      opts.sslVerifyName = false;
      checkService = true;
    }
  
    if (checkService) {
      if (parsed.service) {
        if (opts.service.indexOf('amqps', 0) !== 0) {
          console.error('*** error ***');
          console.error("The service URL must start with 'amqps://' when using " +
                        'SSL/TLS options.');
          console.error('Exiting.');
          process.exit(1);
        }
      } else {
        /** if none specified, change the default service to be amqps:// */
        opts.service = 'amqps://localhost';
      }
    }
  
    var client = mqlight.createClient(opts, function(err) {
      if (err) {
        console.error('Problem with connect: ', err.toString());
        process.exit(1);
      }
    });
  
    client.on('started', function() {
      console.log('Connected to ' + client.service + ' using id ' + client.id);
      client.subscribe(topic, share, function(err, topicPattern, share) {
        if (err) {
          console.error('Problem with subscribe request: ', err.toString());
          process.exit(1);
        }
        console.log("Receiving messages from topic pattern '" + topicPattern +
                    (share ? "' and share '" + share + "'" : "'"));
      });
  
      // Loop sending messages to randomly picked topics.  Delay for a small
      // (random) amount of time, each time around.
      var sendMessages = function() {
        var delay = Math.random() * 20000;
        var sendTopic = allTopics[Math.floor(Math.random() * allTopics.length)];
        var sendCallback = function(err, msg) {
          if (err) {
            console.error('Problem with send request: ' + err.toString());
            process.exit(0);
          } else {
            if (messageCount === 0) {
              console.log('Sending messages');
            }
            ++messageCount;
            if (messageCount % 10 === 0) {
              console.log('Sent ' + messageCount + ' messages');
            }
          }
        };
  
        setTimeout(function() {
          var start = Math.floor(Math.random() * (loremIpsumWords.length - 15));
          var end = start + 5 + Math.floor(Math.random() * 10);
          var message =
              loremIpsum.substring(loremIpsumWords[start], loremIpsumWords[end]);
          client.send(sendTopic, message, sendCallback);
          sendMessages();
        },delay);
      };
      sendMessages();
    });
  
    client.on('error', function(error) {
      console.error('*** error ***');
      if (error) {
        if (error.message) console.error('message: %s', error.toString());
        else if (error.stack) console.error(error.stack);
      }
      console.error('Exiting.');
      process.exit(1);
    });
  }