Skip to content

AG - 29 - Refactor MQTT data topics and gateway heartbeat usage#48

Open
rodneyosodo wants to merge 2 commits into
absmach:mainfrom
rodneyosodo:fix/29
Open

AG - 29 - Refactor MQTT data topics and gateway heartbeat usage#48
rodneyosodo wants to merge 2 commits into
absmach:mainfrom
rodneyosodo:fix/29

Conversation

@rodneyosodo
Copy link
Copy Markdown
Contributor

What does this do?

Which issue(s) does this PR fix/relate to?

Resolves #29

List any changes that modify/break current functionality

Have you included tests for your changes?

Did you document any new/modified functionality?

Notes

Copy link
Copy Markdown

@JeffMboya JeffMboya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of gateway topic and heartbeat channel changes.

Comment thread service.go
Comment thread service.go
Comment thread service.go

var nodeRedTopicPattern = regexp.MustCompile(`m/[^/"'\s]*/c/[^/"'\s]*/(?:data|msg)`)
var nodeRedTopicPattern = regexp.MustCompile(`m/[^/"'\s]*/c/[^/"'\s]*/(?:data|msg|gateway/telemetry)`)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nodeRedTopicPattern now matches gateway/telemetry; old /msg still valid?

Comment thread service.go
return nodeRedTopicPattern.ReplaceAllString(value, fmt.Sprintf("m/%s/c/%s/msg", domainID, channelID))
return nodeRedTopicPattern.ReplaceAllString(value, fmt.Sprintf("m/%s/c/%s/gateway/telemetry", domainID, channelID))
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing NodeRed flows publishing to /msg will be silently misrouted.

Comment thread service.go
t = fmt.Sprintf("m/%s/c/%s/gateway/telemetry", domainID, a.config.Channels.DataChan())
default:
t = fmt.Sprintf("m/%s/c/%s/res/%s", domainID, a.config.Channels.CtrlChan(), topic)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data topic path change; consumers on /msg path will miss messages.

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align Telemetry Topic with Aeolus (gateway/telemetry suffix)

2 participants