Retrieve Data From Dynamo DB Using Dynamo DB Connector In Mule

 

In This tutorial we will demonstrate how can we Retrieve Data From Dynamo DB Using Dynamo DB Connector In Mule 4.

Get Item : The GetItem operation returns a set of attributes for the item with the given primary key. If there is no matching item GetItem does not return any data and there will be no Item element in the response.

GetItem provides an eventually consistent read by default. If your application requires a strongly consistent read, set ConsistentRead to true. Although a strongly consistent read might take more time than an eventually consistent read, it always returns the last updated value

please refer to below to get more detail:

https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_GetItem.html

Prerequisite: Read access to get the items from amazon dynamo db

Create a project in anypoint studio and configure the listener

Drag and drop the get Item Operation from mule palette and configure the Amazon Dynamo DB Connector

Retrieve Data From Dynamo DB Using Dynamo DB Connector In Mule

 

Create the payload to pass the primary key to query the table

%dw 2.0
output application/json
---
{
	"EMPLOYEEID":{"S":"111"}
}

 

Configure the table name,Key, Attributes as shown below

Retrieve Data From Dynamo DB Using Dynamo DB Connector In Mule

 

Deploy and test the project from POSTMAN, data retrieved successfully from dynamo db table

Sample application :Download sample project

  
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
 
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.


Share this:
Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Avinash
Avinash
4 years ago

Can you please explain how to achieve the same result by Query connector of DynamoDB in Mule 4 ?