Beispiel #1
0
func (ec *EchoConsumer) Shutdown(shutdownType kinesis.ShutdownType,
	checkpointer *kinesis.Checkpointer) error {

	fmt.Fprintf(ec.outfile, "shutdown: %s\n", shutdownType)
	if shutdownType == kinesis.GracefulShutdown {
		if err := checkpointer.CheckpointAll(); err != nil {
			return err
		}
	}
	return nil
}
Beispiel #2
0
func (ec *EchoConsumer) ProcessRecords(records []*kinesis.KclRecord,

	checkpointer *kinesis.Checkpointer) error {
	for i := range records {
		fmt.Fprintf(ec.outfile, "process: %s\n", records[i].DataB64)
	}

	// Abort execution on checkpointing errors.  We could retry here instead if
	// we wanted.
	return checkpointer.CheckpointAll()
}