Messages are used to describe the support of asynchronous exchanges between services.
Note: Events are declared as messages in Akwatype.

As a reminder, messages are sent and received through channels

How to decribe channels

Declaration of a message

Messages are declared in services files

A message is declared by the keyword message followed by the name of the message.

message PersonMessage

This is the minimum information needed to declare a message and use it in send and receive to start exploring graphically relationships between services.

How to consume routes and send / receive messages

To go further, the next step is of course to indicate what data is carried by the message.

For this you can specify a data model facade for the message content called payload

You can also specify another facade for the message headers

message PersonMessage{
    payload: PersonDTO
    headers: MessageHeaderDTO
}

Associate examples with the content of the messages

The data examples associated with the messages are named examples with for each example an example object for the payload and another for the headers.

How to describe data examples

message PersonMessage{
    payload: PersonDTO
    headers: MessageHeaderDTO
    examples {
        Leslie{
            payload: xPersonLeslie
            headers: xMessageHeaders           
        }
        Leo{
            payload: xPersonLeo
            headers: xMessageHeaders
        }
    }
}

 

Standard message properties :

  • label (String)
    • short description of the message
  • description (String)
    • description of the message
  • comment (String)
    • Allows you to add a comment to the message
  • urlExternalDescription (String)
    • url pointing to an external description of the message
  • payload (String)
    • name of the facade describing the data contained in the message.
  • headers (String)
    • name of the facade describing the data contained in the message headers
  • bindings { ... }
    • A "binding" (or "protocol binding") is a mechanism to define protocol-specific information. Therefore, a protocol binding MUST define protocol-specific information only
    • Pour un même protocole la déclartaion du binding peut être répartie entre le server, le channel et le message
    • How to declare bindings definition
  • schemaFormat  (String)
    • A string containing the name of the schema format used to define the message payload
  • contentType (String)
    • The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json)