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:
- 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.
- 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.
- 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:
- messageID : String Message ID
- messageBody : String Message Body
- messageAttributes : map< string, MessageAttribute > User Custom Message Attributes
- e : GalaxyEmqServiceException Exception Information
attributes : map< String, String > System-defined Message Attributes:
Which must include: senderId messageLength md5OfBody sendTimestamp
- May also incude: priority receiveTimestamp firstReceiveTimestamp receiveCount sourceQueueName sourceTag deadTimestamp originalMessageID originalReceiveCount topic