Mi Galaxy EMQ Book

The Redrive Message function needs to be used in conjunction with the Dead Letter Queue advanced Queue function.

When the user detects that some received Ressages are invalid and they do not want to receive these Messages again but also do not want to delete them, and the number of times these messages have been received has not yet reached the redrive policy setting, when receiving the number of times the user can choose to actively send these Messages to the dead-letter queue for subsequent analysis.

deadMessage()


Send a message to the dead letter queue

parameter DeadMessageRequest

queueName : String : required

The name of the Queue from which this message was received. The system defaults to only one redrive policy per Queue, so there is no need to specify the name of the dead letter queue

receiptHandle : String : required

The receiptHandle of the Message to be sent to the dead letter queue

return void

deadMessageBatch()


Send Messages to the dead letter queue in batches This operation is not atomic. Some Messages may be successfully deleted and some may fail.

parameter DeadMessageBatchRequest

queueName : String : required

The name of the Queue from which this message was received. The system defaults to only one redrive policy per Queue, so there is no need to specify the name of the dead letter queue

deadMessageBatchRequestEntryList : List< DeadMessageBatchRequestEntry > : required

List of Messages to be sent to the dead letter queue DeadMessageBatchRequestEntry field includes:

  1. receiptHandle : String : required

return DeadMessageBatchResponse

successful : List< String >

Successful Message receiptHandle list

failed : List< MessageBatchErrorEntry >

List of failed Message receiptHandles and corresponding abnormality The specific content of the MessageBatchErrorEntry can be found in sendMessageBatch()

Note: The dead letter queue cannot use deadMessage or deadMessageBatch.