Getting Started
We recommend using SDKMAN to install the JDK, and Mandrel (the Quarkus-recommended version of GraalVM).
sdk install java 24.0.2.r22-mandrel
sdk use java 24.0.2.r22-mandrel
Creating a Quarkus App
It is recommended to generate a starter app using the Quarkus Code Starter. If you already have a Quarkus app on hand, install with Maven or Gradle as follows:
-
Maven
-
Gradle
Add this to your pom.xml
:
<dependency>
<groupId>io.quarkiverse.couchbase</groupId>
<artifactId>quarkus-couchbase</artifactId>
<version>1.1.0</version>
</dependency>
dependencies {
implementation 'io.quarkiverse.couchbase:quarkus-couchbase:1.1.0'
}
Configuring Couchbase
Configure the connection in your application.properties
file, typically located in src/main/resources
:
quarkus.couchbase.connection-string=localhost
quarkus.couchbase.username=username
quarkus.couchbase.password=password
For additional configuration options, refer to the Quarkus Configuration Guide or API Reference.
Using the Extension
The extension produces an Application-scoped Cluster
bean that can be injected using the jakarta annotation @Inject
:
public class QuarkusExample {
@Inject
Cluster cluster;
}
From there, you can use the Cluster object like you normally would with the Java SDK.
Refer to the Quarkus Guide for an example using quarkus-rest
to create HTTP endpoints.