Przeglądaj źródła

chore: update node-red test with MQTT messages

chore/proposed-structure
Blaz Smehov 4 tygodni temu
rodzic
commit
dc0bb7c777
3 zmienionych plików z 174 dodań i 38 usunięć
  1. +2
    -0
      cmd/decoder/main.go
  2. +0
    -2
      cmd/server/main.go
  3. +172
    -36
      test/node-red-integration-tests/apitest.json

+ 2
- 0
cmd/decoder/main.go Wyświetl plik

@@ -146,6 +146,8 @@ func processIncoming(incoming model.Incoming_json, ctx *model.AppContext) {
}
}()

fmt.Println("message came")

incoming = mqttclient.IncomingBeaconFilter(incoming)
id := mqttclient.GetBeaconID(incoming)
now := time.Now().Unix()


+ 0
- 2
cmd/server/main.go Wyświetl plik

@@ -50,8 +50,6 @@ func HttpServer(addr string) {
http.ListenAndServe(addr, handlers.CORS(originsOk, headersOk, methodsOk)(r))
}

// This looks wrong, should handle error somehow

func sendKafkaMessage(writer *kafka.Writer, value *model.ApiUpdate) bool {
valueStr, err := json.Marshal(&value)
if err != nil {


+ 172
- 36
test/node-red-integration-tests/apitest.json
Plik diff jest za duży
Wyświetl plik


Ładowanie…
Anuluj
Zapisz