A message queue allows the services within your application to communicate with each other in a loosely-coupled asynchronous way. A service can publish a message to the message queue without considering its recipients. The queue is responsible for delivering this message to all the other services connected to the queue.
Using an intelligent retry mechanism, the message queue keeps delivering the message until every service has acknowledged the successful delivery. This way, every service can process messages at their own pace, and messages don't get lost due to downtime or network issues.
To configure a message queue in your code editor, use the following variables in the service's configuration as code file.
# service: ...
message_queues:
- name: messages
The name of the message queue must use snake_case notation. In addition, message queues within a service cannot share the same name.
The number of times the delivery of the message is retried after a failure.
4
99
9
The number of seconds after which the execution of the message times out.
10
600
30
The path of the endpoint that is called by the message queue to deliver a message.
/shipmate/handle-message
The path of the endpoint that is called by the message queue to deliver a failed message.
/shipmate/handle-failed-message