• Distributed Message Service

  1. Help Center
  2. Distributed Message Service
  3. User Guide
  4. Introduction
  5. Queuing and Message Delivery

Queuing and Message Delivery

Messages in one queue are stored on different servers, and each message has multiple replicas, achieving high reliability and availability.

Figure 1 shows how messages from a queue are distributed across different servers.

Figure 1 Distribution of messages from a queue

Message queues have the following characteristics:

  • Message delivery order

    Normal queues provide higher concurrence. However, messages may be retrieved out of sequence, because message queues are distributed in different partitions. To preserve the sequence, sequence information must be included in each message. This allows messages to be sequenced after they are received.

    In a FIFO queue, messages are retrieved in the order they were sent. FIFO queues are useful in scenarios where the order of messages is important.

  • At-least-once delivery

    In rare cases, a server storing message replicas may be unavailable when the client requests or deletes messages. If this happens, the message replicas will not be deleted from that server and may be sent when the connection is restored.

    This process is called "at-least-once" delivery. To avoid any adverse impact from processing the same message multiple times, ensure that your application processes messages idempotently.

  • A specified number of messages cannot be obtained at a time when there are only a few messages in a queue.

    When there are only a few messages in a queue, the number of messages retrieved at a time may be less than the message quantity specified in the retrieval request. However, all messages in the queue will eventually be obtained by the consumer after multiple rounds of retrieval.