This is a flavor of RESThooks implementation, but on Quarkus, the Supersonic Subatomic Jakarta Framework.
Originally, this was created to tryout AOT-like native images for Serverless Lambdas on AWS.
In case you were wondering, this code is:
- Originally, written on a Mac with Development Container, in Georgia, US.
- Written in Jakarta with Visual Studio Code
- Built and packaged with Quarkus and GraalVM, thanks to Docker
- Pub/Sub as Fanout on Amazon EventBridge
- Served on AWS, thanks to Terraform
You can also run this repo locally by following these repetitive steps:
- You want to ensure this repo is cloned to your local machine, and
- Open it in Visual Studio Code.
See pre-built dev container images in Microsoft Registry for other variations that suites your hardware.
At present this codebase is published to AWS using Terraform. First, you want to make sure you are logged into aws
CLI and Mock Server is up and running. Mocking with the Postman API is a good source to setup a few API endpoints with a mock server.
With Visual Studio Code:
-
Refresh AWS credentials;
# Set defaults export AWS_{DEFAULT_,,EB_}PROFILE="<profile-name>" export AWS_PROFILE_REGION="$(aws configure get region)" # Export credentials eval "$(aws configure export-credentials --format env)"
-
Package the lambda functions;
./mvnw clean install package -Dnative
-
Switch to
/deployments/backend
folder to create AWS resources -
Create a
terraform.tfvars
file according to.tfvars.schema
-
Paste values from your Mock Server
-
Publish
cd deployments/backend terraform init -upgrade # Optional. terraform plan terraform apply -auto-approve
That's it.
To verify if everything's working as expected, Mocking with the Postman is one of the faster ways to setup a few API endpoints and a mock server. Then you can receive notifications!
With Visual Studio Code:
- Switch to
/tests/e2e
folder to tryout HTTP requests - Create a
.env
file according to.env.schema
- Paste the values from AWS and your Mock Server
- Send messages with
post-messages.http
file
The source code is license under the MIT license.