Skip to content

Rename processing concurrency backport #904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion projects/RabbitMQ.Client/client/api/ConnectionFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public sealed class ConnectionFactory : ConnectionFactoryBase, IAsyncConnectionF
/// </summary>
/// <remarks>For concurrency greater than one this removes the guarantee that consumers handle messages in the order they receive them.
/// In addition to that consumers need to be thread/concurrency safe.</remarks>
public int ProcessingConcurrency { get; set; } = 1;
public int ConsumerDispatchConcurrency { get; set; } = 1;

/// <summary>The host to connect to.</summary>
public string HostName { get; set; } = "localhost";
Expand Down
6 changes: 3 additions & 3 deletions projects/RabbitMQ.Client/client/impl/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ public Connection(IConnectionFactory factory, bool insist, IFrameHandler frameHa
_factory = factory;
_frameHandler = frameHandler;

int processingConcurrency = (factory as ConnectionFactory)?.ProcessingConcurrency ?? 1;
int consumerDispatchConcurrency = (factory as ConnectionFactory)?.ConsumerDispatchConcurrency ?? 1;
if (factory is IAsyncConnectionFactory asyncConnectionFactory && asyncConnectionFactory.DispatchConsumersAsync)
{
ConsumerWorkService = new AsyncConsumerWorkService(processingConcurrency);
ConsumerWorkService = new AsyncConsumerWorkService(consumerDispatchConcurrency);
}
else
{
ConsumerWorkService = new ConsumerWorkService(processingConcurrency);
ConsumerWorkService = new ConsumerWorkService(consumerDispatchConcurrency);
}

_sessionManager = new SessionManager(this, 0);
Expand Down
2 changes: 1 addition & 1 deletion projects/Unit/APIApproval.Approve.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ namespace RabbitMQ.Client
public bool AutomaticRecoveryEnabled { get; set; }
public System.Collections.Generic.IDictionary<string, object> ClientProperties { get; set; }
public string ClientProvidedName { get; set; }
public int ConsumerDispatchConcurrency { get; set; }
public System.TimeSpan ContinuationTimeout { get; set; }
public bool DispatchConsumersAsync { get; set; }
public RabbitMQ.Client.AmqpTcpEndpoint Endpoint { get; set; }
Expand All @@ -91,7 +92,6 @@ namespace RabbitMQ.Client
public System.TimeSpan NetworkRecoveryInterval { get; set; }
public string Password { get; set; }
public int Port { get; set; }
public int ProcessingConcurrency { get; set; }
public ushort RequestedChannelMax { get; set; }
public System.TimeSpan RequestedConnectionTimeout { get; set; }
public uint RequestedFrameMax { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion projects/Unit/TestAsyncConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void TestBasicRoundtrip()
[Test]
public async Task TestBasicRoundtripConcurrent()
{
var cf = new ConnectionFactory{ DispatchConsumersAsync = true, ProcessingConcurrency = 2 };
var cf = new ConnectionFactory{ DispatchConsumersAsync = true, ConsumerDispatchConcurrency = 2 };
using(IConnection c = cf.CreateConnection())
using(IModel m = c.CreateModel())
{
Expand Down
2 changes: 1 addition & 1 deletion projects/Unit/TestConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class TestConsumer
[Test]
public async Task TestBasicRoundtripConcurrent()
{
var cf = new ConnectionFactory{ ProcessingConcurrency = 2 };
var cf = new ConnectionFactory{ ConsumerDispatchConcurrency = 2 };
using(IConnection c = cf.CreateConnection())
using(IModel m = c.CreateModel())
{
Expand Down