This repository contains several reactive services to be deployed in Kubernetes.
- temperature-service is a service simulating a temperature sensor. This is basic Vert.x with callbacks, multiple verticles and communication over the event bus. (Vert.x web, Kotlin support)
- temperature-gateway is a service that aggregates temperature data from the available temperature services. RxJava2/Kotlin simplifies the reasoning for doing concurrent HTTP requests. (Vert.x web / web client / service discovery, RxJava2)
- zlack is a chat application, exposing an API and a reactive VueJS interface. It provides real-time message deliveries and shows how the Vert.x event bus can be extended to client-side applications and offer a unified message-passing programming model. (Vert.x web / web client / SockJS event bus bridge / RxJava 2 / MongoDB / VueJS)
- temperature-to-zlack-service is a service that gathers all temperatures from the gateway, and notifies in the Zlack chat of all sensors having a temperature above a threshold. It uses Kotlin coroutines to show how a more traditional "synchronous-style" programming model can be used to coordinate operations. (Vert.x web client / Kotlin coroutines / minimal liveness reporting)
The kubernetes folder contains resource descriptors and notes for Kubernetes and minikube
.
Building all services should be as simple as:
./gradlew assemble
While developing a Vert.x service you can have live-reload, as in:
./gradlew :temperature-gateway:vertxRun
The following assumes a local testing environment with minikube
.
Building all Docker images and creating Kubernetes resources can then be done using:
./deploy-to-kube.sh
...or calling the Gradle task that delegates to this script:
./gradlew deployToKube
If you are not deploying to minikube
:
- all sub-projects have corresponding
Dockerfile
files, and - all Kubernetes resource files are in kubernetes/.
This was originally written by Julien Ponge and is distributed under the terms of the Apache License Version 2.0
Copyright 2018 Julien Ponge
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Contributions are welcome, please use GitHub pull requests!