Skip to content
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

Improve support to AWS SQS/SNS #3437

Merged
merged 27 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1ddd758
GH-1294 Add support to FIFO
lillo42 Dec 22, 2024
582d57c
GH-1294 fixes build
lillo42 Dec 22, 2024
c9e3033
GH-1294 Add Fifo test
lillo42 Dec 29, 2024
7a188b5
Merge with master
lillo42 Dec 30, 2024
ab9d3e9
GH-1294 fixes unit test
lillo42 Dec 30, 2024
c9b7e83
GH-1294 Improve support to LocalStack
lillo42 Dec 30, 2024
c94003e
GH-1294 Use AwsFactory
lillo42 Dec 31, 2024
9226568
Merge branch 'master' into GH-1294.add.aws.fifo
lillo42 Dec 31, 2024
849d21f
Merge branch 'master' into GH-1294.add.aws.fifo
lillo42 Dec 31, 2024
c9b3f7c
Merge branch 'master' into GH-1294.add.aws.fifo
lillo42 Jan 2, 2025
85db988
GH-1294 Fixes the majority of test, improve support to localstack and…
lillo42 Jan 2, 2025
e449da8
GH-1294 Fixes http test
lillo42 Jan 2, 2025
527e14a
Add Fifo test
lillo42 Jan 2, 2025
0cfb765
Merge with master
lillo42 Jan 2, 2025
11ffdef
GH-1294 fixes DLQ, Get System Attribute & Unit tests
lillo42 Jan 3, 2025
75f431b
GH-1294 Improve Valid SQS/SNS name logic
lillo42 Jan 3, 2025
58a701e
GH-1294 Improve Valid SQS/SNS name logic
lillo42 Jan 3, 2025
4299f90
Add support to SQS Publication and add FIFO tests
lillo42 Jan 3, 2025
e849a3f
Fixes SQS unit tests
lillo42 Jan 4, 2025
5abb8d6
GH-1294 Add Fifo sample
lillo42 Jan 4, 2025
3f02f03
Improvements
lillo42 Jan 5, 2025
7a868d7
Rename ChannelType
lillo42 Jan 6, 2025
acbf666
Merge with master
lillo42 Jan 6, 2025
9d619e4
Set max delay
lillo42 Jan 6, 2025
2c914eb
Merge with master
lillo42 Jan 6, 2025
c0bb2a4
Merge with master
lillo42 Jan 8, 2025
fa869ea
Merge with master
lillo42 Jan 15, 2025
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
15 changes: 15 additions & 0 deletions docker-compose-localstack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3'

services:
localstack:
image: localstack/localstack
environment:
# LocalStack configuration: https://docs.localstack.cloud/references/configuration/
- "SERVICES=s3,sqs,sns,sts,dynamodb"
- "DEFAULT_REGION=eu-west-1"
- "DEBUG=1"
ports:
- "4566:4566" # LocalStack Gateway
- "4510-4559:4510-4559" # External services port range
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
57 changes: 15 additions & 42 deletions src/Paramore.Brighter.MessagingGateway.AWSSQS/AWSClientFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#region Licence

/* The MIT License (MIT)
Copyright © 2022 Ian Cooper <[email protected]>

Expand Down Expand Up @@ -31,68 +32,40 @@ THE SOFTWARE. */

namespace Paramore.Brighter.MessagingGateway.AWSSQS;

internal class AWSClientFactory
internal class AWSClientFactory(
AWSCredentials credentials,
RegionEndpoint region,
Action<ClientConfig>? clientConfigAction)
{
private readonly AWSCredentials _credentials;
private readonly RegionEndpoint _region;
private readonly Action<ClientConfig>? _clientConfigAction;

public AWSClientFactory(AWSMessagingGatewayConnection connection)
: this(connection.Credentials, connection.Region, connection.ClientConfigAction)
{
_credentials = connection.Credentials;
_region = connection.Region;
_clientConfigAction = connection.ClientConfigAction;
}

public AWSClientFactory(AWSCredentials credentials, RegionEndpoint region, Action<ClientConfig>? clientConfigAction)
{
_credentials = credentials;
_region = region;
_clientConfigAction = clientConfigAction;
}

public AmazonSimpleNotificationServiceClient CreateSnsClient()
{
var config = new AmazonSimpleNotificationServiceConfig
{
RegionEndpoint = _region
};
var config = new AmazonSimpleNotificationServiceConfig { RegionEndpoint = region };

if (_clientConfigAction != null)
{
_clientConfigAction(config);
}
clientConfigAction?.Invoke(config);

return new AmazonSimpleNotificationServiceClient(_credentials, config);
return new AmazonSimpleNotificationServiceClient(credentials, config);
}

public AmazonSQSClient CreateSqsClient()
{
var config = new AmazonSQSConfig
{
RegionEndpoint = _region
};
var config = new AmazonSQSConfig { RegionEndpoint = region };

if (_clientConfigAction != null)
{
_clientConfigAction(config);
}
clientConfigAction?.Invoke(config);

return new AmazonSQSClient(_credentials, config);
return new AmazonSQSClient(credentials, config);
}

public AmazonSecurityTokenServiceClient CreateStsClient()
{
var config = new AmazonSecurityTokenServiceConfig
{
RegionEndpoint = _region
};
var config = new AmazonSecurityTokenServiceConfig { RegionEndpoint = region };

if (_clientConfigAction != null)
{
_clientConfigAction(config);
}
clientConfigAction?.Invoke(config);

return new AmazonSecurityTokenServiceClient(_credentials, config);
return new AmazonSecurityTokenServiceClient(credentials, config);
}
}
Loading
Loading