# Kafka - Ability to react on message publication result

**URL:** <https://discuss.akka.io/t/kafka-ability-to-react-on-message-publication-result/6208>\
**Category:** Akka Streams & Alpakka\
**Tags:** kafka, streams\
**Created:** [April 4, 2020, 3:30pm UTC](https://discuss.akka.io/t/kafka-ability-to-react-on-message-publication-result/6208 "2020-04-04T15:30:47Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![sebarys](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@sebarys](https://discuss.akka.io/u/sebarys)\
**Post date:** [April 9, 2020, 12:20pm UTC](https://discuss.akka.io/t/kafka-ability-to-react-on-message-publication-result/6208/8 "2020-04-09T12:20:04Z")

</div>

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

```auto
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.

---

_[View the full topic](https://discuss.akka.io/t/kafka-ability-to-react-on-message-publication-result/6208)._
