22:white_check_mark : Setup and start Gemfire database (Source)<br >
33:white_check_mark : Setup and start Redis Enterprise database (Target)<br >
44:white_check_mark : Setup and start Redis Connect<br >
5- :white_check_mark : Perform Initial load and CDC with Redis Connect<br >
5+ :white_check_mark : Perform Initial load and CDC with Redis Connect on Strings<br >
6+ :white_check_mark : Perform Initial load with Redis Connect on complex data types<br >
67
78# Prerequisites
89Docker compatible [ * nix OS] ( https://en.wikipedia.org/wiki/Unix-like ) and [ Docker] ( https://docs.docker.com/get-docker ) installed.
@@ -14,10 +15,10 @@ i.e.</br>
1415wget -c https://github.com/redis-field-engineering/redis-connect-dist/archive/main.zip && \
1516mkdir -p redis-connect/demo && \
1617unzip main.zip " redis-connect-dist-main/examples/gemfire/*" -d redis-connect && \
17- cp -R redis-connect/redis-connect-dist-main/examples/gemfire/demo/* redis-connect/demo && \
18- rm -rf main.zip redis-connect/redis-connect-dist-main && \
1918cd redis-connect && \
19+ cp -R redis-connect-dist-main/examples/gemfire/demo/* ./demo && \
2020chmod a+x demo/* .sh && \
21+ rm -rf ./redis-connect-dist-main && rm ../main.zip && \
2122cd demo
2223```
2324
@@ -365,3 +366,158 @@ demo$
365366
366367</p >
367368</details >
369+
370+ -------------------------------
371+
372+ ## More Complex Data Types
373+
374+ This demo also includes an example of using more complex Java types within Gemfire. The ` extlib ` folder contains two jar files:
375+ 1 . ` gemfire-pojo-1.0.jar `
376+ 2 . ` redis-connect-custom-stage-sample-*.jar `
377+
378+ The first jar contains the code for a ` redis.gemfire.Customer ` class, which is a very simple POJO containing a name and age. The second jar is a build of [ redis-connect-custom-stage] ( https://github.com/redis-field-engineering/redis-connect-custom-stage-sample ) containing some custom staging code to transform arbitrary data types (in this case a ` Customer ` ) into a type that redis-connect can serialize to ` JSON ` .
379+
380+ ### Configure Job
381+
382+ On [ http://localhost:8282/swagger-ui/index.html ] ( ) go to:
383+
384+ ** Create Job Configuration** - ` /connect/api/vi/job/config/{jobName} `
385+ <br >_ For the customer POJO, use the sample ` customer-pojo-job.json ` configuration: <a href =" /examples/postgres/demo/config/samples/payloads/cdc-job.json " >Gemfire</a >
386+ <br >Use '** customer-pojo-job** ' as the _ ** jobName** _
387+ <br ><br ><img src =" /images/quick-start/Redis Connect Save Job Config.png " style =" float : right ;" width = 700px height = 375px/ >
388+ <br >
389+
390+ Or use ` curl ` to create the ` customer-pojo-job ` configuration:
391+
392+ ` $ curl -v -X POST "http://localhost:8282/connect/api/v1/job/config/customer-pojo-job" -H "accept: */*" -H "Content-Type: multipart/form-data" -F "file=@config/samples/payloads/customer-pojo-job.json;type=application/json" `
393+
394+ ### Start Load Job
395+
396+ <details >
397+ <summary >INSERT customer records into gemfire</summary >
398+ <p >
399+
400+ ``` bash
401+ $ ./load_customers.sh
402+ Inserting records in session region..
403+
404+ (1) Executing - connect --locator localhost[10334]
405+
406+ Connecting to Locator at [host= localhost, port= 10334] ..
407+ Connecting to Manager at [host= 749a3ef94bf8, port= 1099] ..
408+ Successfully connected to: [host= 749a3ef94bf8, port= 1099]
409+
410+ You are connected to a cluster of version: 1.15.1
411+
412+
413+ (2) Executing - put --key=" customer1" --value=(" name" :" Jack" ," age" :35) --region=customer --value-class=redis.gemfire.Customer
414+
415+ Result : true
416+ Key Class : java.lang.String
417+ Key : customer1
418+ Value Class : redis.gemfire.Customer
419+ Old Value : null
420+
421+
422+ (3) Executing - put --key=" customer2" --value=(" name" :" Alice" ," age" :36) --region=customer --value-class=redis.gemfire.Customer
423+
424+ Result : true
425+ Key Class : java.lang.String
426+ Key : customer2
427+ Value Class : redis.gemfire.Customer
428+ Old Value : null
429+
430+
431+ (4) Executing - put --key=" customer3" --value=(" name" :" Bob" ," age" :37) --region=customer --value-class=redis.gemfire.Customer
432+
433+ Result : true
434+ Key Class : java.lang.String
435+ Key : customer3
436+ Value Class : redis.gemfire.Customer
437+ Old Value : null
438+
439+
440+ (5) Executing - put --key=" customer4" --value=(" name" :" Carol" ," age" :38) --region=customer --value-class=redis.gemfire.Customer
441+
442+ Result : true
443+ Key Class : java.lang.String
444+ Key : customer4
445+ Value Class : redis.gemfire.Customer
446+ Old Value : null
447+
448+
449+ (6) Executing - put --key=" customer5" --value=(" name" :" David" ," age" :39) --region=customer --value-class=redis.gemfire.Customer
450+
451+ Result : true
452+ Key Class : java.lang.String
453+ Key : customer5
454+ Value Class : redis.gemfire.Customer
455+ Old Value : null
456+
457+
458+ (7) Executing - put --key=" customer6" --value=(" name" :" Eva" ," age" :40) --region=customer --value-class=redis.gemfire.Customer
459+
460+ Result : true
461+ Key Class : java.lang.String
462+ Key : customer6
463+ Value Class : redis.gemfire.Customer
464+ Old Value : null
465+
466+
467+ (8) Executing - put --key=" customer7" --value=(" name" :" Frank" ," age" :41) --region=customer --value-class=redis.gemfire.Customer
468+
469+ Result : true
470+ Key Class : java.lang.String
471+ Key : customer7
472+ Value Class : redis.gemfire.Customer
473+ Old Value : null
474+
475+
476+ (9) Executing - put --key=" customer8" --value=(" name" :" Grace" ," age" :42) --region=customer --value-class=redis.gemfire.Customer
477+
478+ Result : true
479+ Key Class : java.lang.String
480+ Key : customer8
481+ Value Class : redis.gemfire.Customer
482+ Old Value : null
483+
484+
485+ (10) Executing - put --key=" customer9" --value=(" name" :" Henry" ," age" :43) --region=customer --value-class=redis.gemfire.Customer
486+
487+ Result : true
488+ Key Class : java.lang.String
489+ Key : customer9
490+ Value Class : redis.gemfire.Customer
491+ Old Value : null
492+
493+
494+ (11) Executing - put --key=" customer10" --value=(" name" :" Ivy" ," age" :44) --region=customer --value-class=redis.gemfire.Customer
495+
496+ Result : true
497+ Key Class : java.lang.String
498+ Key : customer10
499+ Value Class : redis.gemfire.Customer
500+ Old Value : null
501+
502+ done
503+ ```
504+
505+ </p >
506+ </details >
507+
508+ ** Start Job -** ` /connect/api/vi/job/transition/start/{jobName}/{jobType} `
509+ <br >Use '** load** ' as _ ** jobType** _ and '** customer-pojo-job** ' as the _ ** jobName** _
510+ <br ><br ><img src =" /images/quick-start/Redis Connect Start Job.png " style =" float : right ;" width = 700px height = 375px/ >
511+
512+ ** Or Use ` curl ` to start the initial load for ` customer-pojo-job ` ** <br >
513+ ` $ curl -X POST "http://localhost:8282/connect/api/v1/job/transition/start/customer-pojo-job/load" -H "accept: */*" `
514+
515+ ### Query Data in Redis
516+
517+ Your data is now available in Redis at the keys ` {gemfireRegionName}:{gemfireKeyName} ` and can be queried in Redis using the redis-cli:
518+
519+
520+ ``` bash
521+ $ redis-cli -p 14000 JSON.GET customer:customer1 $
522+ " [{\" name\" :\" Jack\" ,\" age\" :35}]"
523+ ```
0 commit comments