File tree Expand file tree Collapse file tree
java/de/stvehb/example/serverless
java/de/stvehb/example/serverless/test/unit/repository Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,30 @@ Our goal was to have functions with a low memory footprint and extremely fast co
66
77> mvn package -Pnative -Dquarkus.native.container-build=true
88
9+ ## AWS
10+ Specify your function in the `` application.properties `` with `` quarkus.funqy.export=helloWorld `` .
11+
12+ The function name is based on the function in the `` HelloWorldFunction.class `` in the case it`s `` helloWorld `` .
13+
14+ You need to add `` LAMBDA_ROLE_ARN `` with your role to your enviroment variables or add it to the `` manage.sh `` file.
15+
16+ ### Native deployment
17+
18+ > mvn package -Pnative -Dquarkus.native.container-build=true
19+
20+ > sh target/manage.sh native create
21+
22+ ## Testing
23+ You can use the SAM CLI to test your aws lamda locally.
24+
25+ ### JVM
26+ > sam local invoke --template target/sam.jvm.yaml --event payload.json
27+
28+ ### Native
29+ > sam local invoke --template target/sam.native.yaml --event payload.json
30+
931## Sources
1032
1133[ Quarkus - Building native image] ( https://quarkus.io/guides/building-native-image )
34+
35+ [ Quarkus - Funqy Amazon Lamda] ( https://quarkus.io/guides/funqy-amazon-lambda )
Original file line number Diff line number Diff line change 1+ {
2+ "username" : " testUser"
3+
4+ }
Original file line number Diff line number Diff line change 4242 <artifactId >quarkus-funqy-http</artifactId >
4343 <scope >compile</scope >
4444 </dependency >
45+ <dependency >
46+ <groupId >io.quarkus</groupId >
47+ <artifactId >quarkus-funqy-amazon-lambda</artifactId >
48+ </dependency >
4549 <dependency >
4650 <groupId >io.quarkus</groupId >
4751 <artifactId >quarkus-resteasy</artifactId >
Original file line number Diff line number Diff line change 1010public class UserFunction {
1111
1212 @ Inject
13- private UserService userSer ;
13+ UserService userSer ;
1414
1515 @ Funq
1616 public void createUser (@ Valid UserDTO userDTO ) {
Original file line number Diff line number Diff line change 1111public class UserService {
1212
1313 @ Inject
14- private UserRepository userRepository ;
14+ UserRepository userRepository ;
1515
1616 @ Transactional
1717 public void createUser (String username ) {
Original file line number Diff line number Diff line change 44# quarkus.datasource.jdbc.url = jdbc:postgresql://localhost:5432/mydatabase
55# quarkus.datasource.driver=org.postgresql.Driver
66quarkus.hibernate-orm.database.generation =drop-and-create
7+ quarkus.funqy.export =helloWorld
Original file line number Diff line number Diff line change 2222public class RepositoryTest {
2323
2424 @ Inject
25- private UserRepository userRepository ;
25+ UserRepository userRepository ;
2626
2727 @ Test
2828 @ Transactional
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ quarkus.datasource.db-kind=h2
22quarkus.datasource.jdbc.url =jdbc:h2:tcp://localhost/mem:test
33quarkus.hibernate-orm.database.generation =drop-and-create
44quarkus.hibernate-orm.log.sql =true
5+ quarkus.funqy.export =helloWorld
You can’t perform that action at this time.
0 commit comments