public function setTopic($topicName, $partitionId = 0)
{
$this->topic = $topicName;
$this->partition = $partitionId;
$host = $this->client->getHostByPartition($topicName, $partitionId);
$stream = $this->client->getStream($host);
$conn = $stream['stream'];
$this->encoder = new \Kafka\Protocol\Encoder($conn);
if ((int) $this->requiredAck !== 0) {
// get broker response
$this->decoder = new \Kafka\Protocol\Decoder($conn);
}
return $this;
}