0

Facing this issue when using comsos v4 java async apis. I am seeing eTag value, if used container.readItem(), but not in container.queryItems(). when I check response header data in queryItem response, eTag is coming as null. Can anyone please tell me, if it's cosmos API bug or am I missing something?

        responseDocuments
                .byPage(1)
                .log()
                .flatMap(person-> {
                    person.getResults().stream().forEach(document-> {
                        if(document.get("optInStatus") != null) {
                        } else {
                            list.add(gson.fromJson(gson.toJson(document, LinkedHashMap.class), Person.class));
                        }

                    });
                    System.out.println(person.getResponseHeaders().get("etag")); // coming as null
                    System.out.println(person.getContinuationToken());
                    System.out.println(person.getResponseHeaders().toString());
                    return Flux.empty();
                })
                .blockLast();
José Pedro
  • 1,097
  • 3
  • 14
  • 24

1 Answers1

0

if it's cosmos API bug or am I missing something?

There isn't anything you missed and I don't think this is a bug. I tried the REST API. It also won't give the _eTag property in the response header. If you need that system property when you query items, you can add that property to your POJO.

Steve Johnson
  • 8,057
  • 1
  • 6
  • 17