Source:
private void handleBody(InputStream payload, MessageMetadata messageMetadata, MessageInfo messageInfo) throws IOException, MessageFormatException { ByteBuffer encryptionKey = messageMetadata == null ? null : messageMetadata.getEncryptionKey(); serverBlobProperties = MessageFormatRecord.deserializeBlobProperties(payload); if (messageInfo.isTtlUpdated()) { long newTtlSecs = Utils.getTtlInSecsFromExpiryMs(messageInfo.getExpirationTimeInMs(), serverBlobProperties.getCreationTimeInMs()); serverBlobProperties.setTimeToLiveInSeconds(newTtlSecs); } 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(); })); } }

Target:
private void handleBody(InputStream payload, MessageMetadata messageMetadata, MessageInfo messageInfo) throws IOException, MessageFormatException { ByteBuffer encryptionKey = messageMetadata == null ? null : messageMetadata.getEncryptionKey(); serverBlobProperties = MessageFormatRecord.deserializeBlobProperties(payload); updateTtlIfRequired(serverBlobProperties, messageInfo); 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(); })); } }