Skip to content
Discussion options

You must be logged in to vote

Here is a more minimal reproducer with working code based on the logic you had:

List<Integer> result = Multi.createFrom().range(0, 300)
        .log()
        .group().by(x -> x > 20)
        .onItem().transformToMultiAndMerge(
                group -> group.key()
                        ? group.collect().asList().replaceWith(1).toMulti()
                        : group.collect().asList().replaceWith(2).toMulti()
        )
        .onCompletion().invoke(() -> System.out.println("Transformation completed"))
        .ifNoItem().after(Duration.ofSeconds(2)).fail()
        .runSubscriptionOn(Executors.newSingleThreadExecutor())
        .collect().asList().await().indefinitely();

System.out.p…

Replies: 7 comments 19 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@jponge
Comment options

@jponge
Comment options

@bojanv55
Comment options

@bojanv55
Comment options

@bojanv55
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@bojanv55
Comment options

@jponge
Comment options

Comment options

You must be logged in to vote
8 replies
@jponge
Comment options

@jponge
Comment options

@bojanv55
Comment options

@jponge
Comment options

@jponge
Comment options

Comment options

You must be logged in to vote
4 replies
@bojanv55
Comment options

@bojanv55
Comment options

@jponge
Comment options

@jponge
Comment options

Answer selected by jponge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants