Skip to content

Commit c2ffaa9

Browse files
author
Vadym Kazulkin
committed
investigate spring boot and in crac in lambda container image
1 parent af1da54 commit c2ffaa9

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

spring-boot-3.2-docker-image-with-crac/src/main/java/software/amazonaws/example/product/handler/GetProductByIdHandler.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
package software.amazonaws.example.product.handler;
55

6+
import java.io.IOException;
7+
import java.nio.file.Files;
8+
import java.nio.file.Path;
69
import java.util.Optional;
710
import java.util.Properties;
811
import java.util.function.Function;
@@ -32,6 +35,17 @@ public class GetProductByIdHandler implements Function<APIGatewayProxyRequestEve
3235
private static final Logger logger = LoggerFactory.getLogger(GetProductByIdHandler.class);
3336

3437
public APIGatewayProxyResponseEvent apply(APIGatewayProxyRequestEvent requestEvent) {
38+
39+
40+
Path filePath = Path.of("/tmp/crac/dump4.log");
41+
42+
try {
43+
String content = Files.readString(filePath);
44+
logger.info("crac dump" +content);
45+
} catch (IOException e) {
46+
47+
}
48+
3549
Properties prop = System.getProperties();
3650
logger.info ("JVM Vendor : " + prop.getProperty("java.vendor") );
3751
String id = requestEvent.getPathParameters().get("id");

spring-boot-3.2-docker-image-with-crac/template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Resources:
110110
Type: AWS::Serverless::Function
111111
Properties:
112112
PackageType: Image
113-
ImageUri: !Sub ${AWS::AccountId}.dkr.ecr.eu-central-1.amazonaws.com/aws-spring-boot-3.2-java21-with-crac-custom-docker-image:v1
113+
ImageUri: !Sub ${AWS::AccountId}.dkr.ecr.eu-central-1.amazonaws.com/aws-spring-boot-3.2-java21-crac-custom-docker-image:v1
114114
ImageConfig:
115115
Command: ["org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest"]
116116
Environment:
@@ -139,7 +139,7 @@ Resources:
139139
Type: AWS::Serverless::Function
140140
Properties:
141141
PackageType: Image
142-
ImageUri: !Sub ${AWS::AccountId}.dkr.ecr.eu-central-1.amazonaws.com/aws-spring-boot-3.2-java21-with-crac-custom-docker-image:v1
142+
ImageUri: !Sub ${AWS::AccountId}.dkr.ecr.eu-central-1.amazonaws.com/aws-spring-boot-3.2-java21-crac-custom-docker-image:v1
143143
ImageConfig:
144144
Command: ["org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest"]
145145
Environment:

0 commit comments

Comments
 (0)