Cannot develop locally using Localstack
See original GitHub issueIs this a bug report?
Yes.
Can you also reproduce the problem with the latest version?
Yes, I can. Here is a link to a sample repo. https://github.com/rabberbock/MassTransitLocalstack/
Environment
- Operating system: Windows 10
- Visual Studio version: Visual Studio 2019
- Dotnet version: .Net Core 3.0 preview 5
Steps to Reproduce
- Download the Sample project from https://github.com/rabberbock/MassTransitLocalstack.
- Make sure you have .Net Core 3 preview 5 installed
- Have localstack running on your computer. (I ran it via docker and added
docker.localhostto the hosts file). I am using the sqs transport. I tried it with go-aws as well and got the same error. - Run the application, and notice the error when trying to execute the handler.
Expected Behavior
It should execute the handler with no errors.
Actual Behavior
Currently message deserialization is broken using localstack to emulate sqs and sns. Running this with a real AWS sqs and sns actually works.
R-FAULT amazonsqs://us-east-1/my_queue 7db85235-948f-4060-b37f-9568e3e51de3 Value cannot be null.
Parameter name: source
System.Runtime.Serialization.SerializationException: An exception occurred while deserializing the message envelope ---> System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at MassTransit.Serialization.JsonConsumeContext..ctor(JsonSerializer deserializer, IObjectTypeDeserializer objectTypeDeserializer, ReceiveContext receiveContext, MessageEnvelope envelope)
at MassTransit.Serialization.JsonMessageDeserializer.MassTransit.IMessageDeserializer.Deserialize(ReceiveContext receiveContext)
--- End of inner exception stack trace ---
at MassTransit.Serialization.JsonMessageDeserializer.MassTransit.IMessageDeserializer.Deserialize(ReceiveContext receiveContext)
at MassTransit.Serialization.SupportedMessageDeserializers.Deserialize(ReceiveContext receiveContext)
at MassTransit.Pipeline.Filters.DeserializeFilter.Send(ReceiveContext context, IPipe`1 next)
at GreenPipes.Filters.RescueFilter`2.GreenPipes.IFilter<TContext>.Send(TContext context, IPipe`1 next)
dbug: MassTransit.Messages[0]
SEND amazonsqs://us-east-1/MassTransit-ReceiveFault 47360000-5d56-0015-5d31-08d6f2863ce7 MassTransit.ReceiveFault
dbug: MassTransit.Messages[0]
SEND amazonsqs://us-east-1/MassTransit-ReceiveFault 47360000-5d56-0015-3386-08d6f2863ceb MassTransit.ReceiveFault
Reproducible Demo
https://github.com/rabberbock/MassTransitLocalstack.
Thanks for all your help!
Issue Analytics
- State:
- Created 4 years ago
- Comments:24 (19 by maintainers)
Top Results From Across the Web
Development Environment Setup
Setting up Development Environment To make contributions to LocalStack, you need to be able to run LocalStack in host mode from your IDE,...
Read more >localstack trying to connect to localhost:4566 when we ...
My team is trying to get a local setup for our project. We are running the same docker-compose file with image localstack/localstack:0.8.10 ...
Read more >Local Development with AWS on LocalStack
LocalStack is a Python application designed to run as an HTTP request processor while listening on specific ports. Our usage of LocalStack is ......
Read more >Develop Your Cloud App Locally with the LocalStack ...
Learn how to use the LocalStack Docker Extension to emulate a cloud service locally with Docker Desktop.
Read more >How to fake AWS locally with LocalStack
Once the AWS CLI is installed, run aws configure to create some credentials. Even though we're talking to our "fake" local service, we...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

You can check the options used in the unit tests via docker-compose for localstack that I use to test MassTransit.
The test harness settings shown here are the key to connecting locally.
Thanks so much. Following with my example, this works fine to connect to localstack as per previous message.
Amazing help, as always!
PS: Careful with localstack versions. Some of them don’t work. See https://stackoverflow.com/questions/66767011/localstack-with-masstransit-not-getting-messages