Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make quarkus.couchbase.connection-string optional #5

Open
zbendhiba opened this issue Dec 8, 2021 · 1 comment
Open

Make quarkus.couchbase.connection-string optional #5

zbendhiba opened this issue Dec 8, 2021 · 1 comment

Comments

@zbendhiba
Copy link

Hello team,
I've been running first tests for our camel-quarkus couchbase extension.

There are 2 problems with the fact that the configuration : quarkus.couchbase.connection-string is mandatory.

  1. The fact that it is mandatory. Look at this example here. It is a very simple Quarkus app that has a basic Rest endpoint. The fact that the couchbase extension exists in the pom.xml file, themvn install fails. There is no usage of Couchbase here, so this doesn't have to fail. Note that this is a blocker for us at camel-quarkus, as we manage the configuration under the hood.
  2. Because of 1., we can't configure this configuration in the QuarkusTestResource classes in our integration tests

The error is

java.lang.RuntimeException: java.lang.RuntimeException: io.quarkus.runtime.configuration.ConfigurationException: SRCFG00014: The config property quarkus.couchbase.connection-string is required but it could not be found in any config source
Caused by: java.lang.RuntimeException: io.quarkus.runtime.configuration.ConfigurationException: SRCFG00014: The config property quarkus.couchbase.connection-string is required but it could not be found in any config source
Caused by: io.quarkus.runtime.configuration.ConfigurationException: SRCFG00014: The config property quarkus.couchbase.connection-string is required but it could not be found in any config source
Caused by: java.util.NoSuchElementException: SRCFG00014: The config property quarkus.couchbase.connection-string is required but it could not be found in any config source
@programmatix
Copy link
Collaborator

programmatix commented Dec 22, 2021

Hi @zbendhiba, thank you for raising this with us, and apologies it's taken a couple of weeks to get back to you.
The extension is in alpha status so it's very possible to make changes.
But, on this one, I'm somewhat confused as to the use-case. I guess my question is, why would you (or any user) need the Couchbase extension in the pom unless you're planning on using Couchbase?
There's also the question of, if the user has not specified a connection string, what do we connect to by default? Localhost could be an option, but the same question applies to the other two mandatory properties, username and password, and defaults are both less clear and less useful there.
Also we'd be swapping a clear "you haven't provided a connection string" error for a rather more unclear one related to failing to connect to a cluster. I'm concerned it would reduce UX.

Perhaps it is a possibility to not have the mandatory parameters but instead raise a runtime error if they have not been specified - but only if the Couchbase Cluster object is actually used. Presumably that would work for your use-case?

A useful next step may be for me to check out what other database Quarkus extensions do to handle this.

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

No branches or pull requests

2 participants