Created
August 28, 2017 21:58
-
-
Save theburningmonk/c99ed5d11bb849448a717f13afe0f4fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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