简体   繁体   中英

Debugging and tracing RxJava with lambda, Intellij IDEA

I am working in a project which written entirely using lambda expressions, and to make things harder, it mixed with RxJava , I included a very simple piece of that code

       return tokenExchangeClient.requestToken(identity)
                .doOnError( e -> logError(e,TOKEN_REQUEST_FAILED))
                .map(AccessTokenResponseModel::getAccessToken)
                .flatMap(token -> paymentAdapter.initiatePayment(paymentRequest, token))
                .doOnError(e -> logError(e,PAYMENTS_POST_FAILED))
                .flatMap(InternalToExternal::convertToTransferInitiationResponse);  

How can I debug and trace this lambda with RxJava like the old and simple java days ?

Just place a breakpoint at the beggining of the lambda and run the project in debug mode, then when the debug stop in the breakpoint you can press the " F8 " key to go step to step in the lambda.

I'll link you the official documentation about breakpoints > https://www.jetbrains.com/help/idea/using-breakpoints.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM