Skip to content

Instantly share code, notes, and snippets.

@awswithdotnet
Created March 9, 2022 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awswithdotnet/b815ed2624884bd035470655baf51b41 to your computer and use it in GitHub Desktop.
Save awswithdotnet/b815ed2624884bd035470655baf51b41 to your computer and use it in GitHub Desktop.
sqs SQSMessageProducer Send
public async Task Send(String message)
{
string accessKey = "<AWS ACCESS KEY>";
string secret = "<AWS ACCESS KEY>";
string queueUrl = "<AWS ACCESS KEY>";
string awsregion = "<AWS ACCESS KEY>";
BasicAWSCredentials creds = new BasicAWSCredentials(accessKey, secret);
RegionEndpoint region = RegionEndpoint.GetBySystemName(awsregion);
SendMessageRequest sendMessageRequest = new SendMessageRequest(queueUrl, message);
var sqsClient = new AmazonSQSClient(creds, region);
await sqsClient.SendMessageAsync(sendMessageRequest);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment