Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receive the same message twice #29

Open
mfazevedo opened this issue Feb 7, 2020 · 0 comments
Open

Receive the same message twice #29

mfazevedo opened this issue Feb 7, 2020 · 0 comments

Comments

@mfazevedo
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant