Requirement : I want to list blobs from container and then copy it to other storage account using azure java sdk version 12.0.6.
I am facing same issue with listBlob and beginCopy method. Since I am also using async client, the spring boot application runs and completes but I dont get any value in listBlob from container.
I have added onSuccess or OnCompletion callbacks , but it doesnt resolve my problem? I dont want to use sync clients, because I want to copy multiple files at a time, so dont want to block these operations.
I don't want to add System.readline() or Thread.Sleep() or foreach. Does any other way can help me?
I also want the list of all the copy blobs and its status. So by using BlobCopyInfo we can do it. But that is also empty.
What can be the best way to do these async operations?
This is how I am listing blobs and inside this I have added beginCopy method.
container.listBlobs(options).subscribe(x -> {
BlobAsyncClient desblobClient = destinationContainer.getBlobAsyncClient("test");
desblobClient.copyFromUrl(sourceUrl.toString()).doOnSuccess(response ->
doSuccess(response)).doOnError(error -> fail.add("error")).subscribe();
});
How can I get all the result of copy status?