Hello,
We are using RabbitMq and MassTransit in a micro service architecture with dotnet microservices + some java microservices and some message published using Ansible or shell script.
Using MassTransit 6.2.1 we had no problem consuming MT message having a content_type "application/json". We wanted to update to MT 6.2.5 for Prometheus integration but with this version we have errors "No deserializer was registered for the message content type: application/json."
We ended up writing a "dummy" deserializer
public class BackwardCompatibleJsonDeserializer : JsonMessageDeserializer, IMessageDeserializer
{
public const string ContentTypeHeaderValue = "application/json";
public static readonly ContentType JsonContentType = new ContentType(ContentTypeHeaderValue);
public BackwardCompatibleJsonDeserializer(JsonSerializer deserializer)
: base(deserializer)
{
}
ContentType IMessageDeserializer.ContentType
{
get { return JsonContentType; }
}
}
and plugin it with
rabbitMqBusConfigurator.AddMessageDeserializer(new System.Net.Mime.ContentType("application/json"), () => new BackwardCompatibleJsonDeserializer(JsonMessageSerializer.Deserializer));
Did something changed in the serializer management between version 6.2.1 and 6.2.5 ?