Bug 576129 - Unable to publish topic to Mosquitto broker
Summary: Unable to publish topic to Mosquitto broker
Status: UNCONFIRMED
Alias: None
Product: Paho
Classification: IoT
Component: MQTT (show other bugs)
Version: 1.2   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 1.2   Edit
Assignee: Ian Craggs CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-20 23:42 EDT by Noor Ahmed CLA
Modified: 2021-09-20 23:42 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Noor Ahmed CLA 2021-09-20 23:42:58 EDT
created a custom topic which has full width characters
ex: test/:/test1
when i try to publish it to Mosquitto broker the client goes into wait state and does not return the control back to java and the topic is not published to the broker.

code snippet:

MqttConnectOptions connectionOptions= new MqttConnectOptions();
connectionOptions.setAutomaticReconnect(true);
connectionOptions.setCleanSession(true);
MqttClient mqttClient = new MqttClient("tcp://localhost:1883", "someclient", new MemoryPersistence());
mqttClient.connect(connectionOptions);
mqttClient.publish("test/:/test1", message);

here message is of type MqttMessage.

i have tried encoding the topic before doing mqttClient.publish then the topic is successfully published to the broker. but the problem is if i encode it using UTF-8 encoding then the topic looks as shown below
test%2F%EF%BC%9A%2Ftest1

this behavior is observed while using full width characters like full width colon(:), full width semi-colon(;), etc...