This project is a proof of concept to "port" over our Java FIT Performer to use the Couchbase Quarkus extension. It starts a gRPC server which executes FIT Driver (gRPC client) requests against a Couchbase server.
You'll need:
- quarkus-performer (FIT Performer, a gRPC Server)
- transaction-fit-performer (FIT Driver, a gRPC Client)
- Couchbase Server (Local or Capella)
- Mandrel 24.0.2.r22 or Graal 22.0.2 (or latest for both)
Using SDKMAN! is recommended to install and manage different JDKs.
Start a Couchbase Server
With Docker:
docker run -d --name couchbase -p 8091-8097:8091-8097 -p 11210:11210 couchbase:latestHead to https://localhost:8091 to finish setting up your cluster.
Clone this repository and cd into it:
git clone git@github.com:couchbaselabs/quarkus-performer.git
cd quarkus-performerTo install/use Mandrel, do:
sdk install java 25.0.1.r25-mandrel
sdk use java 25.0.1.r25-mandrelNote that
sdk use java {version}will use that version in your current shell. Opening a new terminal session will use the default Java version, which you can specify withsdk default java {version}.
Open application.properties in quarkus-performer/src/main/resources and modify the credentials to the ones you chose when setting up your Cluster (or change the connection string if your Cluster is remote).
Cluster configurations in
application.propertiesare set at build-time and cannot be modified at run-time. Changing them will require re-compiling.
Still with quarkus-performer open in a terminal, run:
mvn clean install -Dnative -DskipTestsOnce it is compiled, run the performer runner located in /target.
./target/quarkus-performer-1.0.0-SNAPSHOT-runnerClone transactions-fit-performer:
git clone git@github.com:couchbaselabs/transactions-fit-performer.gitOpen the project in another IDE window and follow the README.md to configure FITConfiguration.json.
Right click and run any test in test-driver/src/test/java/com/couchbase.
The application can be packaged using:
./mvnw packageIt produces the quarkus-run.jar file in the target/quarkus-app/ directory.
Be aware that it’s not an über-jar as the dependencies are copied into the target/quarkus-app/lib/ directory.
The application is now runnable using java -jar target/quarkus-app/quarkus-run.jar.
If you want to build an über-jar, execute the following command:
./mvnw package -Dquarkus.package.jar.type=uber-jarThe application, packaged as an über-jar, is now runnable using java -jar target/*-runner.jar.
You can create a native executable using:
./mvnw package -DnativeOr, if you don't have GraalVM installed, you can run the native executable build in a container using:
./mvnw package -Dnative -Dquarkus.native.container-build=trueYou can then execute your native executable with: ./target/quarkus-couchbase-demo-1.0.0-SNAPSHOT-runner
If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.