Skip to content

Instantly share code, notes, and snippets.

@theburningmonk
Created August 28, 2017 21:58
Show Gist options
  • Save theburningmonk/c99ed5d11bb849448a717f13afe0f4fa to your computer and use it in GitHub Desktop.
Save theburningmonk/c99ed5d11bb849448a717f13afe0f4fa to your computer and use it in GitHub Desktop.
// the KinesisHandler abstraction takes in a function that processes one
// record at a time so to allow us to inject the correlation IDs that
// corresponds to each record
module.exports.handler = kinesisHandler(
co.wrap(function* (record, context) {
reqContext.set("source-type", "kinesis");
let host = reqContext.get()["x-correlation-host"];
if (host) {
let uri = `https://${host}/dev/api-c`;
log.info("calling api-c", { uri });
let reply = yield http({
uri : uri,
method : 'GET'
});
log.info(reply);
}
})
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment