diff --git a/examples/vin-decode.js b/examples/vin-decode.js new file mode 100644 index 0000000..e503c7e --- /dev/null +++ b/examples/vin-decode.js @@ -0,0 +1,12 @@ +import { QueueConsumer } from 'kafka.do' + +export default QueueConsumer({ + async queue(batch, env, ctx) { + for (const message of batch.messages) { + const { vin, nextQueue } = message + // TODO: get this `decodeVIN` method implemented + const { squishVIN, year, make, model, trim, style } = await decodeVIN(vin) + env[nextQueue].send({ vin, squishVIN, year, make, model, trim, style }) + } + }, +})