Closed danielyjc closed 8 years ago
Hi @danyj86! Could you tell me a bit more on how you are trying to run this script? Is it from the Publish with script button, from the script list, or on message received?
Hi Kamil,
I've been trying to run script from "Scripted Publications" pane.
Normally, I'd have a topic and a plane string message on "Publish Message" pane, so each message I publish can be dynamically enriched.
I see - so the way to do it not to use "Start" from the Scripted publications pane, but use the Publish button instead (from the Publish message pane). Click on the arrow of the Publish button to see the menu, and change to "Publish with script", picking the script you want to use. If you simply start a script, it doesn't know about the "message" object. If you do it as "Publish with script" from the "Publish message" pane, it should pick it up. Let me know if that works for you.
Thanks, it works!
Cool, thanks for confirming!
Hi Kamil, I am trying that Testcases Pubsub test with mqtt spy and that works very well. Thank you that is really very helpful. My question is that, is that possible to use protobuf for encoding and decoding the messages in that Test cases.
waiting for reply,,,:)
sure you can! could you raise a separate issue and i will try to explain...
Hi Kamil,
I've been working on a simple script to enrich a message from mqtt-spy (with UI). However, I noticed that spy fails to find a reference for "message" object in script.
Here's an excerpt of my script:
mqttspy.publish(message.getTopic(), message.getPayload(), message.getQoS(), message.isRetained());
Following is the log I captured:
Can you take a look and tell me if I'm doing anything wrong?