ispwd opened a new pull request, #1244:
URL: https://github.com/apache/rocketmq-clients/pull/1244

   ### Which Issue(s) This PR Fixes
   
   <!-- Please ensure that the related issue has already been created, and 
[link this pull request to that issue using 
keywords](<https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword>)
 to ensure automatic closure. -->
   
   Remove obsolete ParallelExtensionsExtras dependency for .NET Core / .NET 5+ 
compatibility.
   
   ### Brief Description
   
   <!-- Write a brief description for your pull request to help the maintainer 
understand the reasons behind your changes. -->
   
   **Problem:**
   The `ParallelExtensionsExtras` NuGet package was originally designed for 
**.NET Framework only** and lacks support for .NET Core / .NET 5+. This caused 
compatibility warnings and prevented the library from being used in modern .NET 
projects without fallback mode.
   
   **Solution:**
   - Removed the `ParallelExtensionsExtras` NuGet package dependency entirely
   - Replaced `LimitedConcurrencyLevelTaskScheduler` (from 
ParallelExtensionsExtras) with native .NET `SemaphoreSlim` to implement the 
same concurrency control behavior
   - The `SemaphoreSlim` is initialized with `consumptionThreadCount` to limit 
concurrent message consumers, maintaining exactly the same semantic behavior as 
the original implementation
   - No API changes - all public interfaces remain fully backward compatible
   
   **Files Changed:**
   - `ConsumeService.cs` - Changed from `TaskScheduler` to `SemaphoreSlim` for 
concurrency control
   - `PushConsumer.cs` - Updated field type and initialization
   - `FifoConsumeService.cs`, `StandardConsumeService.cs` - Updated constructor 
signatures
   - `ConsumeServiceTest.cs` - Updated tests to match new implementation
   - `rocketmq-client-csharp.csproj` - Removed `ParallelExtensionsExtras` 
package reference
   
   ### How Did You Test This Change?
   
   <!-- In order to ensure the code quality of Apache RocketMQ, we expect every 
pull request to have undergone thorough testing. -->
   
   **1. Unit Tests:** ✅ All 164 existing unit tests passed
   ```bash
   dotnet test
   # Passed! - Failed: 0, Passed: 164, Skipped: 0, Total: 164
   ```
   
   **2. Concurrency Control Verification (Real RocketMQ Server):** ✅ 
   - Deployed test against real RocketMQ server (127.0.0.1:8081)
   - Configured consumer with `consumptionThreadCount = 3`
   - Sent 20 messages with 200ms simulated consume delay
   - **Verified max observed concurrent consumers = 3**, matching the 
configured limit
   - All 20 messages successfully consumed within expected time
   - SemaphoreSlim correctly limits parallelism, matching the original 
TaskScheduler behavior
   
   **3. Backward Compatibility:** ✅ 
   - Public API remains unchanged - existing user code requires no modifications
   - Same `ConsumptionThreadCount` configuration option works exactly as before


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to