You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Status

Current stateDiscussion

Discussion thread: here

JIRA: here

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

Motivation

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:

"[" + this.streamName + "]: " +keyToPrint + ", " + valueToPrint 


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

"[" + this.streamName + "]: " + mapper.apply(keyToPrint, valueToPrint)

Public Interfaces

Argument KStream.print() which is KStream.print(KeyValueMapper<K, V, String>)

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(), 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() is best option for usage(Intuition) and implementation(expand exist method with adding argument).

  • No labels