fix typos
[dmaap/messagerouter/messageservice.git] / docs / Installation / Installation.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
2 .. http://creativecommons.org/licenses/by/4.0\r
3 \r
4 Installation\r
5 ============\r
6 \r
7 Environment\r
8 -----------\r
9 Message Router is developed using Kafka, Zookeeper and Java. AJSC framework is used to create the REST service and Docker was used to package the service.\r
10 \r
11 Steps\r
12 -----\r
13 Message Router has 3 docker containers. Dmaap\_container,\r
14 kafka\_container and zookeeper\_container. Zookeeper runs on 172.18.0.2,\r
15 kafka runs on 172.18.0.3 and dmaap on 172.18.0.4.\r
16 \r
17 1) Clone message service repo\r
18 \r
19    git clone http://gerrit.onap.org/r/dmaap/messagerouter/messageservice\r
20 \r
21 2) copy\r
22    messageservice/bundleconfig-local/etc/appprops/MsgRtrApi.properties\r
23    to /var/tmp directory\r
24 \r
25 3) In /var/tmp/MsgRtrApi.properties, change value of below variables as\r
26    shown below:\r
27 \r
28    config.zk.servers=172.18.0.2(Change as per where  ZooKeepeer is deployed)\r
29 \r
30    kafka.metadata.broker.list=172.18.0.3:9092(Change as per where Kafka is deployed)\r
31 \r
32 4) Install docker and docker-compose\r
33 \r
34 5) Go to messageservice/src/main/resources/docker-compose and run:\r
35    \r
36    .. code:: bash\r
37    \r
38                 docker-compose up  # add -d argument to start process as a daemon (background process)\r
39 \r
40    This should start 3 containers.\r
41 \r
42 6) Run docker ps. It should show 3 containers.\r
43 \r
44    |image0|\r
45    \r
46    .. |image0| image:: docker.png\r
47   \r
48 Testing\r
49 -------\r
50 \r
51 -  For publishing, create a sample.txt file with some content in the\r
52    directory where you will run below rest api. Run below rest api:\r
53 \r
54    curl -H "Content-Type:text/plain" -X POST -d @sample.txt\r
55    http://172.18.0.4:3904/events/TestTopic1\r
56 \r
57 -  For subscribing, run below rest api:\r
58 \r
59    curl -H "Content-Type:text/plain" -XGET\r
60    http://172.18.0.4:3904/events/TestTopic1/CG1/C1?timeout=1000\r
61 \r
62    Note: You will only receive messages which have been published after\r
63    you have subscribed to a topic.\r