Guidance for Asynchronous Messaging

On this page

  1. Design smart endpoints and dumb pipes
  2. Strive for atomic messaging
  3. Build in resiliency
  4. Secure the pipe
  5. Decouple across all layers
  6. Evolve and support the interface throughout its lifecycle

Asynchronous messaging allows for sharing of data across systems and is in wide use across the Government of Canada (GC). This guidance document is intended to guide technical practitioners (e.g., integration developers and architects) in the development of asynchronous messaging across the GC to better support integrated digital processes across departments and agencies.

1. Design smart endpoints and dumb pipes

Complexity and logic should be pushed out to the applications at the edges and should not be encapsulated inside the queueing/messaging infrastructure. This design ensures that logic remains in the application layer and minimizes the number of parties involved in troubleshooting processing errors. In particular:

2. Strive for atomic messaging

Messaging interaction should be as atomic as possible. Assembling a transaction across messages and queues creates complexity and a higher risk of failures. The following practices should be applied:

3. Build in resiliency

Endpoints, especially senders, should assume that the messaging/queuing infrastructure will fail at some point. Resiliency should therefore be built into the endpoints to deal with potential failure scenarios and should not assume absolute reliability of the messaging/queuing infrastructure. The following considerations should be made:

4. Secure the pipe

Security should be top of mind when designing and implementing interfaces. The following practices should be followed for any asynchronous messaging integration other than those exposing public data (e.g., open data). It is important to note that these practices are to provide a baseline set of security controls. Additional controls (e.g., message-level encryption, mutual authentication, and digital signatures) may be required based on the sensitivity level of the data and your own departmental security requirements.

5. Decouple across all layers

Asynchronous messaging doesn’t automatically provide loose coupling. Instead, loose coupling is achieved through proper design and implementation across application and data tiers. The following practices should be followed when defining your integration:

6. Evolve and support the interface throughout its lifecycle

Messaging interfaces will change over time as system and user needs evolve. As a best practice, that change should be properly supported and managed through the following practices:

Page details

Date modified: