Skip to content

Instantly share code, notes, and snippets.

@NajeebArif
Created May 19, 2022 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NajeebArif/614f7e83903a565d1871effeacb7fe08 to your computer and use it in GitHub Desktop.
Save NajeebArif/614f7e83903a565d1871effeacb7fe08 to your computer and use it in GitHub Desktop.
@Bean
public Function<KStream<String, OrderInputMsg>, KStream<String, OrderInputMsg>> orderProcessWithSideEffect(){
return stringOrderInputMsgKStream -> {
KStream<String, String> stringStringKStream = stringOrderInputMsgKStream
.mapValues((readOnlyKey, value) -> value.getOrderId());
stringStringKStream.to("out-textMsg-topic-0", Produced.with(Serdes.String(), Serdes.String()));
return stringOrderInputMsgKStream
.mapValues((readOnlyKey, value) -> OrderProcessorService.processOrderMsg(value));
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment