Quarkus Couchbase Extension

Overview

Quarkus Couchbase Extension

Integrates Couchbase into Quarkus.

This extension is currently in alpha status. It supports:

  • Dependency injecting a Couchbase Cluster.
  • Configuring the Cluster through application.properties. Currently a minimal set of configuration options is provided.
  • Graal/native-image, though so far it has been minimally tested with basic cases.

Please try it out and provide feedback, ideas and bug reports.

Usage

Add it to your project:

<dependency>
  <groupId>com.couchbase</groupId>
  <artifactId>quarkus-couchbase</artifactId>
  <version>1.0.0-alpha.1</version>
</dependency>

Provide the Couchbase configuration in application.properties:

quarkus.couchbase.connection-string=localhost
quarkus.couchbase.username=username
quarkus.couchbase.password=password

Now you can @Inject a Couchbase Cluster into your project:

@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.

Comments
  • Add a dns-serv configuration option

    Add a dns-serv configuration option

    At the moment, only connectionString, username, and password are configurable options. When following the example in this readme, I get a dns-srv error even though the app works:

     DNS SRV lookup failed (null), trying to bootstrap from given hostname directly.: java.lang.NullPointerException
    

    This confuses developers new to Couchbase, especially with Quarkus continuous testing and live reload. Two things:

    1. Please add a quarkus.couchbase.dns-serv-enabled option so I can avoid this error (I'd likely set it to false when using dev mode via %dev.quarkus.couchbase.dns-serv-enabled=false). Also, name the property whatever you feel is the proper name :-)
    2. If #1 is implemented, please auto-configure this option or default to false in dev mode, maybe test mode too.

    I admit that I'm still learning Couchbase and that I don't fully understand the impact of this request, but my initial developer experience was hampered due to this issue.

    opened by jclingan 6
  • Make quarkus.couchbase.connection-string optional

    Make quarkus.couchbase.connection-string optional

    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
    
    opened by zbendhiba 1
  • Couchbase Quarkus Kubernetes Readiness Probe

    Couchbase Quarkus Kubernetes Readiness Probe

    Quarkus clients libraries that connect to backend services (like datasource, kafka, mongodb, and elasticsearch) add a Kubernetes readiness probe when quarkus-smallrye-health extension is an application dependency. The probe tests for the backend service, and returns either a DOWN or UP status depending on the state of the backend service(s).

    Service clients that support this feature offer a property setting to enable/disable the feature (defaulting to enabled), with a property pattern like quarkus.couchbase.health.enabled=false.

    Given the investment in the Couchbase Operator, this would be a nice addition to complement the Operator.

    opened by jclingan 1
  • Configure Couchbase panel within the Quarkus Dev UI

    Configure Couchbase panel within the Quarkus Dev UI

    The Quarkus Dev UI is a developer web UIto quickly visualize extensions and interact with their non-code features. Adding useful links within the Couchbase panel would really help reduce the Couchbase learning curve for Quarkus developers.

    Off the top of my head, I can think of three very useful panel features that are low-overhead to create:

    1. A link to the Couchbase Java SDK docs
    2. A link to the Couchbase Web UI (maybe dashboard specifically, but I'll leave that up to you)
    3. A link to the to-be-created (hopefully) Quarkus guide specifically.

    Here is the default UI for the example app in the README, and the auto-generated Couchbase panel is empty with a missing link to the Couchbase Quarkus guide:

    Dev UI for Couchbase example
    opened by jclingan 1
  • Add a Quarkus Couchbase Dev Service

    Add a Quarkus Couchbase Dev Service

    With Dev Services, Quarkus apps can automatically connect to backend services auto-started with TestContainers, especially persistence stores, with zero setup or configuration. This really helps Quarkus developers get started with backend services quickly and easily. Many Quarkus developers will be new to Couchbase, so I think this will really help Couchbase gain Quarkus developer adoption.

    opened by jclingan 1
Owner
Couchbase Labs
Couchbase Labs
Quarkus extension for launching an in-process Wiremock server

Quarkus extension for running Wiremock in DEVELOPMENT mode This extension is currently not published in any maven repository. If you want to test this

Quarkiverse Hub 5 Dec 30, 2022
A proof-of-concept serverless full-text search solution built with Apache Lucene and Quarkus framework.

Lucene Serverless This project demonstrates a proof-of-concept serverless full-text search solution built with Apache Lucene and Quarkus framework. ✔️

Arseny Yankovsky 38 Oct 29, 2022
Code for Techniques for Maintainable Quarkus Applications

stichingfacts project This project uses Quarkus, the Supersonic Subatomic Java Framework. If you want to learn more about Quarkus, please visit its we

Ana Maria Mihalceanu 12 Apr 19, 2022
Source Code for 'Pro Java Microservices with Quarkus and Kubernetes' by Nebrass Lamouchi

Apress Source Code This repository accompanies Pro Java Microservices with Quarkus and Kubernetes by Nebrass Lamouchi (Apress, 2021). Download the fil

Apress 24 Oct 31, 2022
API de Clientes - Java+Quarkus

com.clientes.api Project This project uses Quarkus, the Supersonic Subatomic Java Framework. If you want to learn more about Quarkus, please visit its

null 5 Oct 12, 2021
A simple quarkus app with hibernate as ORM, used to show the features of Hibernate Search

beer-manager-hibernate-search Project This project uses Quarkus, the Supersonic Subatomic Java Framework. If you want to learn more about Quarkus, ple

Sedona Solutions 3 Jan 6, 2022
A project to study Quarkus.

quarkus-studies Project This project uses Quarkus, the Supersonic Subatomic Java Framework. If you want to learn more about Quarkus, please visit its

Sidnei Luiz Becker 2 Dec 24, 2021
Quarkus JAX-RS App Deployed as AWS Lambda with AWS CDK

MicroProfile with Quarkus as AWS Lambda Function deployed with Cloud Development Kit (CDK) v2 for Java A lean starting point for building, testing and

Adam Bien 30 Dec 15, 2022
Quarkus: Supersonic Subatomic Java.

Quarkus - Supersonic Subatomic Java Quarkus is a Cloud Native, (Linux) Container First framework for writing Java applications. Container First: Minim

QuarkusIO 11.2k Jan 3, 2023
This repository shows how to natively extend Quarkus with a custom ConfigSource to use AWS AppConfig values when injecting config properties with @ConfigProperty.

Using AWS AppConfig in a custom MicroProfile ConfigSource This repository shows how to natively extend Quarkus with a custom ConfigSource to use AWS A

AWS Samples 8 May 19, 2022
This is a sample application demonstrating Quarkus features and best practices

Quarkus Superheroes Sample Table of Contents Introduction Project automation GitHub action automation Application Resource Generation Running Locally

QuarkusIO 123 Jan 6, 2023
An estate management api based on the hexagonal architecture, built on top of Quarkus

An estate management api based on the hexagonal architecture, built on top of Quarkus

Mudi Lukman 2 Mar 30, 2022
Develop your GitHub Actions in Java with Quarkus

Quarkus GitHub Action Develop your GitHub Actions in Java with Quarkus Interested in GitHub Apps? Have a look at the Quarkus GitHub App extension. Qua

Quarkiverse Hub 7 Jan 6, 2023
Curso da Stack Quarkus - Alura

bitcoin Project This project uses Quarkus, the Supersonic Subatomic Java Framework. If you want to learn more about Quarkus, please visit its website:

null 2 Oct 29, 2021
Extension module to properly support datatypes of javax.money

Jackson Datatype Money Jackson Datatype Money is a Jackson module to support JSON serialization and deserialization of JavaMoney data types. It fills

Zalando SE 217 Jan 2, 2023
A spatial extension of the H2 database.

H2GIS H2GIS is a spatial extension of the H2 database engine in the spirit of PostGIS. It adds support for managing spatial features and operations on

OrbisGIS 186 Oct 19, 2022
Spring Integration provides an extension of the Spring programming model to support the well-known Enterprise Integration Patterns (EIP)

Spring Integration Code of Conduct Please see our Code of conduct. Reporting Security Vulnerabilities Please see our Security policy. Checking out and

Spring 1.4k Dec 30, 2022
Copy as XMLHttpRequest BurpSuite extension

Copy as XMLHttpRequest BurpSuite extension The extension adds a context menu to BurpSuite that allows you to copy multiple requests as Javascript's Xm

Alexey Pronin 30 Dec 25, 2022
An MIT AI2 extension to allows developers to show media style notifications for their applications.

Media Notifications An MIT AI2 extension to allows developers to show media style notifications for their applications.

Shreyash Saitwal 5 Jan 7, 2023