[ 
https://issues.apache.org/jira/browse/KAFKA-4830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15894842#comment-15894842
 ] 

Guozhang Wang commented on KAFKA-4830:
--------------------------------------

[~mjuchli] As for this JIRA itself, the goal is to allow users to customize the 
output format even with its own pass-in parameters instead of restricting with

{code}
"[" + this.streamName + "]: " + keyToPrint + " , " + valueToPrint
{code}

However the prefix of "[streamName]" will still be preserved. I.e. we can add a 
new function in `KStream` as you mentioned. As for "KStreamPrinter", as 
Matthias mentioned, it is better to first cleanup this class as an special impl 
of `KStreamPeek` and then this special impl can be extended with a `mapper` 
parameter to implement the above API.

> Augment KStream.print() to allow users pass in extra parameters in the 
> printed string
> -------------------------------------------------------------------------------------
>
>                 Key: KAFKA-4830
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4830
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>            Reporter: Guozhang Wang
>              Labels: needs-kip, newbie
>
> Today {{KStream.print}} use the hard-coded result string as:
> {code}
> "[" + this.streamName + "]: " + keyToPrint + " , " + valueToPrint
> {code}
> And some users are asking to augment this so that they can customize the 
> output string as {{KStream.print(KeyValueMapper<K, V, String>)}} :
> {code}
> "[" + this.streamName + "]: " + mapper.apply(keyToPrint, valueToPrint)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to