public static void PersonStream(DynamoDBContext ddbc) { AWSDynamoTableConfig config = new AWSDynamoTableConfig("PersonEvents", typeof(string), "EventID", 1, 5); // Create a DynamoDBContext DynamoDBContext ddbcEvents = DynamoDBContext.GetDynamoDBContext( RegionEndpoint.EUWest1, "##################", // Access key "#########################################", // Secret key config // Table config ); var stream = ddbc.GetAWSDynamoDBStream(AWSDynamoDBIteratorType.LATEST); while (true) { Thread.Sleep(5000); Console.WriteLine("- - - - - - - - - - - - - - - - "); Console.WriteLine("Getting records"); var records = stream.GetRecords <Person>(); foreach (var record in records) { Console.WriteLine("EventName: " + record.EventName + " || Person ID: " + record.NewImage.Id + " || SequenceNumber: " + record.SequenceNumber); ddbcEvents.Insert(record); } } }
static void Main(string[] args) { AWSDynamoTableConfig config = new AWSDynamoTableConfig("Persons", typeof(string), "Id", 5, 5); // Create a DynamoDBContext DynamoDBContext ddbc = DynamoDBContext.GetDynamoDBContext( RegionEndpoint.EUWest1, "##################", // Access key "#########################################", // Secret key config // Table config ); Console.WriteLine("Press enter to exit..."); Console.ReadLine(); }
static void Main(string[] args) { AWSDynamoTableConfig config = new AWSDynamoTableConfig("Persons", typeof(string), "Id", 5, 5); // Create a DynamoDBContext DynamoDBContext ddbc = DynamoDBContext.GetDynamoDBContext( RegionEndpoint.EUWest1, "###################", // Access key "#######################################", // Secret key config // Table config ); while (true) { Thread.Sleep(1000); var person = PersonFactory.getRandomPerson(); ddbc.Insert(person); Console.WriteLine("Inserting person: " + person.Id); } }