验证AWS Lambda中的数据到达时间

时间:2019-12-17 02:59:52

标签: java amazon-web-services validation if-statement amazon-s3

我是编程的新手...希望您能帮助我... 我的要求是,如果数据的到达时间少于3分钟,则编写Java条件,然后将其发送到s3,否则不要发送...

我的代码示例如下

public class KinesisFirehoseTransformer implements RequestHandler<KinesisFirehoseEvent, KinesisFirehoseResponse> {

  @Override
  public KinesisFirehoseResponse handleRequest(KinesisFirehoseEvent event, Context context) {
    context.getLogger().log("Input: " + event);

    List<KinesisFirehoseOutputRecord> results = event.getRecords().stream().map(record -> {
      KinesisFirehoseOutputRecord outRec = new KinesisFirehoseOutputRecord();
      outRec.setRecordId(record.getRecordId());
      outRec.setData(record.getData());
      outRec.result = KinesisFirehoseResponse.TRANSFORMED_STATE_DROPPED;
      return outRec;
    }).collect(Collectors.toList());

    return new KinesisFirehoseResponse(results);
  }
}

0 个答案:

没有答案