6 Commits

Author SHA1 Message Date
3fc83eefe6 logging
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2024-12-02 11:48:24 +01:00
a58959a316 counter fix
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2024-12-02 10:59:29 +01:00
2c21ab00a0 counter fix
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/tag/woodpecker Pipeline failed
2024-12-02 10:31:11 +01:00
d66483cdf3 minimize debug output
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/tag/woodpecker Pipeline was successful
2024-12-02 10:26:55 +01:00
ecceb5baa3 mqtt cred
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/tag/woodpecker Pipeline was successful
2024-12-02 10:19:58 +01:00
c505c525f8 fix
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2024-12-02 09:55:54 +01:00
6 changed files with 12 additions and 7 deletions

View File

@ -4,7 +4,7 @@ PGHOST=`kubectl get services traefik -n system -o jsonpath="{.status.loadBalance
PGPASSWORD=`kubectl get secrets ma-db-cred -n $N -o jsonpath="{.data.PGPASSWORD}" | base64 --decode`
PGUSER=`kubectl get secrets ma-db-cred -n $N -o jsonpath="{.data.PGUSER}" | base64 --decode`
PGSSLMODE=`kubectl get secrets ma-db-cred -n $N -o jsonpath="{.data.PGSSLMODE}" | base64 --decode`
PGDATABASE="matest"
PGDATABASE="ma"
export PGUSER PGHOST PGPASSWORD PGSSLMODE PGDATABASE
MA_CONF=`cat config-test.json`

View File

@ -1,6 +1,7 @@
{
"mqtt": {
"broker": "mqtt://emqx01-anonymous-cluster-internal.broker.svc.cluster.local:1883",
"username": "archiver",
"tlsEnable": "false"
},
"includeTopics": [

View File

@ -23,6 +23,8 @@ spec:
envFrom:
- secretRef:
name: ma-db-cred
- secretRef:
name: ma-mqtt-cred
- configMapRef:
name: ma-conf

View File

@ -11,6 +11,7 @@ LOGIN=ma
PASSWORD=`openssl rand -base64 24`
NAMESPACE=`cat namespace`
psql <<EOF
do
\$\$

View File

@ -7,7 +7,7 @@ import "time"
//import "net/url"
import "ma/mqtt"
//import "ma/config"
import "ma/counter"
//import "ma/counter"
import "ma/database"
var dbh *database.DatabaseHandle
@ -29,8 +29,7 @@ func InputArchiver() {
}
func handleMessage(message database.Message) {
log.Printf("Archiving Timestamp: %s, Topic: %s, Payload: %s", message.Time, message.Topic, message.Payload)
// log.Printf("Archiving Timestamp: %s, Topic: %s, Payload: %s", message.Time, message.Topic, message.Payload)
dbh.StoreMessage(&message)
counter.S("Stored")
}

View File

@ -122,7 +122,9 @@ func StartMqttClient() {
if token := mqttClient.Connect(); token.Wait() && token.Error() != nil {
log.Fatalf("Unable to connect to broker %s, error %s", broker, token.Error())
}
//log.Printf("Successfully connected to broker %s", broker)
log.Printf("Successfully connected to broker %s", broker)
log.Printf("Include topics: %s", config.Config.IncludeTopics)
log.Printf("Exclude topics: %s", config.Config.ExcludeTopics)
go outputDispatcher(mqttClient)