Fix KafkaDslTests for splitter race condition
It looks like `Stream.generate()` might producer items not in the expected order. So, use `Stream.toList()` to be sure in the sequence size, and then `resequence()` to be sure that items are emitted downstream in the proper sequence order.
This commit is contained in:
@@ -349,7 +349,8 @@ public class KafkaDslTests {
|
||||
public IntegrationFlow sendToKafkaFlow(
|
||||
KafkaProducerMessageHandlerSpec<Integer, String, ?> kafkaMessageHandlerTopic2) {
|
||||
return f -> f
|
||||
.splitWith(s -> s.function(p -> Stream.generate(() -> p).limit(101).iterator()))
|
||||
.splitWith(s -> s.function(p -> Stream.generate(() -> p).limit(101).toList()))
|
||||
.resequence()
|
||||
.enrichHeaders(h -> h.header(KafkaIntegrationHeaders.FUTURE_TOKEN, "foo"))
|
||||
.publishSubscribeChannel(c -> c
|
||||
.subscribe(sf -> sf.handle(
|
||||
|
||||
Reference in New Issue
Block a user