I'm using a fairly simple set up with local stack to emulate reading from an AWS SQS queue. When I run this boiler plate code I get an error about missing action.
Exception has occurred: CLR/Amazon.SQS.AmazonSQSException
An exception of type 'Amazon.SQS.AmazonSQSException' occurred in System.Private.CoreLib.dll but was not handled in user code: 'MissingAction; see the SQS docs.'
I'm not really sure where to go from here. I've searched high and low for this error, but I haven't been able to find anything. This is my code.
using Amazon;
using Amazon.Extensions.NETCore.Setup;
using Amazon.SQS;
using Amazon.SQS.Model;
using Microsoft.Extensions.DependencyInjection;
var awsCredentials = new Amazon.Runtime.BasicAWSCredentials("key", "secret");
var services = new ServiceCollection();
services.AddAWSService<IAmazonSQS>(new AWSOptions {
DefaultClientConfig =
{
ServiceURL = "http://localhost:4576",
UseHttp = true,
},
Credentials = awsCredentials,
Region = RegionEndpoint.USEast1
});
var provider = services.BuildServiceProvider();
var sqsClient = provider.GetRequiredService<IAmazonSQS>();
var response = await sqsClient.ReceiveMessageAsync(new ReceiveMessageRequest{
QueueUrl="http://localhost:4576/000000000000/CustomerEventQueue",
MaxNumberOfMessages=10,
WaitTimeSeconds=2
// (Could also request attributes, set visibility timeout, etc.)
});
Console.ReadLine();
I just got exactly the same issue. Looks like you have incompatible version see github
Looks like that SQS did change their protocol to JSON, and they released new version of SDK, while localstack did not follow it.
So you have an option to update all to latest version or downgrade AWSSDK.Core to 3.7.200.67 or lower.
So far because of time constraints we downgraded our SDK due to some limitations with whitelisting of containers.