title: Push data from Dynamo DB to elasticsearch using java
body: <p>Hi i have created a handler in java for getting the events from dynamo DB</p>
  
  <p><strong>Here is my code</strong></p>
  
  <pre><code>package com.Lambda.dynamodb;
  
  import com.amazonaws.services.lambda.runtime.Context;
  import com.amazonaws.services.lambda.runtime.LambdaLogger;
  import com.amazonaws.services.lambda.runtime.RequestHandler;
  import com.amazonaws.services.lambda.runtime.events.DynamodbEvent;
  import com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord;
  
  public class DDBEventProcessor implements
          RequestHandler&lt;DynamodbEvent, String&gt; {
  
      public String handleRequest(DynamodbEvent ddbEvent, Context context) {
          for (DynamodbStreamRecord record : ddbEvent.getRecords()){
              System.out.println(record.getEventID());
              System.out.println(record.getEventName());
              System.out.println(record.getDynamodb().toString());
          }
          return "Successfully processed " + ddbEvent.getRecords().size() + " records.";
      }
  }
  </code></pre>
  
  <p>Lambda function able to write the events in cloudwatch but the challenge is i have to index all the streamed records to the AWS elasticsearch service endpoint and index it.
  while search through blogs i got few code samples in python and node.js but my requirement is i have to build this lambda function in java</p>
  
  <p>Could anyone please suggest how to achieve this in java lambda function?</p>