Example of basic RabbitMQ app running on Cloud Foundry.
Build and push the app.
If needed, set your local respository in the Pom.
mvn clean package
cf push
At this point publish and get activities will result in a HTTP 500 error.
The commands below will create a service using the OOB pre-provisioned multi-tenant RabbitMQ cluster.
cf create-service p-rabbitmq standard rabbitmq-springboot-svc
Bind to the app and restage to pick up the env vars:
cf bind-service rabbitmq-springboot rabbitmq-springboot-svc
cf restage rabbitmq-springboot
Connect to the app FQDN and use the UI to publish onto the queue and get messages from the queue.
The folling code snippit will publish onto the queue and get messages from the queue. Make sure to export the correct app FQDN.
export APP_FQDN=<app-fqdn>
curl -k -X POST -d "value=testing" "https://${APP_FQDN}/publish"
curl -k "https://${APP_FQDN}/get"