The heritage Stock trading application based on J2EE.
Ensure the following operator is installed in cluster:
[NOTE]: In OpenShift the operators can be installed via Operator Hub integration from Administrator console.
git clone -b sko-demo https://github.com/kameshsampath/sample.daytrader8
We will refer to the cloned project sources folder as $PROJECT_HOME
.
cd $PROJECT_HOME
On clusters where heritage application sampledaytrader
is deployed, deployed MySQL:
oc apply -k k8s/db/prod
oc apply -k k8s/sampledaytrader8/prod
export DAYTRADER_ROUTE="https://$(oc get route daytrader -ojsonpath='{.spec.host}')"
Create the application DB tables,
(OR)
curl -X GET "$DAYTRADER_ROUTE/io.openliberty.sample.daytrader8/config?action=buildDBTables"
oc scale --replicas=0 deploy/sampledaytrader8
oc scale --replicas=1 deploy/sampledaytrader8
Populate the tables with sample data,
(OR)
curl -X GET "$DAYTRADER_ROUTE/io.openliberty.sample.daytrader8/config?action=buildDB"
oc apply -k k8s/kafka/prod
oc apply -k k8s/debezium/prod
NOTE: This will take few mins for the Connector to be activated
Wait for the KafkaConnect daytrader-debezium-connect
pod to be running:
watch oc get pods -n daytrader -l=strimzi.io/name=daytrader-debezium-connect
A successful KafkaConnect should show "Ready" to be "True":
oc get KafkaConnect -n daytrader daytrader-debezium -ojsonpath='{.status.conditions[?(@.type=="Ready")].status}'
NOTE: It will take few seconds for the KafkaConnector to be reconciled. Wait for few mins before you run the following commands to check the status.
Check the status of the mysql-daytrader-connector
to be ready:
oc get KafkaConnector mysql-daytrader-connector -ojsonpath='{.status.conditions[?(@.type=="Ready")].status}'
./scripts/kafka-list-topics daytrader
Will list the following topics:
__consumer_offsets
connect-cluster-configs
connect-cluster-offsets
connect-cluster-status
openshift
openshift.traderdb.accountejb
openshift.traderdb.accountprofileejb
openshift.traderdb.holdingejb
openshift.traderdb.keygenejb
openshift.traderdb.orderejb
openshift.traderdb.outboxevent
openshift.traderdb.quoteejb
schema-changes.traderdb
Note
|
If you don’t see all the topics as listed, try restarting the debezium connector pod |
oc scale --replicas=0 deploy/daytrader-debezium-connect
oc scale --replicas=1 deploy/daytrader-debezium-connect
cd k8s/debezium
docker build --no-cache <container-registry>/debezium-connect
docker push <container-registry>/debezium-connect
NOTE: Be sure to update the k8s/debezium/debezium-connect.yaml with an image from the build
oc create -f https://raw.githubusercontent.com/OpenLiberty/open-liberty-s2i/master/imagestreams/openliberty-ubi-min.json