NOISSUE - Change topic format in RE (#183)

* Change topic in RE for change internal msg fmt

Signed-off-by: Arvindh <arvindh91@gmail.com>

* update re message topic

Signed-off-by: Arvindh <arvindh91@gmail.com>

* sync with supermq main

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
This commit is contained in:
Arvindh
2025-06-05 16:22:01 +05:30
committed by GitHub
parent b51ce5f1d2
commit a8b61fe5bd
5 changed files with 13 additions and 9 deletions
+1 -1
View File
@@ -242,7 +242,7 @@ func main() {
}
subCfg := messaging.SubscriberConfig{
ID: svcName,
Topic: smqbrokers.SubjectAllChannels,
Topic: smqbrokers.SubjectAllMessages,
DeliveryPolicy: messaging.DeliverAllPolicy,
Handler: svc,
}
+1 -1
View File
@@ -1,7 +1,7 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
FROM golang:1.24-alpine AS builder
FROM golang:1.24.3-alpine AS builder
ARG SVC
ARG GOARCH
ARG GOARM
+2 -2
View File
@@ -1,11 +1,11 @@
module github.com/absmach/magistrala
go 1.24.2
go 1.24.3
require (
github.com/0x6flab/namegenerator v1.4.0
github.com/absmach/callhome v0.14.0
github.com/absmach/supermq v0.16.1-0.20250602095825-5e96516bf6fb
github.com/absmach/supermq v0.16.1-0.20250605074856-21c7b1019eea
github.com/authzed/authzed-go v1.4.0
github.com/authzed/grpcutil v0.0.0-20250221190651-1985b19b35b8
github.com/caarlos0/env/v11 v11.3.1
+2 -2
View File
@@ -29,8 +29,8 @@ github.com/absmach/mgate v0.4.6-0.20250425104654-79c62d581921 h1:Y0M0jtSbKmfrwLW
github.com/absmach/mgate v0.4.6-0.20250425104654-79c62d581921/go.mod h1:BYazn/DsEeZxJxWZxy/5NiaS/CfWpR/5auYmbq43VwQ=
github.com/absmach/senml v1.0.7 h1:XLvpw0qxbP2QhOz7KLM2ZRar+vSCpSG/0o0kEvWx3No=
github.com/absmach/senml v1.0.7/go.mod h1:3bRIiNc8hq7l3auMs8gQrpsM5hHy7iDuiLILrf/+MfA=
github.com/absmach/supermq v0.16.1-0.20250602095825-5e96516bf6fb h1:4RGAt42da6v6CkAOb9gDUNHSIzIlo8dXtrnDlrozA+8=
github.com/absmach/supermq v0.16.1-0.20250602095825-5e96516bf6fb/go.mod h1:WbcEX19AtubL9txRVv5wnU0xueSOOjad0JJ/1bgMntE=
github.com/absmach/supermq v0.16.1-0.20250605074856-21c7b1019eea h1:y3ATSOOM27LCv532tPgX28svewvooOM30tCBQUh6G88=
github.com/absmach/supermq v0.16.1-0.20250605074856-21c7b1019eea/go.mod h1:2fkFY+HtFfPsByiIGfAReleZUOiu4UX8pEMmh579zA4=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+7 -3
View File
@@ -133,7 +133,8 @@ func (re *re) sendAlarm(ctx context.Context, ruleID string, original *messaging.
Payload: buf.Bytes(),
}
if err := re.alarmsPub.Publish(ctx, original.Channel, m); err != nil {
topic := messaging.EncodeMessageTopic(original)
if err := re.alarmsPub.Publish(ctx, topic, m); err != nil {
return 0
}
return 1
@@ -175,7 +176,8 @@ func (re *re) saveSenml(ctx context.Context, val interface{}, msg *messaging.Mes
Protocol: msg.Protocol,
Payload: data,
}
if err := re.writersPub.Publish(ctx, msg.Channel, m); err != nil {
topic := messaging.EncodeMessageTopic(msg)
if err := re.writersPub.Publish(ctx, topic, m); err != nil {
return err
}
@@ -197,7 +199,9 @@ func (re *re) publishChannel(ctx context.Context, val interface{}, channel, subt
Protocol: protocol,
Payload: data,
}
if err := re.rePubSub.Publish(ctx, channel, m); err != nil {
topic := messaging.EncodeTopicSuffix(msg.Domain, channel, subtopic)
if err := re.rePubSub.Publish(ctx, topic, m); err != nil {
return err
}