Child pages
  • KIP-160: Augment KStream.print(), KStream.writeAsText() to allow users pass in extra parameters in the printed string
Skip to end of metadata
Go to start of metadata


Current state: Accepted

Discussion thread: here

JIRA: here

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).


KStream#print() prints records on console; But the output from KStream#print() is fixed, some user maybe want to customize it.

To do this, one good method is KStream#print(KeyValueMapper<K, V, String>).

For now, KStream.print() fixes output string as:

And some users are asking to argument KStream#print() so that they can customize the output string as KStream#print(KeyValueMapper<K, V, String>):


With above idea, we also can apply this on KStream#writeAsText() to allow user customized output string written to file.

Public Interfaces

Expanding KStream#print() and KStream#writeAsText() which also need to be extended another version of print.

Proposed Changes

A straightforward first pass is on GitHub PR#3085.

Compatibility, Deprecation, and Migration Plan

No compatibility issues foreseen.

Rejected Alternatives

Base on KStream#print() and KStream#writeAsText(), some users seek for a new option which can customize the output but not should be restricted by fixed format.

To let user can customize output we think argument KStream#print() and KStream#writeAsText() is best option for usage(Intuition) and implementation(expand exist method with adding argument).

  • No labels