- Two namespaces in Openshift
- Two brokers AMQ cluster in each namespace
- Topic
demo1
in each broker - Dual mirror (Disaster recovery) configuration of brokers ActiveMQ Broker Connections
OpenShift 4.12 up and running
- Login to OpenShift
oc login --token=XXX --server=https://XXX:6443
- Install operators
oc apply -k operators
- Create namespaces
amq-mtl
andamq-lvl
. Create brokersamq-mtl
andamq-lvl
withdemo1
topic address in corresponding namespaces
oc apply -k brokers
cd client-amqp
oc project amq-mtl
- Consumer Build and deploy consumer
mvn clean package -Dnamespace=amq-mtl -Dname=consumer -Dquarkus.openshift.env.vars.connection=amqp://amq-mtl-all-0-svc:61616
- Producer Build and deploy producer
mvn clean package -Dnamespace=amq-mtl -Dname=producer -Dquarkus.openshift.env.vars.connection=amqp://amq-mtl-all-0-svc:61616
Message sent
oc get pods --selector application=producer -o name | xargs oc logs
Result:
2023-04-13 18:40:13,181 INFO [producer] (Camel (camel-1) thread #1 - timer://demo) 1681411211518 : V_1
2023-04-13 18:40:13,804 INFO [producer] (Camel (camel-1) thread #1 - timer://demo) 1681411211518 : V_2
2023-04-13 18:40:14,800 INFO [producer] (Camel (camel-1) thread #1 - timer://demo) 1681411211518 : V_3
Message received
oc get pods --selector application=consumer -o name | xargs oc logs
result
2023-04-13 18:40:13,162 INFO [consumer] (Camel (camel-1) thread #1 - JmsConsumer[demo1]) 1681411211518 : V_1
2023-04-13 18:40:13,172 INFO [consumer] (Camel (camel-1) thread #1 - JmsConsumer[demo1]) 1681411211518 : V_1
2023-04-13 18:40:13,802 INFO [consumer] (Camel (camel-1) thread #1 - JmsConsumer[demo1]) 1681411211518 : V_2
2023-04-13 18:40:13,817 INFO [consumer] (Camel (camel-1) thread #1 - JmsConsumer[demo1]) 1681411211518 : V_2
2023-04-13 18:40:14,798 INFO [consumer] (Camel (camel-1) thread #1 - JmsConsumer[demo1]) 1681411211518 : V_3
2023-04-13 18:40:14,808 INFO [consumer] (Camel (camel-1) thread #1 - JmsConsumer[demo1]) 1681411211518 : V_3