usaguerrilla commented on a change in pull request #48: URL: https://github.com/apache/pulsar-dotpulsar/pull/48#discussion_r474289181
########## File path: src/DotPulsar/PulsarClient.cs ########## @@ -53,6 +60,30 @@ public static IPulsarClientBuilder Builder() public IProducer CreateProducer(ProducerOptions options) { ThrowIfDisposed(); + var partitionedTopicMetadata = GetPartitionTopicMetadata(options.Topic).Result; + if (partitionedTopicMetadata.Partitions > 0) + { + var stateManager = new StateManager<ProducerState>(ProducerState.Disconnected, ProducerState.Closed, ProducerState.Faulted); + var producers = new ConcurrentDictionary<int, IProducer>(); Review comment: also it might be a good idea to dispose of all the producers in case of a failure / exception ```var producers = new ConcurrentDictionary<int, IProducer>();``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org