Browse Source

chore: update node-red test with MQTT messages

chore/proposed-structure
Blaz Smehov 4 weeks ago
parent
commit
dc0bb7c777
3 changed files with 174 additions and 38 deletions
  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 View File

@@ -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 View File

@@ -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
File diff suppressed because it is too large
View File


Loading…
Cancel
Save