Browse Source

fix topic parser for host ID

Abhishek Kondur 2 years ago
parent
commit
9a9eaec3d4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      mq/util.go

+ 1 - 1
mq/util.go

@@ -99,7 +99,7 @@ func getID(topic string) (string, error) {
 func getHostID(topic string) (string, error) {
 func getHostID(topic string) (string, error) {
 	parts := strings.Split(topic, "/")
 	parts := strings.Split(topic, "/")
 	count := len(parts)
 	count := len(parts)
-	if count < 4 {
+	if count < 3 {
 		return "", fmt.Errorf("invalid topic")
 		return "", fmt.Errorf("invalid topic")
 	}
 	}
 	return parts[2], nil
 	return parts[2], nil