You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Guozhang Wang (JIRA)" <ji...@apache.org> on 2018/06/04 05:33:00 UTC

[jira] [Commented] (KAFKA-5924) Add the compose method to the Kafka Stream API

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

Guozhang Wang commented on KAFKA-5924:
--------------------------------------

[~Crystark] Is the new API introduced since 1.0 as {{Topology}} and {{StreamsBuilder}} satisfying this requirement?

> Add the compose method to the Kafka Stream API
> ----------------------------------------------
>
>                 Key: KAFKA-5924
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5924
>             Project: Kafka
>          Issue Type: Wish
>          Components: streams
>            Reporter: Laurent T
>            Priority: Minor
>              Labels: needs-kip
>
> Hi,
> I'm referencing RxJava for it's [compose method|https://github.com/ReactiveX/RxJava/wiki/Implementing-Your-Own-Operators#transformational-operators] which is very handy. It would be great if the Streams API would give us something similar. It's pretty easy to implement and allows to have much more clarity to the code (it avoids breaking the linearity of the code when you want to reuse parts of the stream topology). e.g.
> Without compose:
> {code:java}
> TopologyUtils
>     .myUtil(topology
>         .map(...)
>         .flatMap(...)
>         .through(...))
>     .map(...)
>     .to(...);
> {code}
> With compose:
> {code:java}
> topology
>     .map(...)
>     .flatMap(...)
>     .through(...)
>     .compose(TopologyUtils::myUtil)
>     .map(...)
>     .to(...);
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)