This example shows how to work with a simple Apache Camel application using Spring Boot and a Master component.
-
build the project:
mvn clean package
-
Then run the first camel node:
mvn spring-boot:run
-
in a separate shell, run the second camel node:
mvn spring-boot:run
-
create an OpenShift project:
oc new-project camel-master
-
create dedicated service account:
oc create sa camel-sa
-
create project role to manage leases:
oc create role camel-leases --verb=get,list,watch,create,update,patch,delete --resource=leases -n camel-master
-
create project role to manage pods:
oc create role camel-pods --verb=get,list,watch,create,update,patch,delete --resource=pods -n camel-master
-
add roles to service account:
oc policy add-role-to-user camel-leases -z camel-sa -n camel-master --role-namespace camel-master
oc policy add-role-to-user camel-pods -z camel-sa -n camel-master --role-namespace camel-master
-
run the build and deploy using profile
openshift
:mvn clean package -Popenshift
the generated deployment config will scale to 2 pods so that we can verify that only one will be the cluster leader, so it will be the only one consuming the message
If you hit any problem using Camel or have some feedback, then please let us know.
We also love contributors, so get involved :-)
The Camel riders!