peekMessage()


方法参数PeekMessageRequest

queueName : String : required
peekMessageArg : PeekMessageArg : required

查询消息输入的参数,提供三种查询参数模式,但是一次仅能选择一种. 三种查询参数模式是:

  1. receiptHandle : String 按消息发送成功时返回的消息id, 或者接收到消息时获取的消息句柄, 来查询消息.
  2. receiptHandleList : List 按消息发送成功时返回的消息id, 或者接收到消息时获取的消息句柄, 来批量查询消息.
  3. partitionTimeIntervalAndMaxNum : PartitionTimeIntervalAndMaxNum 按分片和时间区间来查询消息,并能限制每次查询返回的消息条数. PartitionTimeIntervalAndMaxNum的定义有四个字段:
    • startTimestamp : long : optional 起始时间
    • endTimestamp : long : optional 结束时间
    • maxNum : int : optional 最多返回的消息条数, 默认为200条
    • partitionId : int : optional 分片id,不填则系统随机选择

方法返回 list< PeekMessageResponse >

PeekMessageResponse包含的字段如下:

  1. messageID : String 消息ID
  2. messageBody : String 消息体
  3. messageAttributes : map< string, MessageAttribute > 用户自定义的消息属性
  4. e : GalaxyEmqServiceException 异常信息
  5. attributes : map< String, String > 系统定义的消息属性:
  6. 其中必定包含的内容有:
    • senderId
    • messageLength
    • md5OfBody
    • sendTimestamp
  7. 有可能会包含的内容有:
    • priority
    • receiveTimestamp
    • firstReceiveTimestamp
    • receiveCount
    • sourceQueueName
    • sourceTag
    • deadTimestamp
    • originalMessageID
    • originalReceiveCount
    • topic

results matching ""

    No results matching ""