kinesis
kinesis copied to clipboard
Receive the same message twice
Hi everyone, I'm just finished my project and started to running it, but I'm receiving the same message twice.
Here is my code:
function connectToOrderStream(){
var kinesisSource = kinesis.stream({
name: CONSTANT.KINESIS_STREAM_NAME,
oldest: true,
credentials:{
accessKeyId: CONSTANT.AWS_ACCESS_KEY_ID,
secretAccessKey: CONSTANT.AWS_SECRET_ACCESS_KEY
}
})
var getData = new Transform({objectMode: true})
getData._transform = function(record, encoding, next) {
var delivery = JSON.parse(record.Data.toString())
if(shouldTreatDelivery(delivery)){
console.log('>', delivery.payload.idDelivery)
}
next()
}
kinesisSource.pipe(getData)
}
The producer of stream already checked on his side, and for them, the message it's being sending only one time.