

Also, because a human can read the payload, text-based formats are easier to debug and send to logs for troubleshooting errors. Human readable formats are suitable for archival data.
ENCODE MESSAGE WITH OUTGUESS CODE
With text-based encoding, the message payload is in plain text and therefore can be inspected by a person without using any code libraries. Message encoding can be broadly divided into text-based and binary formats. Here are some points to consider when choosing an encoding format. For a stream of events, you might want to read a sequence of records as quickly as possible and store it for statistical analysis. Also, you may want to retrieve it later for auditing purposes. Messages related to business transactions most likely will contain highly structured data. The type of message can influence the format choice. The encoding format defines how a set of structured data is represented as bytes. This article highlights some factors that can help you choose a format.

With other formats, the data may not be parsed as easily but the messages are compact. However, such formats tend to yield larger messages. Some encoding formats such as JSON are self-describing, meaning they can be parsed without referencing a schema. When the contract changes, the encoding format should be capable of handling the change without breaking the consumer. This way both entities share the model and as long as the shape doesn't change, messaging continues without issues. At the receiving end, the consumer deserializes the payload to use the data. To transfer messages, the producer serializes the message to an encoding format.
ENCODE MESSAGE WITH OUTGUESS HOW TO
Depending on the encoding format, choose a serialization library that is well supported.Ī consumer of the message must be aware of those decisions so that it knows how to read incoming messages. Certain factors include the ability to create highly structured data if you need it, time taken to encode and transfer the message, and the ability to parse the payload. Then, choose an encoding format depending on your need. Consider: What is the most efficient datatype? Will the payload always have certain fields? Will the payload have a single record or a repeated set of values? Decide the characteristics of the values for those fields. To structure the shape, divide the information into discrete or related subjects (fields). The producer of the message defines the message shape based on the business logic and the information it wants to send to the consumer(s). Serialization libraries to read and write the encoded payload.An encoding format to represent the payload.A shape or structure that defines the payload of the message.Message exchange needsĪ message exchange between a producer and a consumer needs:

This article describes some of the considerations. There are many options available, but the right choice depends on your use case. After you choose a messaging technology, the next step is to define how the messages will be encoded. An important aspect of messaging is the format used to encode the payload data. Many cloud applications use asynchronous messages to exchange information between components of the system.
