Open zbendhiba opened 2 years ago
Reproducer with resource class and test class
The list queues API request is invalid as there's no value for the include
query param:
http://localhost:49242/devstoreaccount1?comp=list&include=
You need to set header QueueConstants.QUEUES_SEGMENT_OPTIONS
with a simple value of new QueuesSegmentOptions()
should be enough.
Arguably it's a bug in the Azure SDK or the Camel component that allows the empty segment options. So we could look to improve things here.
@jamesnetherton this worked for you? It still failing for me.
I looked at the Standalone Java I've created last week with Azure SDK, the method with SegmentOption=null is working fine.
This is working in Standalone Java + Azure SDK :
List<QueueItem> list = queueServiceClient.listQueues(null, null, Context.NONE).stream().collect(Collectors.toList());
for(QueueItem queue:list){
// Output each queue name.
System.out.println("************" + queue.getName());
}
In camel quarkus, the only part that is failing is the stream
on the result. If I debug the queueServiceClient.listQueues(null, null, Context.NONE)
, I can see on JVM mode that there is an object in the response.
I need to test with camel standalone, to check if it works fine with it.
BTW the official documentation points to this method https://github.com/Azure/azure-sdk-for-java/blob/8b6aadc2bede033373766e4f84ce331b68c2f19e/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java#L229, that puts NULL
Also, for some reason this is what I have with or without setting the QueueSegmentOptions
http://localhost:49178/devstoreaccount1?comp=REDACTED&include=REDACTED
which seems to be different from your test
Ah sorry, seems I tricked myself into thinking it was working.
I also had options.setIncludeMetadata(true)
, which does make the test pass.
@jamesnetherton This use case work, and could be a workaround.
I'll add the test in camel core project to check if it's a general issue.
After many times testing, it turns out that is a pure Azurite bug. Using real Azure account fixes this issue.
Filled an Azurite issue : https://github.com/Azure/Azurite/issues/1426
Are we using the newest Azure SDK?
@ppalaga we're not, but I did my standalone Java tests based on latest version of SDK. On camel-core main too, that uses latest version. And the behavior is just the same as the version used in CQ. There's no bug with SDK, only with Azurite response that misses some bits.
It's impossible to iterate on the Azure PageIterable object with Camel Quarkus. So the usage of
stream
in this line is failing, even on JVM mode:Example of error on JVM mode when we try the azure code on Quarkus runtime: