You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Murad Mamedov <ma...@muradm.net> on 2017/10/10 07:16:10 UTC

Kafka Streams Transformer: context.forward() from different thread

Hi, here is the question:

Transformer's transform() implementation starts some processing
asynchronously, i.e. transform() implementation returns null. Then once
asynchronous processing is complete in another thread, is it correct to
call context.forward() from that thread?

Thanks in advance

Re: Kafka Streams Transformer: context.forward() from different thread

Posted by Damian Guy <da...@gmail.com>.
Hi,
No, context.forward() always needs to be called from the StreamThread. If
you call it from another thread the behaviour is undefined and in most
cases will be incorrect, likely resulting in an exception.

On Tue, 10 Oct 2017 at 09:04 Murad Mamedov <ma...@muradm.net> wrote:

> Hi, here is the question:
>
> Transformer's transform() implementation starts some processing
> asynchronously, i.e. transform() implementation returns null. Then once
> asynchronous processing is complete in another thread, is it correct to
> call context.forward() from that thread?
>
> Thanks in advance
>