You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "AmiradelBeyg (via GitHub)" <gi...@apache.org> on 2026/03/11 21:00:10 UTC

[PR] Fix producer max pending messages validation inconsistency [pulsar-dotpulsar]

AmiradelBeyg opened a new pull request, #284:
URL: https://github.com/apache/pulsar-dotpulsar/pull/284

   ## Summary
   
     `ProducerBuilder.Create()` rejects `MaxPendingMessages = 0`, but
     `PulsarClient.CreateProducer(ProducerOptions<TMessage>)` did not.
   
     This made producer creation behavior inconsistent depending on which API path was used. It also allowed an invalid
     configuration to reach the internal send queue, which could hide problems until high-volume or production usage.
   
     ## Changes
   
     - add missing `MaxPendingMessages > 0` validation in `PulsarClient.CreateProducer`
     - keep the existing builder behavior unchanged
     - add unit coverage for both producer creation paths
   
     ## Why
   
     Both producer creation APIs should enforce the same contract. Rejecting invalid configuration early is clearer and
     prevents subtle runtime issues caused by a zero-capacity pending message limit.
   
     ## Testing
   
     - added unit test for `PulsarClient.CreateProducer(ProducerOptions<TMessage>)`
     - added unit test for `ProducerBuilder.Create()`
     - ran:
   
     ```bash
     dotnet test tests/DotPulsar.Tests/DotPulsar.Tests.csproj --filter "PulsarClientProducerValidationTests|
     ProducerBuilderTests"
   
     ## Notes
   
     I did not add an integration test for MaxPendingMessages because there was no existing integration coverage for this
     option, and the bug is a validation/contract issue at the API boundary.


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix producer max pending messages validation inconsistency [pulsar-dotpulsar]

Posted by "blankensteiner (via GitHub)" <gi...@apache.org>.
blankensteiner merged PR #284:
URL: https://github.com/apache/pulsar-dotpulsar/pull/284


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix producer max pending messages validation inconsistency [pulsar-dotpulsar]

Posted by "blankensteiner (via GitHub)" <gi...@apache.org>.
blankensteiner commented on PR #284:
URL: https://github.com/apache/pulsar-dotpulsar/pull/284#issuecomment-4088445247

   Thanks! :-)


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix producer max pending messages validation inconsistency [pulsar-dotpulsar]

Posted by "AmiradelBeyg (via GitHub)" <gi...@apache.org>.
AmiradelBeyg commented on code in PR #284:
URL: https://github.com/apache/pulsar-dotpulsar/pull/284#discussion_r2955771273


##########
tests/DotPulsar.Tests/PulsarClientProducerValidationTests.cs:
##########
@@ -0,0 +1,43 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace DotPulsar.Tests;
+
+using DotPulsar.Exceptions;
+
+[Trait("Category", "Unit")]
+public sealed class PulsarClientProducerValidationTests

Review Comment:
   Done!



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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org