You want to process a stream of messages in parallel, which would mean processing messages out of sequence. That would be fine in general, but you would want to process messages in a group sequentially in order. For example, you might process orders in parallel and sequencing might not matter between differen orders. But would like to process amendments to the same order in sequence.
Locking mechanism in the Resequencer is local to the JVM and will not work in the cluster; possible alternatives could be (as mentioned in Resequencer MessageGroup Lock
- Use a database level lock