RobertIndie commented on a change in pull request #48:
URL: https://github.com/apache/pulsar-dotpulsar/pull/48#discussion_r475653825



##########
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:
       The MonitorState in the PartitionedProducer will detect the producer 
that threw a failure or exception and make the PartitionedProdcer enter the 
Closed state. Then the user can invoke the Dispose method to dispose of all the 
producers inside.




----------------------------------------------------------------
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


Reply via email to