Created
May 16, 2022 21:45
-
-
Save NajeebArif/1dc356c5781a2b53a20eae7ef858cb41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private KeyValue<String, Tuple<Throwable, OrderInputMsg>> getTransformedMessage(String key, OrderInputMsg value) { | |
try{ | |
final OrderInputMsg msg = OrderProcessorService.processOrderMsg(value); | |
final Tuple<Throwable, OrderInputMsg> inputMsgTuple = new Tuple<>(null, msg); | |
return new KeyValue<>(key, inputMsgTuple); | |
}catch (Exception e){ | |
final Tuple<Throwable, OrderInputMsg> inputMsgTuple = new Tuple<>(e, value); | |
return new KeyValue<>(key, inputMsgTuple); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment