Serverless architecture with an example

If we have got your attention already, let's take a very simple example to bring the point home. We will try to create a simple greetings example, where the function as a service implementation will greet the user. We will use the AWS Lambda function for this example.

Let's create our class with an example greeting function:

/*** Class to implement simple hello world example**/public class LambdaMethodHandler implements RequestStreamHandler {  public void handleRequest(InputStream inputStream, OutputStream  outputStream, Context context) throws IOException   {    BufferedReader reader = new BufferedReader(new InputStreamReader    (inputStream));    JSONObject responseJson = new JSONObject(); String name = "Guest"; ...

Get Design Patterns and Best Practices in Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.