Azure-docs: Service Bus payload format recommendations

Created on 21 Aug 2019  Â·  12Comments  Â·  Source: MicrosoftDocs/azure-docs

What is the reasoning behind recommending the use of JSON and Apache Avro as payload formats for structured data? Both use dynamic typing and are generally slower in marshalling/unmarshalling compared to statically typed payload formats such as Thrift or protobuf


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author product-question service-bus-messaginsvc triaged

All 12 comments

Hi @nickstaggs - Thank you for your feedback! We have assigned this issue to the author to review and update as appropriate.

This isn't a production issue or anything but over a month with no response is a bit discouraging @mike-urnun-msft @axisc

Any update on this @mike-urnun-msft @axisc?

@spelluru Could you share your inputs on this one?

@mike-urnun-msft - @axisc is the right person to answer this question. He is OOF for two weeks. Please see if Clemens Vasters (architect) can help. Sorry.

This is still unanswered.
In addition to that question I have another. The article recommends the ContentType to specify the format of the message. What about the type? How does one know which specific message type the Message received at the subscription has? It'd be good if there was some customizable metadata or if we could use this ContentType to actually specify the message type (e.g: a C# interface or class). Or is it a good practice to have one subscription per message type?

@axisc - Please answer as soon as you can. Thanks.

The way I see it is the type is up to the users of the service bus. The broker cannot (and should not) enforce it.

It'd be good if there was some customizable metadata or if we could use this ContentType to actually specify the message type (e.g: a C# interface or class). Or is it a good practice to have one subscription per message type?

It's already there and called UserProperties 🙂
You can use custom headers (user properties) for any metadata you desire.
How you use ContentType is also up to you. You can specify the serialization used, or leave it and use headers as well. Keep in mind that for subscriptions headers work well where ContentType would need to be promoted to the headers to be used. Cheers.

@SeanFeldman is absolutely on point :)

please-close

@axisc @SeanFeldman please reopen as the original question of: _Why are JSON and Apache Avro the recommended payload formats for the Service Bus?_ was not answered

@nickarms, I can't. I'm an external person.

Regarding the recommendation,

We generally recommend JSON and Apache Avro as payload formats for structured data.

Personally, I think it should be removed or replaced with a "consideration for payload serialization" type of wording. If someone chooses to send the payload serialized as XML, it's their business. Wherever it is JSON, XML, BSON, AVRO, service bus doesn't care and is not impacted.

@axisc @mike-urnun-msft @spelluru Can you please reopen this issue. The original question was not answered...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JamesDLD picture JamesDLD  Â·  3Comments

Ponant picture Ponant  Â·  3Comments

Favna picture Favna  Â·  3Comments

paulmarshall picture paulmarshall  Â·  3Comments

bityob picture bityob  Â·  3Comments