Whenever a change is made to an order we’re watching, we want to notify people watching it. In our back-end solution we have one place where all data changes go: the stream-handler.
We will be making changes to our DynamoDB Stream handler to publish to a topic to indicate certain events have occurred. These new events are:
Let’s open up the stream-handler
Lambda function code and get to work! Again, you’ll notice that there are some sections noted as needing to be commented out or uncommented. Work through the file following the instructions for this, and save out your changes when done. Below there are explanations of some relevant sections which will help you to understand how we’re integrating Momento Topics with DynamoDB Streams to give real-time updates via our user interfaces.
Once again, the required code is already present in the file - you’ll just need to scan through it and uncomment/comment according to the notes that are included.
Summarizing the requirements for this additional functionality to work, you’ll see…
Don’t forget to save out your changes!
Next, we’re going to be covering the token vending machine (TVM) 👉