This is an automated email from the ASF dual-hosted git repository.

oscerd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new 2714beb62 Fix #542: correct the couchbase-source statement example 
(#3009)
2714beb62 is described below

commit 2714beb62ed0a3626488d2cc056ce2bad13eef3e
Author: Andrea Cosentino <[email protected]>
AuthorDate: Mon Sep 7 11:37:22 2026 +0200

    Fix #542: correct the couchbase-source statement example (#3009)
    
    The example shipped in #3007 -- SELECT * FROM `travel-sample` LIMIT 10 --
    does not work, and fails in the worst way: the source polls happily and
    emits nothing.
    
    Two requirements, both found by running the Kamelet against a live cluster
    while writing the integration test in #3008:
    
    CouchbaseConsumer reads row.getString("__id") and skips any row without
    that field, logging a warning rather than failing. A query that does not
    alias the document id as __id therefore produces no exchanges at all.
    
    The consumer runs the query through scope.query(...), so the keyspace
    resolves as <bucket>._default.<what-you-wrote>. Naming the bucket gives
    <bucket>._default.<bucket> and fails with "Keyspace not found"; the
    collection, normally _default, is what belongs there.
    
    The example now matches what the integration test actually uses, and the
    description states both requirements so the next person does not have to
    rediscover them from a silent no-op.
    
    
    Claude-Session: https://claude.ai/code/session_01Tz352mt7yzGWLfvYTBo2Dk
    
    Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
---
 kamelets/couchbase-source.kamelet.yaml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kamelets/couchbase-source.kamelet.yaml 
b/kamelets/couchbase-source.kamelet.yaml
index 8a80f28f6..c91fb9e31 100644
--- a/kamelets/couchbase-source.kamelet.yaml
+++ b/kamelets/couchbase-source.kamelet.yaml
@@ -76,9 +76,13 @@ spec:
         type: string
       statement:
         title: N1QL Statement
-        description: The N1QL query to run against the bucket on each poll. 
Used unless useView is true.
+        description: >-
+          The N1QL query to run against the bucket on each poll. Used unless 
useView is true.
+          The query runs in the bucket scope, so the keyspace is the 
collection - use _default
+          for the default collection rather than the bucket name. It must also 
alias the document
+          id as __id, because rows without that field are skipped.
         type: string
-        example: "SELECT * FROM `travel-sample` LIMIT 10"
+        example: "SELECT META().id AS __id, * FROM _default"
       useView:
         title: Use View
         description: Poll a MapReduce view instead of running the N1QL 
statement.

Reply via email to