You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/03/13 07:30:48 UTC

[PR] CAMEL-22090: Fix couchbase consumer when Jackson is on classpath [camel]

gnodet opened a new pull request, #21965:
URL: https://github.com/apache/camel/pull/21965

   ## Summary
   
   - Fixed the Couchbase consumer to avoid using the shaded Jackson `JsonNode` class for view key deserialization, using `String.class` instead which works regardless of which Jackson serializer is active
   - Extracted `ClusterEnvironment` creation into a dedicated `createClusterEnvironment()` method with documentation explaining why `DefaultJsonSerializer` is explicitly configured to prevent the Couchbase SDK from auto-detecting non-shaded Jackson on the classpath
   - Added a unit test verifying the `ClusterEnvironment` uses `DefaultJsonSerializer` (wrapped in `JsonValueSerializerWrapper`) instead of the auto-detected `JacksonJsonSerializer`
   
   ## Details
   
   When Jackson is on the classpath (e.g., via camel-jackson, Spring Boot, or Quarkus), the Couchbase SDK auto-detects it and uses `JacksonJsonSerializer` backed by the non-shaded Jackson `ObjectMapper`. This causes deserialization failures because the consumer code was using `row.keyAs(JsonNode.class)` where `JsonNode` is the shaded class (`com.couchbase.client.core.deps.com.fasterxml.jackson.databind.JsonNode`), which the non-shaded Jackson cannot deserialize into.
   
   The fix addresses this at two levels:
   1. **Consumer level**: Replaced `row.keyAs(JsonNode.class).get().asText()` with `row.keyAs(String.class).orElse(null)`, eliminating the dependency on shaded Jackson types for key extraction
   2. **Environment level**: Kept the `DefaultJsonSerializer` configuration (from CAMEL-22083) but refactored it into a well-documented, testable method
   
   ## Test plan
   
   - [x] Unit tests pass (27 tests, 0 failures)
   - [ ] Integration tests with Couchbase container (require testcontainers)
   - [ ] Manual verification with Jackson on the classpath


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-22090: Fix couchbase consumer when Jackson is on classpath [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21965:
URL: https://github.com/apache/camel/pull/21965#issuecomment-4053323585

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `build-all`, `build-dependents`, `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-22090: Fix couchbase consumer when Jackson is on classpath [camel]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet merged PR #21965:
URL: https://github.com/apache/camel/pull/21965


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org