edgexfoundry / device-sdk-go

Owner: Device WG

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable publish event with empty space name when using MQTT as message bus

weichou1229 opened this issue Β· comments

🐞 Bug Report

Affected Services [REQUIRED]

The issue is located in: device service

Is this a regression?

No

Description and Minimal Reproduction [REQUIRED]

If the event sourceName contains empty space like test resource, the SDK can't publish the event because the common.URLEncode(event.SourceName) method encodes the empty space to plus sign +.

for example,

edgex/events/device/device-simple/Simple-Device/Simple-Device01/Counter+test

the plus sign ( + ) cannot be used in MQTT publish topic.

To solve this issue, we should use url.PathEncode instead.

πŸ”₯ Exception or Error





🌍 Your Environment

Deployment Environment:

EdgeX Version [REQUIRED]:
Main branch

Anything else relevant?

fixed by the above merged PRs