Exemplo n.º 1
0
 /**
  * Get Kafka by Broker Id.
  *
  * @param String $brokerId
  *
  * @return Kafka
  */
 private function getKafkaByBrokerId($brokerId)
 {
     // check if it exists, and if it doesn't, create it
     if (!isset($this->brokerList[$brokerId])) {
         $broker = $this->metadata->getBrokerInfo($brokerId);
         // instantiate the kafka broker representation
         $kafka = new Kafka($broker['host'], $broker['port']);
         // add the kafka bronker to the list
         $this->brokerList[$brokerId] = $kafka;
     }
     return $this->brokerList[$brokerId];
 }