Example inputs:
| Variable | Value |
|---|---|
| key | the shared secret key here |
| message | the message to hash here |
Reference outputs for example inputs above:
| Type | Hash |
| const async = require('async'); | |
| const { ConsumerGroup } = require('kafka-node'); | |
| const consumerConfig = { | |
| kafkaHost: 'broker:9092', | |
| groupId: 'order-service', | |
| fetchMaxBytes: 100 * 1024, // 100 KB | |
| autoCommit: false, | |
| }; |
| const { ConsumerGroup } = require('kafka-node'); | |
| const options = { | |
| kafkaHost: 'broker:9092', | |
| groupId: 'order-service', | |
| fetchMaxBytes: 100 * 1024, // 100 KB | |
| autoCommit: false, | |
| }; | |
| const consumer = new ConsumerGroup(options, 'OrderTopic'); | |
| consumer.on('message', (data) => { | |
| consumer.pause(); |
| const { ConsumerGroup } = require('kafka-node'); | |
| const options = { | |
| kafkaHost: 'broker:9092', | |
| groupId: 'order-service', | |
| fetchMaxBytes: 100 * 1024, // 100 KB | |
| autoCommit: false, | |
| }; | |
| const consumer = new ConsumerGroup(options, 'OrderTopic'); |
| const { ConsumerGroup } = require('kafka-node'); | |
| const options = { | |
| kafkaHost: 'broker:9092', | |
| groupId: 'order-service', | |
| fetchMaxBytes: 100 * 1024, // 100 KB | |
| }; | |
| const consumer = new ConsumerGroup(options, 'OrderTopic'); |
| const { ConsumerGroup } = require('kafka-node'); | |
| const options = { | |
| kafkaHost: 'broker:9092', | |
| groupId: 'order-service', | |
| }; | |
| const consumer = new ConsumerGroup(options, 'OrderTopic'); | |
| consumer.on('message', (data) => { |
Example inputs:
| Variable | Value |
|---|---|
| key | the shared secret key here |
| message | the message to hash here |
Reference outputs for example inputs above:
| Type | Hash |
| const _ = require('underscore'); | |
| const { query, model, operation } = offer.eligibility; | |
| // the query is parsed because the query string in | |
| // the offer document is an undercore string template where | |
| // the variables can be replaced with the provided value | |
| const parsedQuery = JSON.parse( | |
| _.template(query)({ | |
| brokeruserId: event.data.brokeruserId, | |
| }) |
| { | |
| "meta": { | |
| "cta": { | |
| "primary": { | |
| "text": "See smallcases", | |
| "action": "DISCOVER", | |
| "query": "scids=SCAW_0001&scids=SCSB_0001&scids=SCSB_0003&scids=SCSB_0004", | |
| "path": "/discover/all" | |
| }, | |
| "secondary": { |
| { | |
| "status": "AVAILABLE", | |
| "offerCode": "FREE_AWI", | |
| "includedScids": ["SCAW_0001"], | |
| "endDate": ISODate("2020-03-13T10:00:00.000Z"), | |
| "startDate": ISODate("2020-02-23T18:30:00.000Z"), | |
| "discount": { | |
| "type": "percentage", | |
| "value": 1.0 | |
| }, |
| const readStream = s3Mumbai.getObject(workbookfile).createReadStream(); | |
| const buffers = []; | |
| readStream.on('data', data => { | |
| buffers.push(data); | |
| }); | |
| readStream.on('error', err => { | |
| next(err); | |
| }); |