https://github.com/quarkiverse/quarkus-couchbase
Couchbase is an award-winning distributed NoSQL cloud database.
https://github.com/quarkiverse/quarkus-couchbase
couchbase quarkus-extension
Last synced: 3 months ago
JSON representation
Couchbase is an award-winning distributed NoSQL cloud database.
- Host: GitHub
- URL: https://github.com/quarkiverse/quarkus-couchbase
- Owner: quarkiverse
- License: apache-2.0
- Created: 2022-06-10T16:16:59.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2026-03-25T20:42:58.000Z (3 months ago)
- Last Synced: 2026-03-27T13:57:50.087Z (3 months ago)
- Topics: couchbase, quarkus-extension
- Language: Java
- Homepage:
- Size: 427 KB
- Stars: 8
- Watchers: 3
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Quarkus Couchbase
[](#contributors-)
[](https://search.maven.org/artifact/io.quarkiverse.couchbase/quarkus-couchbase)
[](https://opensource.org/licenses/Apache-2.0)
[](https://github.com/quarkiverse/quarkus-couchbase/actions/workflows/build.yml)
Integrates Couchbase into Quarkus.
This extension is currently in beta status. It supports:
- Dependency injecting a Couchbase `Cluster`.
- Connecting to a cluster using TLS in native mode (either with the packaged Capella certificate, or a path to a custom one specified with `quarkus.couchbase.security.trustCertificate`)
- Configuring the Cluster through `application.properties`. Currently, a minimal set of configuration options is provided.
- A dev service that starts a Couchbase server in a Docker container. With this you can develop your Quarkus app without having to install Couchbase on your machine.
- GraalVM/Mandrel/native-image.
- KV, Query, Transactions, Analytics, Search and Management operations.
- Micrometer metrics using `quarkus-micrometer`
- SmallRye Health checks (Readiness) using `quarkus-smallrye-health`
Please try it out and provide feedback, ideas and bug reports [on Github](https://github.com/quarkiverse/quarkus-couchbase/issues).
## Native Image
All main Cluster operations have been tested with our internal testing tools, however the extension remains in beta and some features may be missing or not be fully supported.
## Usage
Add it to your project:
```xml
io.quarkiverse.couchbase
quarkus-couchbase
1.3.0
```
Provide the Couchbase configuration in `application.properties`:
```properties
quarkus.couchbase.connection-string=localhost
quarkus.couchbase.username=username
quarkus.couchbase.password=password
```
To disable TestContainers, add:
```properties
quarkus.devservices.enabled=false
```
Now you can @Inject a Couchbase `Cluster` into your project:
```java
@Path("/couchbase")
public class TestCouchbaseResource {
@Inject
Cluster cluster;
@GET
@Produces(MediaType.TEXT_PLAIN)
@Path("/test")
public String run() {
// Get a reference to a particular Couchbase bucket and its default collection
var bucket = cluster.bucket("travel-sample");
var collection = bucket.defaultCollection() ;
// Upsert a new document
collection.upsert("test", JsonObject.create().put("foo", "bar"));
// Fetch and print a document
var doc = bucket.defaultCollection().get("test");
System.out.println("Got doc " + doc.contentAsObject().toString());
// Perform a N1QL query
var queryResult = cluster.query("select * from `travel-sample` where url like 'http://marriot%' and country = 'United States';");
queryResult.rowsAsObject().forEach(row -> {
System.out.println(row.toString());
});
return "success!";
}
}
```
And test http://localhost:8080/couchbase/test.
## Additional Configuration
Please refer to the [docs](https://github.com/quarkiverse/quarkus-couchbase/blob/main/docs/modules/ROOT/pages/configuration.adoc) for additional configuration options.
## Limitations
The Cluster configuration options are limited cluster credentials, and micrometer metrics emission rate.
Additional Cluster connections can be created and configured using `Cluster.connect(...)`, however not all code paths have been tested and are therefore not officially supported.
## License
All the files under `nettyhandling` directories, both in the `runtime` and `deployment` modules are
taken as-were or modified from the official [netty](https://github.com/quarkusio/quarkus/tree/main/extensions/netty) extension.
Couchbase does not intend copyright infringement or claim ownership over these files or their content.
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

Graham Pople
💻 🚧

Emilien Bevierre
💻 🚧

Michael Reiche
💻
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!