Bael 5121 error handling (#11281)

* Commit source code to branch

* BAEL-5065 improvement of groupBy with complex key

* Fixed indentation
This commit is contained in:
mbarriola 2021-10-03 22:57:34 -04:00 committed by GitHub
parent b57f3c22ba
commit 6781cea471

View File

@ -29,14 +29,13 @@ public class CommodityClient {
nonBlockingStub = CommodityPriceProviderGrpc.newStub(channel);
}
public void getBidirectionalCommodityPriceLists() throws InterruptedException {
logger.info("#######START EXAMPLE#######: BidirectionalStreaming - getCommodityPriceLists from list of commodities");
final CountDownLatch finishLatch = new CountDownLatch(1);
StreamObserver<StreamingCommodityQuote> responseObserver = new StreamObserver<StreamingCommodityQuote>() {
@Override
public void onNext(StreamingCommodityQuote streamingCommodityQuote) {
public void onNext(StreamingCommodityQuote streamingCommodityQuote) {
switch (streamingCommodityQuote.getMessageCase()) {
case COMODITY_QUOTE:
@ -55,7 +54,8 @@ public void onNext(StreamingCommodityQuote streamingCommodityQuote) {
errorInfo = any.unpack(ErrorInfo.class);
logger.info("Reason:" + errorInfo.getReason());
logger.info("Domain:" + errorInfo.getDomain());
logger.info("Insert Token:" + errorInfo.getMetadataMap().get("insertToken"));
logger.info("Insert Token:" + errorInfo.getMetadataMap()
.get("insertToken"));
} catch (InvalidProtocolBufferException e) {
logger.error(e.getMessage());
}
@ -65,11 +65,11 @@ public void onNext(StreamingCommodityQuote streamingCommodityQuote) {
default:
logger.info("Unknow message case");
}
}
}
@Override
public void onCompleted() {
logger.info("Finished getBidirectionalCommodityPriceListss");
logger.info("Finished getBidirectionalCommodityPriceLists");
finishLatch.countDown();
}