MassTransit: Messages with nested MessageData is sending to error queue
Is this a bug report?
Yes
Can you also reproduce the problem with the latest version?
Yes, MT version 6.3.2
Environment
- Operating system: Linux
- Dotnet version: 3.1.101
Steps to Reproduce
- Create a Message with nested MessageData:
public interface MyCustomizedFile
{
string Name { set; get; }
MessageData<string> Content { set; get; }
}
public interface MyEventMessage
{
MyCustomizedFile MyFile { get; set; }
}
- Send the event massage including file content.
- So the message is not consumed and is sent to error queue.
- Send the event massage with null file content.
- So the message is consumed normally.
Expected Behavior
I expect the MyEventMessage.MyCustomizedFile.FileContent contains the sent file.
Actual Behavior
The message event is sent normally, but when the nested message data is filled the consumer don’t receive the message.
Reproducible Demo
- Clone the repository: https://github.com/rafaelcaviquioli/MassTransitMessageDataTest
- Start RabbitMQ:
docker-compose up rabbitmq - Run the console app.
- The console app is sending two events.
- This is the expected log because only the event which has no file content is received:
$ dotnet run
Listening for events, press a key to exit...
Received the event MyEvent with null message data - Doesn't have file value
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 26 (13 by maintainers)
Commits related to this issue
- Reproduce bug of Repository to reproduce bug mentioned on https://github.com/MassTransit/MassTransit/issues/1901 — committed to rafaelcaviquioli/MassTransitMessageDataTest by rafaelcaviquioli 4 years ago
- Fixed #1901 - missing property writer on transport was discarding stored message data property values. — committed to MassTransit/MassTransit by phatboyg 4 years ago
- Fixed (again) #1901 - this time, with more scrubbing power. — committed to MassTransit/MassTransit by phatboyg 4 years ago
there are no breaking changes you can notice, except you are using parts marked as obsolete
I have an idea of why it’s happening. The failure I see is with initializers and then the convention to store the data. I can reproduce it so I can fix it.
And that works like a charm. 👏 🎉
Thank you very much @phatboyg!
Last question: We were upgrading our system from MT v5 to v6. Are there any breaking changes from v6 to v7?
Okay, maybe this time I actually fixed it.
Hi @phatboyg ,
Rafael is my teammate 😃
Here is the repo of my tests https://github.com/tonholis/MTEncTest, as requested in Discord.
As I mentioned, the tests pass but the actual application/service doesn’t work. The response message containing the complex structure with MessageData is not fully populated.