start Kafka server, start Informix database, start Neo4j server, start processor app
run command docker cp docker-ifx/viewdata.sql tc_informix:/
and docker cp docker-ifx/delete.sql tc_informix:/
so you can use them to verify group data and delete group data.
- Open Neo4j Browser(
http://localhost:7474
) to insert group data. run the following command:CREATE (g:Group {id: "55ba651a-6524-4e08-be04-06485f6a8d6f", name: "group-1", privateGroup: true, selfRegister: true, createdBy: "admin"}) RETURN g
Run commandMATCH (g:Group {id: "55ba651a-6524-4e08-be04-06485f6a8d6f"}) RETURN g
to verify group has been insert into neo4j - start kafka-console-producer to write messages to
groups.notification.create
topic:bin/kafka-console-producer.sh --broker-list localhost:9092 --topic groups.notification.create
- write message:
{ "topic": "groups.notification.create", "originator": "groups-api", "timestamp": "2018-03-24T00:00:00", "mime-type": "application/json", "payload": { "id": "55ba651a-6524-4e08-be04-06485f6a8d6f", "name": "group-1", "privateGroup": true, "selfRegister": true, "createdBy": "admin" } }
- check the app console to verify message has been properly handled.
- open a new console to run command
docker exec -ti tc_informix bash -c "dbaccess - /viewdata.sql"
to verify data has been inserted into group table, mark down the id field. - Open Neo4j Browser(
http://localhost:7474
), Run commandMATCH (g:Group {id: "55ba651a-6524-4e08-be04-06485f6a8d6f"}) RETURN g
to verify oldId field has been updated. - Try to write a message that will cause error(duplicate name):
{ "topic": "groups.notification.create", "originator": "groups-api", "timestamp": "2018-03-24T00:00:00", "mime-type": "application/json", "payload": { "id": "55ba651a-6524-4e08-be04-06485f6a8d7f", "name": "group-1", "privateGroup": true, "selfRegister": true, "createdBy": "admin" } }
- You will see error message in app console.
- start kafka-console-producer to write messages to
groups.notification.update
topic:bin/kafka-console-producer.sh --broker-list localhost:9092 --topic groups.notification.update
- write message(
uses the id value(a number) you got in step 5 as oldId value
):{ "topic": "groups.notification.update", "originator": "groups-api", "timestamp": "2018-03-24T00:00:00", "mime-type": "application/json", "payload": { "oldId": <id_in_step5>, "name": "new-group-1", "description": "new-description", "domain": "www.topcoder.com", "privateGroup": false, "selfRegister": false, "updatedBy": "user" } }
- check the app console to verify message has been properly handled.
- open a new console to run command
docker exec -ti tc_informix bash -c "dbaccess - /viewdata.sql"
to verify data has been updated. - start kafka-console-producer to write messages to
groups.notification.delete
topic:bin/kafka-console-producer.sh --broker-list localhost:9092 --topic groups.notification.delete
- write message(
uses the id value(a number) you got in step 5 as oldId value
):{ "topic": "groups.notification.delete", "originator": "groups-api", "timestamp": "2018-03-24T00:00:00", "mime-type": "application/json", "payload": { "oldId": <id_in_step5>} }
- check the app console to verify message has been properly handled.
- open a new console to run command
docker exec -ti tc_informix bash -c "dbaccess - /viewdata.sql"
to verify data has been deleted.
For clear the environment:
clear the group table in Informix:
docker exec -ti tc_informix bash -c "dbaccess - /delete.sql"
clear the group nodes in Neo4j:
Open Neo4j Browser(http://localhost:7474
) and run MATCH (g:Group) DELETE g