From 25d15c5b11f2e4865eb1f00437dda5652d3ec840 Mon Sep 17 00:00:00 2001
From: Oleksandr Husak <oleksandr.husak@mailbox.tu-dresden.de>
Date: Thu, 23 Sep 2021 12:04:11 +0200
Subject: [PATCH] upd readme: add description for mqtt connection

---
 README.md | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 2b57b4e..7867dcd 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ This repository is a centralized version of architecture for IPos software (Indo
 ## How to run?
 
 1. Start [hivemq](http://www.hivemq.com/demos/websocket-client/). It's a client for an external test MQTT-broker.
-    1. Establish a connection with the standard parameters (WS coonection).
+    1. Establish a connection with the standard parameters (WS connection).
     2. Add new subscriptions with `Add New Topic Subscription` button
         - `test51/subscribe/positions`: responses
         - `test51/publish/positions`: requests
@@ -25,6 +25,24 @@ This repository is a centralized version of architecture for IPos software (Indo
 
 ![](demo.v1.jpg)
 
+## Configurations
+- External MQTT broker
+  - Parameters for a connection are in `src/main/resources/application.yml`  
+    - ```yaml
+        mqtt:
+          automaticReconnect: true
+          cleanSession: true
+          setKeepAliveInterval: 10
+          connectionTimeout: 20
+          clientId: ipos.project
+          hostname: broker.hivemq.com
+          port: 1883
+        ```
+    - Parameters are used in `src/main/java/ipos/project/config/MqttConfig.java`
+      - `@ConfigurationProperties(prefix = "mqtt")` refers to all relevant parameters
+      - create `MqttConnectOptions` bean
+      - create `MqttAsyncClient` bean. Require `MqttConnectOptions`
+
 
 ### Extra
 - Internal database: [localhost:8077/h2-console](http://localhost:8077/h2-console)
-- 
GitLab