You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Guozhang Wang (JIRA)" <ji...@apache.org> on 2019/07/17 16:46:00 UTC

[jira] [Resolved] (KAFKA-8218) IllegalStateException while accessing context in Transformer

     [ https://issues.apache.org/jira/browse/KAFKA-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guozhang Wang resolved KAFKA-8218.
----------------------------------
    Resolution: Not A Problem

> IllegalStateException while accessing context in Transformer
> ------------------------------------------------------------
>
>                 Key: KAFKA-8218
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8218
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 2.1.1
>            Reporter: Bartłomiej Kępa
>            Priority: Major
>
> Custom Kotlin implementation of Transformer throws 
> {code}
> java.lang.IllegalStateException: This should not happen as headers() should only be called while a record is processed
> {code}
> while being plugged into the stream topology that actually works. Invocation of transform() method has valid arguments (Key and GenericRecord).
> The exception is being thrown because in our implementation of transform we need to access headers from context.  
> {code:java}
>  override fun transform(key: String?, value: GenericRecord): KeyValue<String?, GenericRecord> {
>   val headers = context.headers()
>   ...
> }
>  {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)