Skip to content
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Commit 8ebf2bf

Browse files
author
Anton Vorontsov
committed
2 parents 972844e + a7c2f1e commit 8ebf2bf

File tree

17 files changed

+53
-53
lines changed

17 files changed

+53
-53
lines changed

examples/Examples.SslProducer/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ static void ConfigureServices(IServiceCollection services)
4646
var rabbitMqConfiguration = Configuration.GetSection("RabbitMq");
4747
// There are both examples of json and manual configuration.
4848
//var rabbitMqConfiguration = GetClientOptions();
49-
49+
5050
var exchangeOptions = GetExchangeOptions();
51-
51+
5252
services.AddRabbitMqClient(rabbitMqConfiguration)
5353
.AddProductionExchange("exchange.name", exchangeOptions);
5454
}

src/RabbitMQ.Client.Core.DependencyInjection/BatchMessageHandlers/BaseBatchMessageHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public abstract class BaseBatchMessageHandler : IHostedService, IDisposable
4747
readonly IRabbitMqConnectionFactory _rabbitMqConnectionFactory;
4848
readonly RabbitMqClientOptions _clientOptions;
4949
readonly ILogger<BaseBatchMessageHandler> _logger;
50-
50+
5151
bool _disposed = false;
5252

5353
protected BaseBatchMessageHandler(
@@ -142,7 +142,7 @@ public void Dispose()
142142
Dispose(true);
143143
GC.SuppressFinalize(this);
144144
}
145-
145+
146146
~BaseBatchMessageHandler()
147147
{
148148
Dispose(false);

src/RabbitMQ.Client.Core.DependencyInjection/Configuration/RabbitMqSslOption.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ public class RabbitMqSslOption
1111
/// Canonical server name.
1212
/// </summary>
1313
public string ServerName { get; set; }
14-
14+
1515
/// <summary>
1616
/// Path to the certificate.
1717
/// </summary>
1818
public string CertificatePath { get; set; }
19-
19+
2020
/// <summary>
21-
/// A passphrase for the certificate.
21+
/// A pass-phrase for the certificate.
2222
/// </summary>
2323
public string CertificatePassphrase { get; set; }
2424

2525
/// <summary>
2626
/// Flag that defines if certificate should be used.
2727
/// </summary>
2828
public bool Enabled { get; set; } = true;
29-
29+
3030
/// <summary>
3131
/// Acceptable policy errors.
3232
/// </summary>

src/RabbitMQ.Client.Core.DependencyInjection/Configuration/RabbitMqTcpEndpoint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class RabbitMqTcpEndpoint
1414
/// Tcp connection port.
1515
/// </summary>
1616
public int Port { get; set; } = 5672;
17-
17+
1818
/// <summary>
1919
/// Ssl option.
2020
/// </summary>

src/RabbitMQ.Client.Core.DependencyInjection/Exceptions/InitialConnectionException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class InitialConnectionException : Exception
1111
/// The number of retries which has been attempted.
1212
/// </summary>
1313
public int NumberOfRetries { get; set; }
14-
14+
1515
public InitialConnectionException(string message, Exception innerException) : base(message, innerException)
1616
{
1717
}

src/RabbitMQ.Client.Core.DependencyInjection/RabbitMQ.Client.Core.DependencyInjection.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.1</TargetFramework>
55
<LangVersion>latest</LangVersion>
6-
<Version>4.0.0</Version>
6+
<Version>4.1.0</Version>
77
<PackageTags>RabbitMQ</PackageTags>
88
<RepositoryUrl>https://github.com/AntonyVorontsov/RabbitMQ.Client.Core.DependencyInjection</RepositoryUrl>
99
<Company />

src/RabbitMQ.Client.Core.DependencyInjection/Services/QueueService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ void ConfigureConnectionInfrastructure(RabbitMqConnectionOptionsContainer option
346346
ConsumingChannel = ConsumingConnection.CreateModel();
347347
ConsumingChannel.CallbackException += HandleChannelCallbackException;
348348
ConsumingChannel.BasicRecoverOk += HandleChannelBasicRecoverOk;
349-
349+
350350
_consumer = _rabbitMqConnectionFactory.CreateConsumer(ConsumingChannel);
351351
}
352352
}
@@ -498,7 +498,7 @@ static Dictionary<string, object> CreateArguments(string exchangeName, string ro
498498
{ "x-message-ttl", secondsDelay * 1000 },
499499
{ "x-expires", secondsDelay * 1000 + QueueExpirationTime }
500500
};
501-
501+
502502
async Task ConsumerOnReceived(object sender, BasicDeliverEventArgs eventArgs)
503503
{
504504
await _messageHandlingService.HandleMessageReceivingEvent(eventArgs, this);

tests/RabbitMQ.Client.Core.DependencyInjection.Tests/IntegrationTests/QueueServiceTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ public class QueueServiceTests
1919
const string DefaultExchangeName = "exchange.name";
2020
const string FirstRoutingKey = "first.routing.key";
2121
const string SecondRoutingKey = "second.routing.key";
22-
22+
2323
[Fact]
2424
public async Task ShouldProperlyPublishAndConsumeMessages()
2525
{
2626
var connectionFactoryMock = new Mock<RabbitMqConnectionFactory> { CallBase = true }
2727
.As<IRabbitMqConnectionFactory>();
28-
28+
2929
AsyncEventingBasicConsumer consumer = null;
3030
connectionFactoryMock.Setup(x => x.CreateConsumer(It.IsAny<IModel>()))
3131
.Returns<IModel>(channel =>
@@ -35,7 +35,7 @@ public async Task ShouldProperlyPublishAndConsumeMessages()
3535
});
3636

3737
var callerMock = new Mock<IStubCaller>();
38-
38+
3939
var serviceCollection = new ServiceCollection();
4040
serviceCollection
4141
.AddSingleton(connectionFactoryMock.Object)
@@ -46,12 +46,12 @@ public async Task ShouldProperlyPublishAndConsumeMessages()
4646
.AddNonCyclicMessageHandlerTransient<StubNonCyclicMessageHandler>(FirstRoutingKey)
4747
.AddAsyncMessageHandlerTransient<StubAsyncMessageHandler>(SecondRoutingKey)
4848
.AddAsyncNonCyclicMessageHandlerTransient<StubAsyncNonCyclicMessageHandler>(SecondRoutingKey);
49-
49+
5050
var serviceProvider = serviceCollection.BuildServiceProvider();
5151
var queueService = serviceProvider.GetRequiredService<IQueueService>();
5252
queueService.StartConsuming();
53-
54-
var resetEvent = new AutoResetEvent(false);
53+
54+
using var resetEvent = new AutoResetEvent(false);
5555
consumer.Received += (sender, @event) =>
5656
{
5757
resetEvent.Set();
@@ -61,7 +61,7 @@ public async Task ShouldProperlyPublishAndConsumeMessages()
6161
await queueService.SendAsync(new { Message = "message" }, DefaultExchangeName, FirstRoutingKey);
6262
resetEvent.WaitOne(_globalTestsTimeout);
6363
callerMock.Verify(x => x.Call(It.IsAny<string>()), Times.Exactly(2));
64-
64+
6565
await queueService.SendAsync(new { Message = "message" }, DefaultExchangeName, SecondRoutingKey);
6666
resetEvent.WaitOne(_globalTestsTimeout);
6767
callerMock.Verify(x => x.CallAsync(It.IsAny<string>()), Times.Exactly(2));

tests/RabbitMQ.Client.Core.DependencyInjection.Tests/IntegrationTests/RabbitMqConnectionFactoryTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void ShouldProperlyRetryCreatingInitialConnection(int retries)
2222
};
2323
ExecuteUnsuccessfulConnectionCreationAndAssertResults(connectionOptions);
2424
}
25-
25+
2626
[Theory]
2727
[InlineData(1)]
2828
[InlineData(5)]
@@ -38,7 +38,7 @@ public void ShouldProperlyRetryCreatingInitialConnectionWithConnectionName(int r
3838
};
3939
ExecuteUnsuccessfulConnectionCreationAndAssertResults(connectionOptions);
4040
}
41-
41+
4242
[Theory]
4343
[InlineData(1)]
4444
[InlineData(5)]
@@ -59,7 +59,7 @@ public void ShouldProperlyRetryCreatingInitialConnectionWithTcpEndpoints(int ret
5959
};
6060
ExecuteUnsuccessfulConnectionCreationAndAssertResults(connectionOptions);
6161
}
62-
62+
6363
[Theory]
6464
[InlineData(1)]
6565
[InlineData(5)]
@@ -74,7 +74,7 @@ public void ShouldProperlyRetryCreatingInitialConnectionWithHostNames(int retrie
7474
};
7575
ExecuteUnsuccessfulConnectionCreationAndAssertResults(connectionOptions);
7676
}
77-
77+
7878
[Theory]
7979
[InlineData(1)]
8080
[InlineData(5)]
@@ -102,7 +102,7 @@ public void ShouldProperlyCreateInitialConnection()
102102
};
103103
ExecuteSuccessfulConnectionCreationAndAssertResults(connectionOptions);
104104
}
105-
105+
106106
[Fact]
107107
public void ShouldProperlyCreateInitialConnectionWithConnectionName()
108108
{
@@ -115,7 +115,7 @@ public void ShouldProperlyCreateInitialConnectionWithConnectionName()
115115
};
116116
ExecuteSuccessfulConnectionCreationAndAssertResults(connectionOptions);
117117
}
118-
118+
119119
[Fact]
120120
public void ShouldProperlyCreateInitialConnectionWithTcpEndpoints()
121121
{
@@ -133,7 +133,7 @@ public void ShouldProperlyCreateInitialConnectionWithTcpEndpoints()
133133
};
134134
ExecuteSuccessfulConnectionCreationAndAssertResults(connectionOptions);
135135
}
136-
136+
137137
[Fact]
138138
public void ShouldProperlyCreateInitialConnectionWithHostNames()
139139
{
@@ -145,7 +145,7 @@ public void ShouldProperlyCreateInitialConnectionWithHostNames()
145145
};
146146
ExecuteSuccessfulConnectionCreationAndAssertResults(connectionOptions);
147147
}
148-
148+
149149
[Fact]
150150
public void ShouldProperlyCreateInitialConnectionWithHostNamesAndNamedConnection()
151151
{
@@ -158,14 +158,14 @@ public void ShouldProperlyCreateInitialConnectionWithHostNamesAndNamedConnection
158158
};
159159
ExecuteSuccessfulConnectionCreationAndAssertResults(connectionOptions);
160160
}
161-
161+
162162
static void ExecuteUnsuccessfulConnectionCreationAndAssertResults(RabbitMqClientOptions connectionOptions)
163163
{
164164
var connectionFactory = new RabbitMqConnectionFactory();
165165
var exception = Assert.Throws<InitialConnectionException>(() => connectionFactory.CreateRabbitMqConnection(connectionOptions));
166166
Assert.Equal(connectionOptions.InitialConnectionRetries, exception.NumberOfRetries);
167167
}
168-
168+
169169
static void ExecuteSuccessfulConnectionCreationAndAssertResults(RabbitMqClientOptions connectionOptions)
170170
{
171171
var connectionFactory = new RabbitMqConnectionFactory();

tests/RabbitMQ.Client.Core.DependencyInjection.Tests/Stubs/IStubCaller.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public interface IStubCaller
1010
void Call(ReadOnlyMemory<byte> message);
1111

1212
void Call(string message);
13-
13+
1414
Task CallAsync(string message);
1515
}
1616
}

0 commit comments

Comments
 (0)