Kafka - Ability to react on message publication result

Thanks for information about this helper!

For now we have this “hacky” working solution that support backpresurre but defenietly it is somehting that will be useful for testing or integration with non-streaming exisitng applications.

I think it could be done without breaking changes by adding Producer.flow (don’t want to think about name now) that return Either[ProducerMessage.PulbicationFailure, ProducerMessage.Results]
or have another trait like

sealed trait ResultsWithError[K, V, PassThrough] {
    def passThrough: PassThrough
  }

That could be extended both by ProducerMessage.Results and ProducerMessage.PublicationFailure
but it would be good to first check how it is done in other Alpakka connectors to don’t introduce sth that handle emitted error result in different way.

1 Like