Azure service bus SerializationException due to extra bytes

157 views
Skip to first unread message

niklas...@gmail.com

unread,
Feb 19, 2019, 5:02:55 AM2/19/19
to masstransit-discuss
I'm getting a SerializationException when the consumer tries to deserialize the message envelope:
SerializationException: An exception occurred while deserializing the message envelope ---> Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: S. Path '', line 1, position 1.

This is the message when I print it in a bus observer IReceiveObserver.PreReceive using Encoding.UTF8.GetString(context.GetBody()):
 Sw?  ?{
  "messageId": "25760000-5d02-0015-f539-08d69645011f",
  "conversationId": "25760000-5d02-0015-f70b-08d69645011f",
  "sourceAddress":...


I have peeked the message with Service Bus Explorer and finds that it looks correct there:
{
  "messageId": "25760000-5d02-0015-f539-08d69645011f",
  "conversationId": "25760000-5d02-0015-f70b-08d69645011f",
  "sourceAddress": ..
.

I can see that the message is 8 bytes larger when my consumer reads the message when I compare the size in Service Bus Explorer 1777 bytes vs 1185 bytes.
The extra byres are always 0, 83, 119, 176, 0, 0, 4, 153

My consumer uses the following packages:
<packages>
  <package id="GreenPipes" version="2.1.3" targetFramework="net472" />
  <package id="MassTransit" version="5.3.1" targetFramework="net472" />
  <package id="MassTransit.AzureServiceBus" version="5.3.1" targetFramework="net472" />
  <package id="MassTransit.RabbitMQ" version="5.3.1" targetFramework="net472" />
  <package id="Microsoft.Azure.Services.AppAuthentication" version="1.0.3" targetFramework="net472" />
  <package id="Microsoft.Diagnostics.Tracing.EventSource.Redist" version="1.1.28" targetFramework="net472" />
  <package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="3.19.8" targetFramework="net472" />
  <package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.2.3" targetFramework="net472" />
  <package id="NewId" version="3.0.1" targetFramework="net472" />
  <package id="Newtonsoft.Json" version="11.0.2" targetFramework="net472" />
  <package id="Newtonsoft.Json.Bson" version="1.0.1" targetFramework="net472" />
  <package id="RabbitMQ.Client" version="5.1.0" targetFramework="net472" />
  <package id="System.IdentityModel.Tokens.Jwt" version="4.0.4.403061554" targetFramework="net472" />
  <package id="System.Reflection.Emit.Lightweight" version="4.3.0" targetFramework="net472" />
  <package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
  <package id="Topshelf" version="4.2.0" targetFramework="net472" />
  <package id="WindowsAzure.ServiceBus" version="5.1.0" targetFramework="net472" />
</packages>

And thanks for a great project!

Regards,
Niklas

niklas...@gmail.com

unread,
Feb 22, 2019, 9:49:37 AM2/22/19
to masstransit-discuss

The problem was solved by changing to older versions of packages(MassTransit, WindowsAzure.ServiceBus and MassTransit.AzureServiceBus) used by the application publishing the messages.

The latest version of the packages did not work. Tested with consumers written in .Net 4.7.2 and ASPNet Core 2.2.

Chris Patterson

unread,
Feb 22, 2019, 9:55:24 AM2/22/19
to masstrans...@googlegroups.com
The latest version (v5.3.2) fixes the issue with service bus message serialization using the legacy (AzureServiceBus) transport. The Azure.ServiceBus.Core transport never had the issue.


On Fri, Feb 22, 2019 at 8:49 AM <niklas...@gmail.com> wrote:

The problem was solved by changing to older versions of packages(MassTransit, WindowsAzure.ServiceBus and MassTransit.AzureServiceBus) used by the application publishing the messages.

The latest version of the packages did not work. Tested with consumers written in .Net 4.7.2 and ASPNet Core 2.2.

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/b1b9eb00-a145-4698-8921-1df2d8bb82ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages