Skip to content

Commit

Permalink
Merge pull request #904 from danielmarbach/rename-processing-concurre…
Browse files Browse the repository at this point in the history
…ncy-backport

Rename processing concurrency backport
  • Loading branch information
michaelklishin authored Jul 8, 2020
2 parents 91e2cab + 13975a0 commit 787deac
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
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

0 comments on commit 787deac

Please sign in to comment.