Brian16446
Brian16446

Reputation: 149

AWS automatically rebublishing MQTT data to Node-RED?

In Node-RED i'm using the mqtt out node to send data to aws. Then aws has a rule which specifies to send the data to a lambda function. I then have an mqtt in node which is subscribed to messages from aws.

Now when I send data to aws over a test topic, I'm getting the data sent back to me with the mqtt in node. I'm not publishing anything from the AWS side and this happens regardless of what the topic is (even when it doesn't match what I've specified in the rule. Why is this automatically being sent back to me? Does AWS just automatically republish the data on the same topic?

edit:

I have a mqtt out with the topic test and then in a different flow, an mqtt in with the topic test.

I am publishing a message to AWS with the topic test. And then in another flow I am susbcribed to the topic test. When I publish a message to AWS with the topic test, even though AWS is not subscribed to the topic 'test', I still get the data on the mqtt in flow. How can this be if AWS isn't publishing anything to the test topic.

Is it just because they are both connected to the same server and since I am publishing to a topic, anything subscribed to that topic will receive the data. Does AWS not have to actually do anything?

Upvotes: 0

Views: 222

Answers (1)

hardillb
hardillb

Reputation: 59628

As I mentioned in the comment it's not 100% clear what you are asking here but I'll guess.

Any client that is subscribed to a topic will receive all messages published on that topic. This includes messages it published it's self.

e.g.

Node-RED is subscribed to foo/bar and publishes a new message to foo/bar then it will receive it's own message back.

Upvotes: 1

Related Questions