Skip to content

Quarkus sample code integrate with Google Cloud PubSub in Kotlin.

License

Notifications You must be signed in to change notification settings

JimmiHsieh/quarkus-reactive-pubsub

Repository files navigation

Quarkus Example for Google Cloud Pub/Sub

  • This project uses Quarkus and SmallRye Reactive Message to integrate with Google Cloud Pub/Sub.
  • There is no official document to describe how to use Cloud Pub/Sub connector in SmallRye Reactive Message. Here is what I found a way to do it.

Prerequisite

In order to run this application, you must have a Google account and a Billing Account associated to this Google account.
Install Java 17 SDK if you haven't already installed it.
Install Google Cloud SDK.
Create Service Account with roles/pubsub.admin.

Setup

In your Gradle Kotlin project, add the dependency to your build.gradle.kts:

** Should use the same version as smallrye-reactive-messaging-api

implementation("io.smallrye.reactive:smallrye-reactive-messaging-gcp-pubsub:3.22.1")

Running the application in dev mode

You can run your application in dev mode that enables live coding using:

export PROJECT_ID=$(gcloud config get-value project)
export GOOGLE_APPLICATION_CREDENTIALS=/${replace_it_with_your_credentials_path}
./gradlew quarkusDev

Try it

curl --location 'http://localhost:8080/hello'

Related Guides

  • SmallRye Reactive Messaging (guide): Produce and consume messages and implement event driven and data streaming applications
  • RESTEasy Reactive (guide): A JAX-RS implementation utilizing build time processing and Vert.x. This extension is not compatible with the quarkus-resteasy extension, or any of the extensions that depend on it.
  • Kotlin (guide): Write your services in Kotlin
  • SmallRye Health (guide): Monitor service health
  • Kubernetes (guide): Generate Kubernetes resources from annotations

RESTEasy Reactive

Easily start your Reactive RESTful Web Services

Related guide section...

SmallRye Health

Monitor your application's health using SmallRye Health

Related guide section...

About

Quarkus sample code integrate with Google Cloud PubSub in Kotlin.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published