This example combines the WSDL-first CustomerService sample from Apache CXF with Quarkus to deploy it in a serverless fashion using AWS Lambda.
Please follow the prerequisites in the Quarkus Guide.
mvn clean package
sam deploy -t target/sam.jvm.yaml -g --stack-name cxf-wsdl-first-sample-app
Confirm (with y
) that it's ok do not have authorization for testing.
-
Copy the URL (similar to
http://XXXXX.execute-api.REGION.amazonaws.com/
) from the Outputs and appendservices/customerService
. -
Run
curl -X POST -d '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cus="http://customerservice.example.com/"><soapenv:Body><cus:getCustomersByName><name>My test customername</name></cus:getCustomersByName></soapenv:Body></soapenv:Envelope>' http://XXXXX.execute-api.REGION.amazonaws.com/services/customerService | xmllint --format -
Check the logs for Init Duration:
sam logs --stack-name cxf-wsdl-first-sample-app --start-time '1min ago'
Likely it is a high value (>5000ms).
AWS Lambda SnapStart helps optimizing the coldstart time. Add the following to the Properties section of target/sam.jvm.yaml:
SnapStart:
ApplyOn: PublishedVersions
AutoPublishAlias: SnapStart
Redeploy and test as above.
mvn clean package -Dnative
Check the Quarkus guide for more detailed instructions (e.g. how to build on Windows).
sam deploy -t target/sam.native.yaml -g --stack-name cxf-wsdl-first-sample-native-app
Add ARM64 architecture depending where you are building
Architectures:
- arm64
Confirm (with y
) that it's ok do not have authorization for testing.
See above (but make sure to use the different URL).
sam logs --stack-name cxf-wsdl-first-sample-native-app --start-time '1min ago'
The duration compared to the Java runtime above is much lower.