Andrea Cosentino created CAMEL-24347:
----------------------------------------

             Summary: camel-google-firestore: listCollections ignores the 
configured documentId and the realtime queue is unbounded
                 Key: CAMEL-24347
                 URL: https://issues.apache.org/jira/browse/CAMEL-24347
             Project: Camel
          Issue Type: Bug
          Components: camel-google
            Reporter: Andrea Cosentino
            Assignee: Andrea Cosentino


1. {{listCollections}} is the only document operation that does not fall back 
to the configured documentId:
{code:java}
// GoogleFirestoreProducer.java:307
String documentId = 
exchange.getIn().getHeader(GoogleFirestoreConstants.DOCUMENT_ID, String.class);
{code}
Every other operation uses {{determineDocumentId()}} (:387-396), which falls 
back to {{configuration.getDocumentId()}}. So 
{{google-firestore:coll?documentId=x&operation=listCollections}} silently lists 
the root collections instead of the document's sub-collections.

2. The realtime consumer queues without bound:
{code:java}
// GoogleFirestoreConsumer.java:52,96
private final Queue<Exchange> pendingExchanges = new ConcurrentLinkedQueue<>();
...
pendingExchanges.add(exchange);
{code}
Snapshot events are appended as they arrive and only drained on the next poll, 
so a busy collection or a slow route grows the queue without limit.

3. {{queryCollection}} and {{listDocuments}} inject {{_id}}/{{_path}} into the 
document data map (:247-248, :295-296), overwriting document fields with those 
names. The consumer exposes the same values as headers instead - the producer 
should be consistent with it.

Found during a source audit of the {{components/camel-google}} module family 
against main @ c3b01310be15.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to