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