I have need to collect the value of multiple datapoints and use them as a group. For a simplified example, I have X/Y points and want to graph them. But my data coming in is individual items. Each X value comes in and each Y value comes in via separate flow messages. The problem is that I may get multiple X values and the Y value may not change for an unknown period of time and is not reported at the same time. I need to send both values as a pair when an updated value is received. This is a simplified version of what I am after. I am wonder what my options are as I do not believe a Join node will work.
The join node is the right choice.
Set it to manual mode, leave everything default apart from entering 2 for the count field and ticking the checkbox for sending subsequent messages.
The key to making this work is ensuring that the input data has a valid topic. In your case the x value should have a topic of x and the y value should have a topic of y. If your data does not have a topic, you can simply add a topic using a change node before the join.
See this article in the cookbook for an example of how to join messages into one object.
Thank you, Steve. I thought I had tested this and was not getting what I wanted. Perhaps I had not checked the subsequent message option. I did misread the recipe where it states. "As we know there are three separate streams of messages to join, the node has been to configure to send on a message when it receives that number of parts." to mean that it needed to get 1 part from each and somehow missed the next paragraph. Reading it again, one might argue that perhaps that next paragraph should not be a second paragraph.
Just to note that when you have that checked you can determine which message has just been received by looking at msg.topic.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.