Judking
Judking

Reputation: 6371

How can I make storm sending tuples in order?

When I write a storm topology, I found that the order of tuples is not always the same as the one the spout emits.(the function of the spout is to read a file in line and send the line to a bolt without Thread.sleep(), so this procedure will be very fast).

Could anyone tell me how I can ensure the order of tuples which is emitted by a spout or a bolt? Thanks a lot!

Upvotes: 0

Views: 904

Answers (1)

Vor
Vor

Reputation: 35109

You may want to take a look at Trident topology

Trident solves this problem by doing two things:

    Each batch is given a unique id called the "transaction id". If a batch is retried it will have the exact same transaction id.
    State updates are ordered among batches. That is, the state updates for batch 3 won't be applied until the state updates for batch 2 have succeeded.

Upvotes: 3

Related Questions