From ed23945584ce23a108f429e00476ecc0ceaffbcb Mon Sep 17 00:00:00 2001 From: Arvindh Date: Fri, 21 Jul 2023 13:36:09 +0530 Subject: [PATCH] fix: cli message send and reader topic Signed-off-by: Arvindh --- pkg/sdk/go/message.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/sdk/go/message.go b/pkg/sdk/go/message.go index 45b4f3778d2..aca7b72f057 100644 --- a/pkg/sdk/go/message.go +++ b/pkg/sdk/go/message.go @@ -22,7 +22,7 @@ func (sdk mfSDK) SendMessage(chanName, msg, key string) errors.SDKError { subtopicPart = fmt.Sprintf("/%s", strings.Replace(chanNameParts[1], ".", "/", -1)) } - url := fmt.Sprintf("%s/channels/%s/messages/%s", sdk.httpAdapterURL, chanID, subtopicPart) + url := fmt.Sprintf("%s/channels/%s/messages%s", sdk.httpAdapterURL, chanID, subtopicPart) _, _, err := sdk.processRequest(http.MethodPost, url, ThingPrefix+key, string(CTJSON), []byte(msg), http.StatusAccepted) @@ -34,7 +34,7 @@ func (sdk mfSDK) ReadMessages(chanName, token string) (MessagesPage, errors.SDKE chanID := chanNameParts[0] subtopicPart := "" if len(chanNameParts) == channelParts { - subtopicPart = fmt.Sprintf("?subtopic=%s", strings.Replace(chanNameParts[1], ".", "/", -1)) + subtopicPart = fmt.Sprintf("?subtopic=%s", chanNameParts[1]) } url := fmt.Sprintf("%s/channels/%s/messages%s", sdk.readerURL, chanID, subtopicPart)