This quickstart shows how to connect a Spring-Boot application to an AMQ Online SaaS message broker and use JMS messaging between two Camel routes using OpenShift.
It is assumed that:
-
Your OpenShift environment is configured for Fabric8 Maven Workflow, if not you can refer to my blog post Understand Fuse 7.5 on OpenShift.
-
You can easily setup the fuse on openshift using script install_fis_7.5.sh
-
-
AMQ Online is installed on OpenShift environment,if not you can refer to my blog post Understand AMQ Online
-
You can easily setup the AMQ Online on OpenShift using script install-amq-online.sh
-
To setup the test project you can run the following script.
Tip
|
If the project where the amq-online operator installed is not amq-online-infra project, then modify the name in the script (you need to have admin access to the project) |
$ src/main/resources/openshift/create_demo_app.sh
Important
|
After you run this command please take note of last two lines in output |
For example output
oc get routes console -o 'jsonpath={.spec.host}' -n amq-online-infra
console-amq-online-infra.apps.cluster-91e5.sandbox671.opentlc.com (1)
oc get addressspace demo-space -o 'jsonpath={.status.endpointStatuses[?(@.name=="messaging")].externalHost}' -n amqp-demo
messaging-6c9efcc-amq-online-infra.apps.cluster-91e5.sandbox671.opentlc.com (2)
-
Console Url, which you will use to see the queue, topics, connections,etc
-
Messaging Endpoint which you will use to connect your application
-
Modify the amqp.serviceName key in application.properties to the value you of Messaging Endpoint
-
Then the following command will run the application
mvn spring-boot:run -Dspring.profiles.active=dev