I want a reactive stream to be send to one of two ...
# spring
g
I want a reactive stream to be send to one of two sources in a reactive way. I can’t quit figure out what to do after the groupby.
Copy code
@StreamListener
    fun receive(@Input(AccountCreation.CAC) input: Flux<ConfirmAccountCreation>,
                @Output(AccountCreation.ACC) success: FluxSender,
                @Output(AccountCreation.ACF) fail: FluxSender) {
        input.map(this::getResponse)
                .groupBy{it.succes.isPresent}
                .flatMap {  }
    }
I use a data class so I always return the same, only one of them is filled,
Copy code
data class Response (val succes: Optional<AccountCreationConfirmed>,
                         val failed: Optional<AccountCreationFailed>)
at this moment I’m not really sure if I’m doing it correctly…