Mi Galaxy EMQ Book

peekMessage()


parameter PeekMessageRequest

queueName : String : required
peekMessageArg : PeekMessageArg : required

PeekMessage method provide three query parameter patterns, but only one at a time. The three query parameter modes are:

  1. receiptHandle: String. Query messages by the message ID returned when the message was sent successfully, or by the message handle obtained when the message was received.
  2. receiptHandleList: List The message ID returned when the message was sent successfully, or the message handle obtained when the message was received, to bulk query the message.
  3. partitionTimeIntervalAndMaxNum: partitionTimeIntervalAndMaxNum query messages by partition and time interval, and can limit the number of message items returned by each query. The partitionTimeIntervalAndMaxNum definition has four fields:
    • startTimestamp : long : optional Start Time
    • endTimestamp : long : optional End Time
    • maxNum : int : optional Maximum Number of Returned Message Items; Defaults to 200
    • partitionId : int : optional partition ID, system will randomly select if it's empty

return list< PeekMessageResponse >

PeekMessageResponse contains the following fields:

  1. messageID : String Message ID
  2. messageBody : String Message Body
  3. messageAttributes : map< string, MessageAttribute > User Custom Message Attributes
  4. e : GalaxyEmqServiceException Exception Information
  5. attributes : map< String, String > System-defined Message Attributes:

  6. Which must include: senderId messageLength md5OfBody sendTimestamp

  7. May also incude: priority receiveTimestamp firstReceiveTimestamp receiveCount sourceQueueName sourceTag deadTimestamp originalMessageID originalReceiveCount topic