Adding docs for CADI
[dmaap/datarouter.git] / README.md
1 # DMAAP_DATAROUTER\r
2 \r
3 ## OVERVIEW\r
4 \r
5 The Data Routing System project is intended to provide a common framework by which data producers can make data available to data consumers and a way for potential consumers to find feeds with the data they require.\r
6 The delivery of data from these kinds of production systems is the domain of the Data Routing System. Its primary goal is to make it easier to move data from existing applications that may not have been designed from the ground up to share data.\r
7 The Data Routing System is different from many existing platforms for distributing messages from producers to consumers which focus on real-time delivery of small messages (on the order of a few kilobytes or so) for more\r
8 \r
9    Provisioning is implemented as a Java servlet running under Jetty in one JVM\r
10 \r
11    Provisioning data is stored in a MariaDB database\r
12 \r
13    The backup provisioning server and each node is informed any time provisioning data changes\r
14 \r
15    The backup provisioning server and each node may request the complete set of provisioning data at any time\r
16 \r
17    A Node is implemented as a Java servlet running under Jetty in one JVM\r
18 \r
19 Assumptions\r
20     For 95% of all feeds (there will be some exceptions):\r
21 \r
22     Number of Publishing Endpoints per Feed: 1 – 10\r
23 \r
24     Number of Subscribers per Feed: 2 – 10\r
25 \r
26     File Size: 105 – 1010 bytes\r
27 \r
28     with a distribution towards the high end\r
29 \r
30     Frequency of Publishing: 1/day – 10/minute\r
31 \r
32     Lifetime of a Feed: months to years\r
33 \r
34     Lifetime of a Subscription: months to years\r
35 \r
36 \r
37 Data Router and Sensitive Data Handling\r
38 \r
39     A publisher of a Data Router feed of sensitive (e.g., PCI, SPI, etc.) data needs to encrypt that data prior to delivering it to the Data Router\r
40 \r
41     The Data Router will distribute that data to all of the subscribers of that feed.\r
42 \r
43     Data Router does not examine the Feed content or enforce any restrictions or Validations on the Feed Content in any way\r
44 \r
45     It is the responsibility of the subscribers to work with the publisher to determine how to decrypt that data\r
46 \r
47 \r
48 \r
49 \r
50 \r
51 What the Data Router is NOT:\r
52 \r
53     Does not support streaming data\r
54 \r
55     Does not tightly couple to any specific publish endpoint or subscriber\r
56 \r
57     Agnostic as to source and sink of data residing in an RDBMS, NoSQL DB, Other DBMS, Flat Files, etc.\r
58 \r
59     Does not transform any published data\r
60 \r
61     Does not “examine” any published data\r
62 \r
63     Does not verify the integrity of a published file\r
64 \r
65     Does not perform any data “cleansing”\r
66 \r
67     Does not store feeds (not a repository or archive)\r
68 \r
69     There is no long-term storage – assumes subscribers are responsive most of the time\r
70 \r
71     Does not encrypt data when queued on a node\r
72 \r
73     Does not provide guaranteed order of delivery\r
74 \r
75     Per-file metadata can be used for ordering\r
76 \r
77 \r
78 \r
79 \r
80 ## BUILD\r
81 \r
82 After Datarouter repository is cloned it can be built using Maven\r
83 In the repository\r
84 \r
85 Go to datarouter-prov in the root\r
86 \r
87         mvn clean install\r
88 \r
89 Go to datarouter-node in the root\r
90 \r
91         mvn clean install\r
92 \r
93 Project Build will be Successful\r
94 \r
95 \r
96 \r
97 \r
98 ## RUN\r
99 \r
100 Datarouter is a Unix based service\r
101 \r
102 Pre-requisites to run the service\r
103 \r
104 MariaDB Version 10.2.14\r
105 \r
106 Java JDK 1.8\r
107 \r
108 Install MariaDB and load needed table into the database\r
109 \r
110 Sample sql_init_01.sql is provided in the datarouter-prov/src/main/resources/misc\r
111 \r
112 Go to datarouter-prov module and run the service using main.java\r
113 \r
114 Go to datarouter-node module and run the service using nodemain.java\r
115 \r
116 Curl Commands to test:\r
117 \r
118 create a feed:\r
119 \r
120 curl -v -X POST -H "Content-Type : application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF: rs873m" --data-ascii @/opt/app/datartr/addFeed3.txt --post301 --location-trusted  -k https://dmaap-dr-prov:8443\r
121 \r
122 Subscribe to feed:\r
123 \r
124 curl -v -X POST -H "Content-Type: application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF: rs873m" --data-ascii @/opt/app/datartr/addSubscriber.txt --post301 --location-trusted -k https://dmaap-dr-prov:8443/subscribe/1\r
125 \r
126 Publish to feed:\r
127 \r
128 curl -v -X PUT --user rs873m:rs873m -H "Content-Type: application/octet-stream" --data-binary @/opt/app/datartr/addFeed3.txt  --post301 --location-trusted -k https://dmaap-dr-prov:8443/publish/1/test1\r
129 \r
130 \r
131 \r
132 \r
133  ## CONFIGURATION\r
134 \r
135 Recommended\r
136 \r
137 Environment - Unix based\r
138 \r
139 Java - 1.8\r
140 \r
141 Maven - 3.2.5\r
142 \r
143 MariaDB - 10.2.14\r
144 \r
145 Self Signed SSL certificates\r
146 \r
147 ## This section describes how to build and test datarouter containers on a host such as\r
148 a laptop or remote server.\r
149 \r
150 - Install git, maven, docker\r
151     - See https://wiki.onap.org/display/DW/Setting+Up+Your+Development+Environment\r
152     - See https://docs.docker.com/install/\r
153 \r
154 ### Build\r
155 - in terminal \r
156 > git clone https://gerrit.onap.org/r/dmaap/datarouter\r
157 > cd datarouter\r
158 > mvn clean install -DskipTests -Pdocker\r
159 > docker images\r
160 REPOSITORY                                               TAG                 IMAGE ID            CREATED             SIZE\r
161 nexus3.onap.org:10003/onap/dmaap/datarouter-subscriber   2.0.0-SNAPSHOT      0dfc99a7612c        13 seconds ago      99.2MB\r
162 nexus3.onap.org:10003/onap/dmaap/datarouter-subscriber   latest              0dfc99a7612c        13 seconds ago      99.2MB\r
163 nexus3.onap.org:10003/onap/dmaap/datarouter-node         2.0.0-SNAPSHOT      6573f4bdc310        27 seconds ago      116MB\r
164 nexus3.onap.org:10003/onap/dmaap/datarouter-node         latest              6573f4bdc310        27 seconds ago      116MB\r
165 nexus3.onap.org:10003/onap/dmaap/datarouter-prov         2.0.0-SNAPSHOT      9e4148737c18        47 seconds ago      148MB\r
166 nexus3.onap.org:10003/onap/dmaap/datarouter-prov         latest              9e4148737c18        47 seconds ago      148MB\r
167 openjdk                                                  8-jre-alpine        1b46cc2ba839        3 weeks ago         85MB\r
168 nexus3.onap.org:10001/openjdk                            8-jre-alpine        1b46cc2ba839        3 weeks ago         85MB\r
169 \r
170 ### Test\r
171 > cd datarouter-docker-compose/src/main/resources\r
172 - edit docker-compose, change nexus 0001 (remote pull repo) to 0003 (local build)\r
173 > docker-compose up\r
174 \r
175 - terminal 2\r
176 >  docker container ls -a\r
177 CONTAINER ID        IMAGE                                                    COMMAND                  CREATED              STATUS                        PORTS                                                                   NAMES\r
178 c193317ec860        nexus3.onap.org:10003/onap/dmaap/datarouter-node         "sh startup.sh"          About a minute ago   Up About a minute             0.0.0.0:9090->8080/tcp, 0.0.0.0:9443->8443/tcp                          datarouter-node\r
179 e8dab741550e        nexus3.onap.org:10003/onap/dmaap/datarouter-prov         "sh startup.sh"          About a minute ago   Up About a minute (healthy)   0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp, 0.0.0.0:443->8443/tcp   datarouter-prov\r
180 cf0e996f0f31        nexus3.onap.org:10003/onap/dmaap/datarouter-subscriber   "sh startup.sh"          About a minute ago   Up About a minute             8080/tcp, 0.0.0.0:7070->7070/tcp, 8443/tcp                              subscriber-node\r
181 73affb6364f9        mariadb:10.2.14                                          "docker-entrypoint.s…"   About a minute ago   Up About a minute (healthy)   0.0.0.0:3306->3306/tcp                                                  mariadb\r
182 \r
183 > docker exec -it datarouter-node /bin/sh\r
184     # curl http://dmaap-dr-prov:8080/internal/prov\r
185 > docker exec -it datarouter-prov /bin/sh\r
186     # curl -v -X POST -H "Content-Type : application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF: rs873m" --data-ascii @/opt/app/datartr/addFeed3.txt --post301 --location-trusted  -k https://dmaap-dr-prov:8443\r
187 \r