-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tomasz Maruszak <[email protected]>
- Loading branch information
Showing
56 changed files
with
594 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 3 additions & 10 deletions
13
src/Samples/Sample.CircuitBreaker.HealthCheck/Consumers/AddConsumer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
namespace Sample.CircuitBreaker.HealthCheck.Consumers; | ||
|
||
public class AddConsumer : IConsumer<Add> | ||
{ | ||
private readonly ILogger<AddConsumer> _logger; | ||
|
||
public AddConsumer(ILogger<AddConsumer> logger) | ||
{ | ||
_logger = logger; | ||
} | ||
|
||
public class AddConsumer(ILogger<AddConsumer> logger) : IConsumer<Add> | ||
{ | ||
public Task OnHandle(Add message, CancellationToken cancellationToken) | ||
{ | ||
_logger.LogInformation("{A} + {B} = {C}", message.a, message.b, message.a + message.b); | ||
logger.LogInformation("{A} + {B} = {C}", message.A, message.B, message.A + message.B); | ||
return Task.CompletedTask; | ||
} | ||
} |
13 changes: 3 additions & 10 deletions
13
src/Samples/Sample.CircuitBreaker.HealthCheck/Consumers/SubtractConsumer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
namespace Sample.CircuitBreaker.HealthCheck.Consumers; | ||
|
||
public class SubtractConsumer : IConsumer<Subtract> | ||
{ | ||
private readonly ILogger<SubtractConsumer> _logger; | ||
|
||
public SubtractConsumer(ILogger<SubtractConsumer> logger) | ||
{ | ||
_logger = logger; | ||
} | ||
|
||
public class SubtractConsumer(ILogger<SubtractConsumer> logger) : IConsumer<Subtract> | ||
{ | ||
public Task OnHandle(Subtract message, CancellationToken cancellationToken) | ||
{ | ||
_logger.LogInformation("{A} - {B} = {C}", message.a, message.b, message.a - message.b); | ||
logger.LogInformation("{A} - {B} = {C}", message.A, message.B, message.A - message.B); | ||
return Task.CompletedTask; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 1 addition & 7 deletions
8
src/Samples/Sample.CircuitBreaker.HealthCheck/HealthChecks/AddRandomHealthCheck.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
namespace Sample.CircuitBreaker.HealthCheck.HealthChecks; | ||
|
||
using Microsoft.Extensions.Logging; | ||
|
||
public class AddRandomHealthCheck : RandomHealthCheck | ||
public class AddRandomHealthCheck(ILogger<AddRandomHealthCheck> logger) : RandomHealthCheck(logger) | ||
{ | ||
public AddRandomHealthCheck(ILogger<AddRandomHealthCheck> logger) | ||
: base(logger) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 1 addition & 7 deletions
8
src/Samples/Sample.CircuitBreaker.HealthCheck/HealthChecks/SubtractRandomHealthCheck.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
namespace Sample.CircuitBreaker.HealthCheck.HealthChecks; | ||
|
||
using Microsoft.Extensions.Logging; | ||
|
||
public class SubtractRandomHealthCheck : RandomHealthCheck | ||
public class SubtractRandomHealthCheck(ILogger<SubtractRandomHealthCheck> logger) : RandomHealthCheck(logger) | ||
{ | ||
public SubtractRandomHealthCheck(ILogger<SubtractRandomHealthCheck> logger) | ||
: base(logger) | ||
{ | ||
} | ||
} |
19 changes: 6 additions & 13 deletions
19
src/Samples/Sample.CircuitBreaker.HealthCheck/IntermittentMessagePublisher.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace Sample.CircuitBreaker.HealthCheck.Models; | ||
|
||
public record Add(int a, int b); | ||
public record Add(int A, int B); |
2 changes: 1 addition & 1 deletion
2
src/Samples/Sample.CircuitBreaker.HealthCheck/Models/Subtract.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace Sample.CircuitBreaker.HealthCheck.Models; | ||
|
||
public record Subtract(int a, int b); | ||
public record Subtract(int A, int B); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 3 additions & 9 deletions
12
src/SlimMessageBus.Host.AzureServiceBus/TopicSubscriptionParams.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/SlimMessageBus.Host.CircuitBreaker.HealthCheck/Config/AbstractConsumerProperties.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace SlimMessageBus.Host.CircuitBreaker.HealthCheck; | ||
|
||
static internal class AbstractConsumerProperties | ||
{ | ||
static readonly internal ProviderExtensionProperty<bool> IsPaused = new("CircuitBreaker_IsPaused"); | ||
static readonly internal ProviderExtensionProperty<List<IConsumerCircuitBreaker>?> Breakers = new("CircuitBreaker_Breakers"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/SlimMessageBus.Host.CircuitBreaker.HealthCheck/Config/ConsumerSettingsProperties.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace SlimMessageBus.Host.CircuitBreaker.HealthCheck; | ||
|
||
static internal class ConsumerSettingsProperties | ||
{ | ||
/// <summary> | ||
/// <see cref="IConsumerCircuitBreaker"/> to be used with the consumer. | ||
/// </summary> | ||
static readonly internal ProviderExtensionProperty<TypeCollection<IConsumerCircuitBreaker>> CircuitBreakerTypes = new("CircuitBreaker_CircuitBreakerTypes"); | ||
|
||
static readonly internal ProviderExtensionProperty<Dictionary<string, HealthStatus>> HealthStatusTags = new("CircuitBreaker_HealthStatusTags"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/SlimMessageBus.Host.CircuitBreaker.HealthCheck/HealthCheckCircuitBreaker.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.