Mqtt Return Value Type

0
Hello guys. I am trying to subscribe from a NodeRed Mqtt broker using MqttClient. The values of the of the variables that are passed through the broker are of different types (int, string, boolean). Although the ReturnType of the Subscribe action is boolean. I change the ReturnType on the Java action to Int/Long and i am getting the following message when i run the project. Do you have any idea how to return different type of values using mqtt subscribe action ?  
asked
1 answers
0

This is expected behavior. As long as the type of the return-variable is a boolean, then return value 'void’ will become false. Now you have set the type of the return-variable to integer, Java is asked to convert the value 'void’ to a long, and that is not possible.

Just leave the return type on boolean and do the transformation from boolean to integer in  your microflow after calling MQTT-activity.

answered