com.amazonaws.services.sqs.model.ReceiveMessageRequest.setAttributeNames()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中com.amazonaws.services.sqs.model.ReceiveMessageRequest.setAttributeNames方法的一些代码示例,展示了ReceiveMessageRequest.setAttributeNames的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ReceiveMessageRequest.setAttributeNames方法的具体详情如下:
包路径:com.amazonaws.services.sqs.model.ReceiveMessageRequest
类名称:ReceiveMessageRequest
方法名:setAttributeNames

ReceiveMessageRequest.setAttributeNames介绍

[英]A list of s that need to be returned along with each message. These attributes include:

  • All - Returns all values.

  • ApproximateFirstReceiveTimestamp - Returns the time the message was first received from the queue (epoch time in milliseconds).

  • ApproximateReceiveCount - Returns the number of times a message has been received from the queue but not deleted.

  • SenderId

  • For an IAM user, returns the IAM user ID, for example ABCDEFGHI1JKLMNOPQ23R.

    • For an IAM role, returns the IAM role ID, for example ABCDE1F2GH3I4JK5LMNOP:i-a123b456.
  • SentTimestamp - Returns the time the message was sent to the queue (epoch time in milliseconds).

  • MessageDeduplicationId - Returns the value provided by the producer that calls the {{$2$}} action.

  • MessageGroupId - Returns the value provided by the producer that calls the {{$3$}} action. Messages with the same MessageGroupId are returned in sequence.

  • SequenceNumber - Returns the value provided by Amazon SQS.
    [中]需要随每条消息一起返回的消息列表。这些属性包括:
    *All-返回所有值。
    *[$1$]-返回消息第一次从队列接收的时间(epoch time,以毫秒为单位)。
    *ApproximateReceiveCount-返回从队列收到但未删除的消息的次数。

  • SenderId
    *对于IAM用户,返回IAM用户ID,例如[$4$]。
    *对于IAM角色,返回IAM角色ID,例如ABCDE1F2GH3I4JK5LMNOP:i-a123b456
    *[$6$]-返回消息发送到队列的时间(epoch time,以毫秒为单位)。
    *MessageDeduplicationId-返回调用{{$2$}}操作的制作人提供的值。
    *MessageGroupId-返回调用{{$3$}}操作的制作人提供的值。具有相同MessageGroupId的邮件将按顺序返回。
    *[$12$]-返回Amazon SQS提供的值。

代码示例

代码示例来源:origin: aws/aws-sdk-java

setAttributeNames(attributeNames);
return this;

代码示例来源:origin: aws/aws-sdk-java

setAttributeNames(new com.amazonaws.internal.SdkInternalList<String>(attributeNames.length));

代码示例来源:origin: apache/usergrid

receiveMessageRequest.setAttributeNames(requestMessageAttributeNames);
receiveMessageRequest.setMaxNumberOfMessages( limit );
receiveMessageRequest.setVisibilityTimeout(

代码示例来源:origin: aws/aws-sdk-java

setAttributeNames(attributeNamesCopy);
} else {
  getAttributeNames().addAll(attributeNamesCopy);

代码示例来源:origin: apache/nifi

request.setAttributeNames(Collections.singleton("All"));
request.setMessageAttributeNames(Collections.singleton("All"));
request.setMaxNumberOfMessages(context.getProperty(BATCH_SIZE).asInteger());

代码示例来源:origin: aws-amplify/aws-sdk-android

setAttributeNames(attributeNames);
return this;

代码示例来源:origin: com.amazonaws/aws-java-sdk-sqs

setAttributeNames(attributeNames);
return this;

代码示例来源:origin: com.amazonaws/aws-android-sdk-sqs

setAttributeNames(attributeNames);
return this;

代码示例来源:origin: io.macgyver.rx-aws/rx-aws

@Override
public void run() {
  while (isRunning()) {
    try {
      ReceiveMessageRequest request = new ReceiveMessageRequest();
      request.setQueueUrl(getQueueUrl());
      request.setAttributeNames(ImmutableList.of("ALL"));
      request.setWaitTimeSeconds(waitTimeSeconds);
      Future<ReceiveMessageResult> result = client.receiveMessageAsync(request, new Handler());
      result.get(); // go ahead and block
    } catch (Exception e) {
      logger.warn("", e);
      failureCount.incrementAndGet();
    }
    try {
      long rescheduleDelay = Math.min(60000, 1000 * failureCount.get() * 3);
      if (rescheduleDelay > 0) {
        logger.info("pausing for {}ms due to errors", rescheduleDelay);
        Thread.sleep(rescheduleDelay);
      }
    } catch (InterruptedException e) {
      // swallow it
    }
  }
}

代码示例来源:origin: payara/Cloud-Connectors

rmr.setVisibilityTimeout(spec.getVisibilityTimeout());
rmr.setWaitTimeSeconds(spec.getPollInterval()/1000);
rmr.setAttributeNames(Arrays.asList(spec.getAttributeNames().split(",")));
rmr.setMessageAttributeNames(Arrays.asList(spec.getMessageAttributeNames().split(",")));
ReceiveMessageResult rmResult = client.receiveMessage(rmr);

代码示例来源:origin: org.apache.beam/beam-sdks-java-io-amazon-web-services

private void pull() {
 final ReceiveMessageRequest receiveMessageRequest =
   new ReceiveMessageRequest(source.getRead().queueUrl());
 receiveMessageRequest.setMaxNumberOfMessages(MAX_NUMBER_OF_MESSAGES);
 receiveMessageRequest.setAttributeNames(
   Arrays.asList(MessageSystemAttributeName.SentTimestamp.toString()));
 final ReceiveMessageResult receiveMessageResult =
   source.getSqs().receiveMessage(receiveMessageRequest);
 final List<Message> messages = receiveMessageResult.getMessages();
 if (messages == null || messages.isEmpty()) {
  return;
 }
 for (Message message : messages) {
  messagesNotYetRead.add(message);
 }
}

代码示例来源:origin: com.amazonaws/aws-java-sdk-sqs

setAttributeNames(new com.amazonaws.internal.SdkInternalList<String>(attributeNames.length));

代码示例来源:origin: com.amazonaws/aws-java-sdk-sqs

setAttributeNames(attributeNamesCopy);
} else {
  getAttributeNames().addAll(attributeNamesCopy);

代码示例来源:origin: org.apache.nifi/nifi-aws-processors

request.setAttributeNames(Collections.singleton("All"));
request.setMessageAttributeNames(Collections.singleton("All"));
request.setMaxNumberOfMessages(context.getProperty(BATCH_SIZE).asInteger());

相关文章

微信公众号

最新文章

更多