CAMEL-23300: add connectionString option to camel-couchbase endpoint#22494
CAMEL-23300: add connectionString option to camel-couchbase endpoint#22494
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
Is the problem only related to a port number? I wonder if you can use port = 0, to indicate a non default port, if that was the case. Also the description for connection string includes a port number in the example but the text says its needed when you do not have a port number for dynamic assigned port. So maybe we can allow to use :0 as port number if you want a dynamic port, and then don't need to add a new parameter. And the new parameter is also not tooling friendly. |
|
I faced an issue in camel-kafka-connectors test, and noticed that couchbase is not starting on a default port during tests. The test infra is configured to always start couch base on the default ports due to camel-couchbase limitation. In this PR I am removing that limitation (it is now possible to define a connection string), and I am updating the test-infra to start couchbase on a random port (as expected). This way, the tests in camel-kafka-connectors should be successful... hopefully! |
The component passed only hostnames to Cluster.connect(), causing the SDK to default the KV port to 11210. This made it impossible to connect when the KV port is dynamically mapped (e.g., testcontainers with random ports). The new connectionString option allows passing a full SDK connection string (e.g., couchbase://host:port) that takes precedence over hostname extraction. Also switch test-infra Couchbase container to use random ports by default (via isFixedPort) instead of hardcoded fixed ports, and update integration tests to pass the connectionString.
0ce2cdd to
c451bbb
Compare
|
🧪 CI tested the following changed modules:
All tested modules (7 modules)
|
Summary
connectionStringendpoint option tocamel-couchbaseso users can pass a full Couchbase SDK connection string (e.g.,couchbase://host:port), enabling connections when the KV port is not the default 11210isFixedPort(), so tests use random ports by default (fixed ports only whencamel.infra.fixedPort=truefor Camel JBang)connectionStringfrom the test serviceTest plan
camel-couchbasecompiles successfully-Dcouchbase-7)connectionStringis not set, behavior is unchanged