This commit is contained in:
2021-05-17 17:18:14 +08:00
parent 175e919ca0
commit 8c95c9cf74
+8 -20
View File
@@ -29,8 +29,6 @@ use Snowflake\Snowflake;
class Producer extends Component
{
private string $_topic = '';
private Conf $conf;
private TopicConf $topicConf;
@@ -80,17 +78,6 @@ class Producer extends Component
}
/**
* @param $servers
* @return Producer
*/
public function setTopic(string $servers): static
{
$this->_topic = $servers;
return $this;
}
/**
* @param string $topic
* @param array $params
@@ -131,12 +118,14 @@ class Producer extends Component
}
/**
* @param string $toPic
* @param string|null $key
* @param array $data
* @param string|null $groupId
*/
/**
* @param string $toPic
* @param string|null $key
* @param array $data
* @param string|null $groupId
* @throws ConfigException
* @throws Exception
*/
public function batch(string $toPic, ?string $key, array $data, ?string $groupId = null)
{
$this->beforePushMessage($toPic, $groupId);
@@ -167,7 +156,6 @@ class Producer extends Component
}
$this->setGroupId($consumers['groupId']);
$this->setBrokers($consumers['brokers']);
$this->setTopic($topic);
}