You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Ross Black <ro...@gmail.com> on 2020/10/29 05:56:42 UTC

Sending messages within ProducerInterceptor callback?

Hi,

I could not find any documentation or posts about the behaviour of a
ProducerInterceptor if the callback '*onSend*' is used to send additional
events to Kafka, so I was hoping somebody here could help me understand its
behaviour.

I would like to send a subset of outgoing messages (being sent across
different topics) to another topic based on Kafka record headers (In an
application using the streaming api)
This would mean that the implementation of ProducerInterceptor would be
sending an additional Kafka message.

Is this a reasonable way to use the producer interceptor, or could this
cause problems ?
Our streaming app is using transactional sends .. how do messages sent from
within the 'onSend' interceptor call interact with the current
transaction?  (i.e. would they become part of the same transaction?)

Thanks,
Ross