diff --git a/README.md b/README.md index d5a9c1c..11f3ee2 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ $ ./mvnw -ntp clean verify -U $ curl --location --request POST 'http://localhost:4566/restapis//test/_user_request_/test' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "CoffeeBeans" + "body": "{ \"name\": \"CoffeeBeans\" }" }' ``` The service responds @@ -56,7 +56,7 @@ $ ./mvnw -ntp clean verify -U 1. Run the following commands ```shell $ export SPRING_PROFILES_ACTIVE=local - $ ./mvnw -ntp clean package -U -Pnative -DskipTests native:compile -pl spring-native-aws-lambda-function + $ ./mvnw -ntp clean package -U -Pnative -DskipTests -pl spring-native-aws-lambda-function $ ./spring-native-aws-lambda-function/target/spring-native-aws-lambda-function ``` The service starts in less than 100 ms @@ -77,8 +77,8 @@ $ ./mvnw -ntp clean verify -U $ curl --location --request POST 'http://localhost:8080' \ --header 'Content-Type: application/json' \ --data-raw '{ - "body": "{ \"name\": \"CoffeeBeans\" }" - }' + "body": "{ \"name\": \"CoffeeBeans\" }" + }' ``` The service responds ```json diff --git a/docker-compose.yml b/docker-compose.yml index 4936c71..165976c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,7 +51,7 @@ services: print_info_message "divider" "Package GraalVM function" && - ./mvnw -ntp clean package -U -Pnative -DskipTests native:compile -pl spring-native-aws-lambda-function && + ./mvnw -ntp clean package -U -Pnative -DskipTests -pl spring-native-aws-lambda-function && print_info_message "divider" "Creating LAMBDA function" && lambda_create_function lambda-FUNCTION provided.al2023 512 ./spring-native-aws-lambda-function/target/spring-native-aws-lambda-function-native-zip.zip spring-native-aws-lambda-function && @@ -64,7 +64,7 @@ services: apigateway_create_method "$$REST_API_ID" "$$RESOURCE_ID" "POST" && apigateway_create_lambda_integration "$$REST_API_ID" "$$RESOURCE_ID" "POST" "arn:aws:apigateway:ap-southeast-2:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-2:000000000000:function:lambda-FUNCTION/invocations" && apigateway_create_deployment "$$REST_API_ID" "test" && - apigateway_list_restapis && + --rest-api-id && print_info_message "plain" "Endpoint available at: http://localhost:4566/restapis/$$REST_API_ID/test/_user_request_/test" && diff --git a/spring-native-aws-lambda-function/pom.xml b/spring-native-aws-lambda-function/pom.xml index 8b50c8f..da68a0a 100644 --- a/spring-native-aws-lambda-function/pom.xml +++ b/spring-native-aws-lambda-function/pom.xml @@ -167,7 +167,7 @@ --verbose --no-fallback --enable-preview - --gc=G1 + -march=native --strict-image-heap --enable-url-protocols=http @@ -175,6 +175,15 @@ -H:+ReportExceptionStackTraces + + + build-native + prepare-package + + compile + + + maven-assembly-plugin