Skip to content

"Guarantee" processing order of received messages #17

@deldrid1

Description

@deldrid1

Bullwinkle is tremendously helpful for making agent/device comms more robust, but I've run into a corner case today with retries.

The basic issue is that I am not defending well against receiving messages out of order, which will happen if you have a dropped packet and then retry and are sending messages fairly regularly (~once/second seems to do it for me). My code was architected to be robust against dropped messages, but receiving a message after I've already processed a newer one is something that I don't handle very well...

I need to dig into the code a bit, but I'm guessing that an ever incrementing sequence number could be added to each message. If you notice on the partner that a message was skipped, you could wait for some time (half the timeout?) for the retry to be successful and then have those messages handled in the correct order for the .on() code. There might also be some opportunity for prioritizing sending retries vs. regular .send messages on the side where messages originate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions