-
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
13 changed files
with
375 additions
and
4 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
src/SlimMessageBus.Host.AmazonSQS/Config/SqsConsumerBuilderExtensions.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,12 @@ | ||
namespace SlimMessageBus.Host.AmazonSQS.Config; | ||
|
||
public static class SqsConsumerBuilderExtensions | ||
{ | ||
public static ConsumerBuilder<T> Queue<T>(this ConsumerBuilder<T> consumerBuilder, string queueName) | ||
{ | ||
if (consumerBuilder is null) throw new ArgumentNullException(nameof(consumerBuilder)); | ||
if (queueName is null) throw new ArgumentNullException(nameof(queueName)); | ||
|
||
return consumerBuilder.Path(queueName); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/SlimMessageBus.Host.AmazonSQS/Config/SqsProducerBuilderExtensions.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,29 @@ | ||
namespace SlimMessageBus.Host.AmazonSQS.Config; | ||
|
||
public static class SqsProducerBuilderExtensions | ||
{ | ||
/// <summary> | ||
/// Enables FIFO support for the queue when it will be provisioned. | ||
/// </summary> | ||
/// <typeparam name="TProducerBuilder"></typeparam> | ||
/// <param name="producerBuilder"></param> | ||
/// <param name="enabled"></param> | ||
/// <returns></returns> | ||
/// <exception cref="ArgumentNullException"></exception> | ||
public static TProducerBuilder EnableFifo<TProducerBuilder>(this TProducerBuilder producerBuilder, bool enabled = true) | ||
where TProducerBuilder : IProducerBuilder | ||
{ | ||
if (producerBuilder is null) throw new ArgumentNullException(nameof(producerBuilder)); | ||
|
||
producerBuilder.Settings.Properties[SqsProperties.EnableFifoKey] = enabled; | ||
return producerBuilder; | ||
} | ||
|
||
public static ProducerBuilder<T> DefaultQueue<T>(this ProducerBuilder<T> producerBuilder, string queueName) | ||
{ | ||
if (producerBuilder is null) throw new ArgumentNullException(nameof(producerBuilder)); | ||
if (queueName is null) throw new ArgumentNullException(nameof(queueName)); | ||
|
||
return producerBuilder.DefaultPath(queueName); | ||
} | ||
} |
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,6 @@ | ||
namespace SlimMessageBus.Host.AmazonSQS.Config; | ||
|
||
internal static class SqsProperties | ||
{ | ||
public static readonly string EnableFifoKey = "Sqs_EnableFifo"; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace SlimMessageBus.Host.AmazonSQS; | ||
|
||
public class SqsTopologySettings | ||
{ | ||
/// <summary> | ||
/// Indicates whether topology provisioning is enabled. Default is true. | ||
/// </summary> | ||
public bool Enabled { get; set; } = true; | ||
/// <summary> | ||
/// A filter that allows (or not) for declared producers to provision needed queues. True by default. | ||
/// </summary> | ||
public bool CanProducerCreateQueue { get; set; } = true; | ||
/// <summary> | ||
/// A filter that allows (or not) for declared consumers to provision needed queues. True by default. | ||
/// </summary> | ||
public bool CanConsumerCreateQueue { get; set; } = true; | ||
/// <summary> | ||
/// Default configuration to be applied when a topic needs to be created (<see cref="CreateQueueRequest"/>). | ||
/// </summary> | ||
public Action<CreateQueueRequest> CreateQueueOptions { get; set; } | ||
|
||
} |
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: 12 additions & 0 deletions
12
src/Tests/SlimMessageBus.Host.AmazonSQS.Test/GlobalUsings.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,12 @@ | ||
global using FluentAssertions; | ||
|
||
global using Microsoft.Extensions.Configuration; | ||
global using Microsoft.Extensions.DependencyInjection; | ||
global using Microsoft.Extensions.Logging; | ||
|
||
global using SecretStore; | ||
|
||
global using SlimMessageBus.Host.Test.Common.IntegrationTest; | ||
|
||
global using Xunit; | ||
global using Xunit.Abstractions; |
21 changes: 21 additions & 0 deletions
21
src/Tests/SlimMessageBus.Host.AmazonSQS.Test/SlimMessageBus.Host.AmazonSQS.Test.csproj
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,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<Import Project="../Host.Test.Properties.xml" /> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\SlimMessageBus.Host.Test.Common\SlimMessageBus.Host.Test.Common.csproj" /> | ||
<ProjectReference Include="..\..\SlimMessageBus.Host.AmazonSQS\SlimMessageBus.Host.AmazonSQS.csproj" /> | ||
<ProjectReference Include="..\..\SlimMessageBus.Host.Serialization.SystemTextJson\SlimMessageBus.Host.Serialization.SystemTextJson.csproj" /> | ||
<ProjectReference Include="..\..\Tools\SecretStore\SecretStore.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="appsettings.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
<None Update="xunit.runner.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.