An application to demonstrate the capabilities of VMware Tanzu Application Platform.
This application acts as a sensor that generates and sends sensor data via asynchronous messaging. The data is consumed and displayed on a dashboard by an application available here.
Spring Cloud Stream, a framework built on top of Spring Boot and Spring Integration, is used as a flexible messaging abstraction. Spring Cloud Stream supports a variety of binder implementations. In this case, we are using the one for RabbitMQ.
So as a prerequisite to run this application with VMware Tanzu Application Platform, you need a RabbitMQ cluster running in the same Kubernetes namespace (e.g. provisioned via the RabbitMQ Cluster Operator for Kubernetes).
kubectl apply -f - << EOF
apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
metadata:
name: rmq-1
EOF
Binding an application workload to a backing service such as a RabbitMQ queue is one of the most important use cases within the context of the VMware Tanzu Application Platform. This use case is made possible by the Service Binding Specification for Kubernetes. With the service binding that is defined in the workload.yaml, the credentials that are required for the connection to the RabbitMQ cluster are magically injected as environment variables into the container.
To deploy this application on VMware Tanzu Application Platform, execute the following command:
tanzu apps workload create spring-sensors-sensor -f tap/workload.yaml