Mi Galaxy EMQ Book

changeMessageVisibilitySeconds()


Changing the invisible time of received messages
After a Message is received by a certain user instance, it will become invisible for a period of time to prevent it from being received repeatedly.
When the invisible time expires and no delete request for this Message has been received, EMQ will consider the Message as unsuccessful and the user instance that received the Message as having become unresponsive. So EMQ will re-send the Message so that it is read again and successfully processed
After the user instance receives the Message, if it thinks that it is difficult to complete the Message processing within the set invisible time, this method can be used to extend the invisible time. The newly set invisible time is computed from the request received by the server (rather than computed from the time when the Message was received)
In addition to the above scenario, if the user instance finds that the received Message itself cannot be processed, the invisible time can also be set to zero. At this point, the Message will immediately become visible to be read again
This method sets the invisible time to be valid only once. If the invisible time expires and the Message is read again, the invisible time of the Message will use its original value.

parameter ChangeMessageVisibilityRequest

queueName : String : required
receiptHandle : String : required

Need to change the invisible time of the receiptHandle corresponding to the Message
Note that messageID cannot be used here

invisibilitySeconds : int required

The newly configured invisible time begins being computed from the tine the server receives the request

return void

changeMessageVisibilitySecondsBatch()


The batch change is the invisible time of the message
Note: This operation is not atomic. It is possible for the message change to partially succeed and partially fail

parameter ChangeMessageVisibilityBatchRequest

queueName : String : required
changeMessageVisibilityRequestEntryList : List< ChangeMessageVisibilityBatchRequestEntry > : required

It is necessary to change the invisible time Message List
ChangeMessageVisibilityBatchRequestEntry fields include

  1. receiptHandle : String : required
  2. invisibilitySeconds : int : required

parameter ChangeMessageVisibilityBatchResponse

successful : List< String >

Successful Message receiptHandle list

failed : List< MessageBatchErrorEntry >

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