Skip to main content

Message queues

Message queues are primarily used to process activities in parallel to service execution. As an example, for a sign-up service, you might want to send a welcome email to the new user at the end of the service. However, sending an email might take time, and you do not wish to delay the sign-up service but return an immediate response to the user. In this case, you can define a queue to send the welcome email and submit a message to this queue from the sign-up service. The submitted message will be handled by the service assigned to the queue and processed asynchronously.

Message queues allow different parts of your application to communicate and perform activities asynchronously. A message queue provides a buffer that temporarily stores messages and dispatches them to their consuming service. The messages are usually small, and can be things like requests, replies or error messages, etc. To send a message, an endpoint service or a task service called a producer needs to have a "Submit Message to Queue" node that sends a message to the queue when ran. The message is stored on the queue until the target service called a consumer retrieves the message and performs activities with it. It is also possible to delay the messsages submitted to the queue so that these messsages can be processed at a later time.