diff --git a/src/Producers/Producer.php b/src/Producers/Producer.php index d1414fc..fd3ae11 100644 --- a/src/Producers/Producer.php +++ b/src/Producers/Producer.php @@ -30,8 +30,6 @@ class Producer implements ProducerContract private readonly KafkaProducer $producer; private readonly Dispatcher $dispatcher; - private string $topic; - public bool $transactionInitialized = false; public function __construct( @@ -44,13 +42,6 @@ public function __construct( $this->dispatcher = App::make(Dispatcher::class); } - public function setTopic(string $topic): self - { - $this->topic = $topic; - - return $this; - } - /** Set the Kafka Configuration. */ private function setConf(array $options): Conf { @@ -72,7 +63,7 @@ public function produce(ProducerMessage $message, bool $shouldFlush = false): bo { $this->dispatcher->dispatch(new PublishingMessage($message)); - $topic = $this->producer->newTopic($message->getTopicName() ?? $this->topic); + $topic = $this->producer->newTopic($message->getTopicName()); $message = clone $message;