Index: branches/APG_ES_Product/Java/nsight-product-availability/src/main/java/com/genpt/nsight/v4/service/inventory/AsyncInventoryComparator.java =================================================================== diff -u -r253702 -r255313 --- branches/APG_ES_Product/Java/nsight-product-availability/src/main/java/com/genpt/nsight/v4/service/inventory/AsyncInventoryComparator.java (.../AsyncInventoryComparator.java) (revision 253702) +++ branches/APG_ES_Product/Java/nsight-product-availability/src/main/java/com/genpt/nsight/v4/service/inventory/AsyncInventoryComparator.java (.../AsyncInventoryComparator.java) (revision 255313) @@ -107,8 +107,7 @@ return null; } - public Map> getGCPInventoryMultiProduct(Map> nsightInventoryMap, - ListenableFuture gcpInventoryFutures, + public Map> getGCPInventoryMultiProduct(ListenableFuture gcpInventoryFutures, ProductAvailabilityRequest request) { ListenableFuture future=gcpInventoryFutures; try { Index: branches/APG_ES_Product/Java/nsight-product-availability/src/main/java/com/genpt/nsight/v4/service/impl/ProductAvailabilityDetailServiceV4Impl.java =================================================================== diff -u -r254959 -r255313 --- branches/APG_ES_Product/Java/nsight-product-availability/src/main/java/com/genpt/nsight/v4/service/impl/ProductAvailabilityDetailServiceV4Impl.java (.../ProductAvailabilityDetailServiceV4Impl.java) (revision 254959) +++ branches/APG_ES_Product/Java/nsight-product-availability/src/main/java/com/genpt/nsight/v4/service/impl/ProductAvailabilityDetailServiceV4Impl.java (.../ProductAvailabilityDetailServiceV4Impl.java) (revision 255313) @@ -155,10 +155,12 @@ || nSightCache.getInvDataSvcPilotStores().toUpperCase().contains(pilotLocationPrefixAll.toUpperCase()) || nSightCache.getInvDataSvcPilotStores().toUpperCase().contains(pilotLocation.get().toUpperCase())) && availabilityServiceContextV3.getPartSet().size() <= partCountCallToGCP); - //make calls to nsight irrespective - inventoryServiceV2.setInventoryFutures(availabilityServiceContextV3); - LOGGER.debug( - splunkLogger.toString() + " Submitted NSight Queries in {} ms", (System.currentTimeMillis() - queryStartTime)); + //make calls to nsight only if data from nsight is required + if(isEnableCompare() || !isGCPRequestNeeded || !pilotSellingChannelsResponseFromGcp){ + inventoryServiceV2.setInventoryFutures(availabilityServiceContextV3); + LOGGER.debug( + splunkLogger.toString() + " Submitted NSight Queries in {} ms", (System.currentTimeMillis() - queryStartTime)); + } if (isGCPRequestNeeded) { //calls goto GCP either to single part endpoint or multipart if(useMultiProductEndpoint){ @@ -174,8 +176,11 @@ long invResponseProcessingStartTime = System.currentTimeMillis(); //Set if we should or not use the hqline abbrev logic setSkipHQLineAbbrev(availabilityServiceContextV3); - Map> nsightInventoryMap = inventoryServiceV2.processInventoryFutures(availabilityServiceContextV3); - LOGGER.debug(splunkLogger.toString() + " Processed NSight Inventory Query Response in {} ms", (System.currentTimeMillis() - invResponseProcessingStartTime)); + Map> nsightInventoryMap = null; + if(isEnableCompare() || !isGCPRequestNeeded || !pilotSellingChannelsResponseFromGcp){ + nsightInventoryMap = inventoryServiceV2.processInventoryFutures(availabilityServiceContextV3); + LOGGER.info(splunkLogger.toString() + " Processed NSight Inventory Query Response in {} ms", (System.currentTimeMillis() - invResponseProcessingStartTime)); + } //we will process the GCP responses asynchronously try { if(gcpResponseFutures!=null && !useMultiProductEndpoint) { @@ -234,7 +239,7 @@ availabilityServiceContextV3.getSitesWithInventory().clear(); if(pilotSellingChannelsResponseFromGcp){// need the data from GCP in final response Map> gcpInventoryMap = - asyncInventoryComparator.getGCPInventoryMultiProduct(ImmutableMap.copyOf(availabilityServiceContextV3.getInventory()), gcpResponseFutures, availabilityServiceContextV3.getRequest()); + asyncInventoryComparator.getGCPInventoryMultiProduct(gcpResponseFutures, availabilityServiceContextV3.getRequest()); if(gcpInventoryMap==null) gcpInventoryMap = new HashMap<>(); availabilityServiceContextV3.setGcpInventory(gcpInventoryMap); Index: branches/APG_ES_Product/Java/nsight-product-availability/src/main/resources/application-localgcpqa.yml =================================================================== diff -u -r254240 -r255313 --- branches/APG_ES_Product/Java/nsight-product-availability/src/main/resources/application-localgcpqa.yml (.../application-localgcpqa.yml) (revision 254240) +++ branches/APG_ES_Product/Java/nsight-product-availability/src/main/resources/application-localgcpqa.yml (.../application-localgcpqa.yml) (revision 255313) @@ -167,7 +167,7 @@ inventory: pubsubtopic: inventory-verification-pub gcpServiceAccount: C:/napa/source/Enterprise_Integration/ESB/branches/Build_Deploy_Utilities/GCP/ServiceAccounts/QA/gpc-q-invpltfrm-esb-gsm.encrypted - availabilityURL: https://inventory-api.qa.genpt.com/v1/inventory + availabilityURL: https://inventory-api.use4.qa.np.gcp.genpt.net/v1/inventory delivery: freeDeliveryURL: https://shipping-delivery-api.use4.qa.np.gcp.genpt.net/sd-delivery-options-svc/v1/delivery-options/free/list Index: branches/APG_ES_Product/Java/nsight-product-availability/src/main/resources/application-localgcpuat.yml =================================================================== diff -u -r254959 -r255313 --- branches/APG_ES_Product/Java/nsight-product-availability/src/main/resources/application-localgcpuat.yml (.../application-localgcpuat.yml) (revision 254959) +++ branches/APG_ES_Product/Java/nsight-product-availability/src/main/resources/application-localgcpuat.yml (.../application-localgcpuat.yml) (revision 255313) @@ -157,7 +157,7 @@ timeout: 10000 inventory: gcpServiceAccount: /opt/esb/config/nsight-product-availability-iv/gpc-s-invpltfrm-esb-gsm.encrypted - availabilityURL: https://inventory-api.use4.stress.genpt.net/v1/inventory + availabilityURL: https://inventory-api.use4.stress.np.gcp.genpt.net/v1/inventory delivery: freeDeliveryURL: https://shipping-delivery-api.use4.stress.np.gcp.genpt.net/sd-delivery-options-svc/v1/delivery-options/free/list