Add topic field to File-In node

Hi folks,

One of the things I need is an easy way to combine two files into a single message. Since the Join-node already allows me to combine messages based on their topic, it would be very useful for me if the File-In node would allow me to specify a topic (in the config screen):

I can't solve it by two extra Change nodes, like this:

image

Because the File-In node doesn't pass the input message topic in this case... We could solve this by passing the input msg topic to the output. However my flow is already quite long, and these extra Change-nodes would make it harder to read.

So I would like to propose two changes:

  1. The msg.topic of the input message is passed to the output in all cases (in this code).

  2. Add a topic field to the config screen. If that is filled, then this topic is being used instead the one from the input message.

Thanks!!
Bart

The join node doesn't have to use the topic as the key. It could use msg.filename instead, (or whatever extra field the file node has)

But yes to 1 anyway, we should fix that.

1 Like

Yup, that should be fixed.

No. Topic has no meaning with the file node. If we were to add it to this node, it would be hard to explain why this node gets that treatment, and then why not add it to every single node. We don't want to do that.

Hey Dave,
Thanks!! That indeed does the job very well. Why haven't I seen that myself ...
Believe it or not, but first time I use this Join node in my flows.
Works like a charm! So indeed then I don't need the topic on the config screen.

Post removed at Bart's request as he has amended the original post.

Leaving a reminder to all here that messing with Public Key Infrastructure (PKI) - e.g. certificates and keys - is hard to get right and easy to end up with something that seems secure but really isn't.

If you need to rely on it for anything important, please remember to get your deployment checked by professionals.

@BartButenaers - hmm - just got to a keyboard and tried it... - for me the topic and any other properties get passed through the file-in mode just fine - can't see what needs fixing.

Really? That is weird... I have also tested it this morning and my topic was gone. Will try tonight again. Now I am in mathematics mode, to assist with my son's examination preparation :wink:
BTW thanks for testing already!!

Hey Dave,
Yes you are right. Did a new test and it works fine... I don't have my flow anymore from this morning, so not sure what I did wrong at that time.
Sorry for the inconvenience!!! And thanks again for having a look at it!!

You know I had the same issue about a week or two ago and was going to look into it, but I was down with a nasty cold and it dropped off my radar. I’ll have a go at seeing if I can reproduce it.

1 Like

Went back thru all my projects that had been updated in the last two weeks on my different devides and can't reproduce it (sigh). Of course I did update one today...but can't remember what release it was on :flushed:

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.