Skip to content

CAMEL-23626: Remove deprecated MapReduce View from couchbase-log example - #299

Open
gnodet wants to merge 1 commit into
apache:mainfrom
gnodet:CAMEL-23626-remove-deprecated-view
Open

gnodet wants to merge 1 commit into
apache:mainfrom
gnodet:CAMEL-23626-remove-deprecated-view

Conversation

@gnodet

@gnodet gnodet commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes/fixes https://issues.apache.org/jira/browse/CAMEL-23626

The couchbase-log example was using the deprecated MapReduce View API for consuming documents from Couchbase, which does not work with the Magma storage backend (default since Couchbase 8.0).

Changes

MyRouteBuilder.java: Remove useView=true from the consumer URI. The SQL++ consumer mode is the default (useView=false), so no other option is needed.

CouchbaseTest.java:

  • Remove DesignDocument/View construction and viewIndexes().upsertDesignDocument() call
  • Remove the StorageBackend.COUCHSTORE constraint (Views required the Couchstore backend; SQL++ works with both Couchstore and Magma)
  • Add waitUntilReady() before creating the primary index (best practice)
  • Create a primary index via queryIndexes().createPrimaryIndex() so the auto-generated SQL++ query works
  • Remove System.out.println debug line

The auto-generated SQL++ query (from bucket, limit, etc.) requires a primary index to be present. This matches how the existing ConsumeSqlQueryIT in camel-couchbase sets up its test bucket.

Background

PR #189 (merged May 2026) made the test pass by adding useView=true and the deprecated View setup as a workaround. This PR reverts that direction and properly migrates to SQL++, as intended by CAMEL-23626.


Hermes Agent (Claude claude-sonnet-4-6) on behalf of Guillaume Nodet

Replace useView=true + DesignDocument/View setup with the SQL++ (N1QL)
consumer mode, which is the default (useView=false). The test now creates
a primary index on the bucket so the auto-generated SQL++ query works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant