Created
February 17, 2024 10:24
-
-
Save civic/2a0583b19d6260832ba5e6ab98b25702 to your computer and use it in GitHub Desktop.
StudyLambda1 初期化処理あり
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import com.amazonaws.services.lambda.runtime.Context; | |
import com.amazonaws.services.lambda.runtime.RequestHandler; | |
import com.amazonaws.services.lambda.runtime.events.SQSEvent; | |
import java.util.UUID; | |
public class StudyLambda1 implements RequestHandler<SQSEvent, Void>, Resource { | |
private static final String hogeSeed; | |
static { | |
hogeSeed = UUID.randomUUID().toString(); | |
} | |
public Void handleRequest(SQSEvent input, Context context) { | |
System.out.printf("function start. input=[%s] hogeSeed=[%s]%n", | |
input.getRecords().get(0).getBody(), hogeSeed); | |
try { | |
Thread.sleep(3000); | |
} catch (InterruptedException e) { | |
throw new RuntimeException(e); | |
} | |
System.out.println("function finish."); | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment