Message Type Text versus Binary
The handling of messages and message type is quite confusing as even most examples of code assume to send messages in binary format.
What is solace recommendation for structured text messages ? (like json, xml, csv,...)
Here the facts as i understood them:
- Default is always sending as binary message type
- Rest Messanging API maps json, xml to Text Message Solace REST HTTP Message Encoding (see chapter: HTTP Content-Type Mapping to Solace Message Types)
- Most samples i have seen handle messages as binary
What is the problem with that ?
- If all would use by default binary we would get different message type depending on how messages gets published to solace ? (via rest api it would turn to text message) and by using the standard libs it would by default turn to binary.
- The receive and handling of binary and text is different on consumer side (binary: getBinaryAttachment() or dump() everything text: getText())
Clarity and more standardization of examples, defaults would avoid issues like:
Other open questions:
- As well unclear what impact setting SDT has on the message type. i can send a text message but in solace any message attribute (header fields) is added by using SDT.
- What message property i can check to understand which message type was received on consumer side.
Many thanks for your help.