The KURA MQTT cloud client publishes messages respecting the following formula (more details):
#account-name/#client-id/#API-ID/topic
I want to send MQTT messages with my own format, I dont want to send the account name and the client id in the MQTT message.
How can I do that? I already tried to change the configuration in the KURA web interface -> MQTTData transport and I have deleted the content of "lwt.topic" but without success.
Use the DataService directly. Ask OSGi to inject the instance into your component.
Sample code to use in your component class:
In your component OSGI-INF/mycomponent.xml tell OSGi which methods to call to inject the DataService by adding the following
Then you can pass the topic you need to
DataService.publish(...)
. Payloads must be converted tobyte[]
arrays.