Cloud service

Message queue

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.

Configuration as code

To configure a message queue in your code editor, use the following variables in the service's configuration as code file.

Example

# service: ...

message_queues:
  - name: messages

Variables

name
required
string

The name of the message queue must use snake_case notation. In addition, message queues within a service cannot share the same name.

retries
required
integer

The number of times the delivery of the message is retried after a failure.

minimum: 4
maximum: 99
default: 9
timeout
required
string

The number of seconds after which the execution of the message times out.

minimum: 10
maximum: 600
default: 30
path
required
string

The path of the endpoint that is called by the message queue to deliver a message.

default: /shipmate/handle-message
dead_letter_path
required
string

The path of the endpoint that is called by the message queue to deliver a failed message.

default: /shipmate/handle-failed-message