File tree Expand file tree Collapse file tree
user-management/tests/Stickerlandia.UserManagement.IntegrationTest/Drivers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
2+ // This product includes software developed at Datadog (https://www.datadoghq.com/).
3+ // Copyright 2025 Datadog, Inc.
4+
5+ using System . Text . Json ;
6+ using Amazon . SQS ;
7+ using Confluent . Kafka ;
8+
9+ namespace Stickerlandia . UserManagement . IntegrationTest . Drivers ;
10+
11+ public class SqsMessaging : IMessaging , IAsyncDisposable
12+ {
13+ private readonly AmazonSQSClient client ;
14+ private readonly Dictionary < string , string > queueUrlNameMap ;
15+ public SqsMessaging ( Dictionary < string , string > queueUrlNameMap )
16+ {
17+ client = new AmazonSQSClient ( ) ;
18+ this . queueUrlNameMap = queueUrlNameMap ;
19+ }
20+ public async Task SendMessageAsync ( string queueName , object message )
21+ {
22+ if ( ! queueUrlNameMap . TryGetValue ( queueName , out var queueUrl ) )
23+ {
24+ throw new ArgumentException ( $ "Queue name '{ queueName } ' not found in the queue URL map.") ;
25+ }
26+
27+ await client . SendMessageAsync ( queueUrl , JsonSerializer . Serialize ( message ) ) ;
28+ }
29+
30+ public async ValueTask DisposeAsync ( )
31+ {
32+ // Nothing to dispose
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments