This demo requires PCF Dev and Apache Geode.
- Start CF
cf dev start
- Login to CF
cf login -a https://api.local.pcfdev.io --skip-ssl-validation
- Create MySQL and RabbitMQ services
cf create-service p-mysql 512mb mysql-dev cf create-service p-rabbitmq standard rabbitmq-dev
- Push
jdbc-event-source-app
,jdbc-event-processor-app
, andgeode-sink-app
cf push -f geode-sink-app/manifest-dev.yml cf push -f jdbc-event-processor-app/manifest-dev.yml cf push -f jdbc-event-source-app/manifest-dev.yml
- Open
gfsh
terminal - Start locator and server from
gfsh
start locator --name=locator configure pdx --auto-serializable-classes=com\.example\.springoneplatform\.scs\.demo\.model\.pdx\.* --read-serialized=true start server --name=server
- Create regions
create region --name=customer --type=PARTITION --skip-if-exists create region --name=customerOrder --type=PARTITION --skip-if-exists create region --name=item --type=PARTITION --skip-if-exists
- Run schema.sql to create tables
- Run data.sql to insert
CUSTOMER
,ITEM
,CUSTOMER_ORDERS
, andORDER_ITEM
rows - Start a
gfsh
terminal and connect to the locatorconnect
- Query the regions to see that the data was extracted from the MySQL database, transformed to the proper types, and
loaded into Geode
query --query="select * from /customer" query --query="select * from /customerOrder" query --query="select * from /item"
- Run trigger.sql to create the triggers that will insert
DB_EVENT
rows when data in other tables is inserted, updated, or deleted - Run delta-data.sql to do the following:
DELETE
anORDER_ITEM
fromorder1
DELETE
aCUSTOMER_ORDER
fromcustomer1
(willDELETE
allORDER_ITEM
rows fororder2
first)INSERT
aITEM
(will add a new item (Stapler) that can be included in an order)INSERT
aCUSTOMER_ORDER
and `ORDER_ITEM (will create an order for the new item created above)
- Query the regions again to see that the data that was deleted from the MySQL database was also deleted from Geode
query --query="select * from /customer" query --query="select * from /customerOrder" query --query="select * from /item"
In order to run gfsh
commands you need to open a gfsh
terminal. It's recommended that you create a working
directory that you open gfsh
from because starting locators and servers creates directories and files.
mkdir tmp && cd tmp
gfsh
Once in the gfsh
terminal:
connect
connects the gfsh session to the clusterlist members
displays all members (locators, servers) that are part of the clusterlist regions
displays all regions that have been createdquery --query="<oql here>"
executes a query (OQL help)