A scala akka proof of concept using gRPC and protocol buffers (protobuf).
For more information on protobuf, see https://developers.google.com/protocol-buffers. It's a protocol that has built in streaming as opposed to REST and SOAP.
Built using akka gRPC, see https://doc.akka.io/docs/akka-grpc/current/overview.html
To generate Certificates for Https:
From gRPC-example/conf
On windows:
New-SelfSignedCertificate -Subject "localhost" -TextExtension @("2.5.29.17={text}DNS=localhost&IPAddress=127.0.0.1&IPAddress=::1") -KeyExportPolicy Exportable
then
keytool -importcert -file keys.cer -keystore keys.jks -alias "localhost"
then visit the page in the browser and download the certificate from the page (this is the public cert, generated by play).
Convert the pem file to a .der
openssl x509 -outform der -in localhost.pem -out localhost.der
You then need to add this to your cacerts file (usually in ${JAVA_HOME}/jre/lib/security/cacerts), but if you use sdkman the below location works
keytool -import -file localhost.der -keystore ${JAVA_HOME}/lib/security/cacerts -alias "localhost"
This API returns a comma separated list of prime numbers up to and including the limit (if prime).
Example request: GET /prime/17
Exampel response: 2,3,5,7,11,13,17