Source:
private void handleBody(InputStream payload, MessageMetadata messageMetadata) throws IOException, MessageFormatException { ByteBuffer encryptionKey = messageMetadata == null ? null : messageMetadata.getEncryptionKey(); serverBlobProperties = MessageFormatRecord.deserializeBlobProperties(payload); ByteBuffer userMetadata = MessageFormatRecord.deserializeUserMetadata(payload); if (encryptionKey == null) { operationResult = new GetBlobResultInternal(new GetBlobResult(new BlobInfo(serverBlobProperties, userMetadata.array()), null), null); } else { progressTracker.initializeDecryptionTracker(); logger.trace("Submitting decrypt job for {}", blobId); decryptJobMetricsTracker = new CryptoJobMetricsTracker(routerMetrics.decryptJobMetrics); decryptJobMetricsTracker.startTracker(); long startTimeMs = System.currentTimeMillis(); cryptoJobHandler.submitJob( new DecryptJob(blobId, encryptionKey.duplicate(), null, userMetadata, cryptoService, kms, decryptJobMetricsTracker, (DecryptJob.DecryptJobResult result, Exception exception) -> { decryptJobMetricsTracker.startResponseProcessing(); logger.trace("Handling decrypt job callback results for {}", blobId); routerMetrics.decryptTimeMs.update(System.currentTimeMillis() - startTimeMs); if (exception == null) { logger.trace("Successfully updating decrypt job callback results for {}", blobId); operationResult = new GetBlobResultInternal( new GetBlobResult(new BlobInfo(serverBlobProperties, result.getDecryptedUserMetadata().array()), null), null); progressTracker.setDecryptionSuccess(); } else { decryptJobMetricsTracker.incrementOperationError(); logger.trace("Exception thrown on decryption for {}", exception, blobId); setOperationException( new RouterException("Exception thrown on decrypting the content for " + blobId, exception, RouterErrorCode.UnexpectedInternalError)); progressTracker.setDecryptionFailed(); } decryptJobMetricsTracker.completeResponseProcessing(); routerCallback.onPollReady(); })); } }

Target:
private void handleBody(InputStream payload, MessageMetadata messageMetadata) throws IOException, MessageFormatException { ByteBuffer encryptionKey = messageMetadata == null ? null : messageMetadata.getEncryptionKey(); serverBlobProperties = MessageFormatRecord.deserializeBlobProperties(payload); ByteBuffer userMetadata = MessageFormatRecord.deserializeUserMetadata(payload); if (encryptionKey == null) { operationResult = new GetBlobResultInternal(new GetBlobResult(new BlobInfo(serverBlobProperties, userMetadata.array()), null), null); } else { progressTracker.initializeDecryptionTracker(); logger.trace("Submitting decrypt job for {}", blobId); decryptJobMetricsTracker.onJobSubmission(); long startTimeMs = System.currentTimeMillis(); cryptoJobHandler.submitJob( new DecryptJob(blobId, encryptionKey.duplicate(), null, userMetadata, cryptoService, kms, decryptJobMetricsTracker, (DecryptJob.DecryptJobResult result, Exception exception) -> { decryptJobMetricsTracker.onJobResultProcessingStart(); logger.trace("Handling decrypt job callback results for {}", blobId); routerMetrics.decryptTimeMs.update(System.currentTimeMillis() - startTimeMs); if (exception == null) { logger.trace("Successfully updating decrypt job callback results for {}", blobId); operationResult = new GetBlobResultInternal( new GetBlobResult(new BlobInfo(serverBlobProperties, result.getDecryptedUserMetadata().array()), null), null); progressTracker.setDecryptionSuccess(); } else { decryptJobMetricsTracker.incrementOperationError(); logger.trace("Exception thrown on decryption for {}", exception, blobId); setOperationException( new RouterException("Exception thrown on decrypting the content for " + blobId, exception, RouterErrorCode.UnexpectedInternalError)); progressTracker.setDecryptionFailed(); } decryptJobMetricsTracker.onJobResultProcessingComplete(); routerCallback.onPollReady(); })); } }