Let's do an experiment.
I created this VM running iot edge. I added the svelde/iot-edge-echo:2.0.1-amd64 module with an input and an output (what is coming in, is also send out):
I added this route:
FROM /messages/modules/echo/outputs/output1 INTO BrokeredEndpoint("/modules/echo/inputs/input1")
So the outcoming echo module messages go into the echo module.
Please do accept helpful posts as accepted answer so that it can help others within the community with similar issues.
Now I only have to send one message to the echo module. We do this with the svelde/iot-edge-one-message:0.0.1-amd64 module.
This 'one' module sends one message to 'output1' on restart of the module.
So I added to modules, the 'one' module and the 'echo' module and this extra route:
FROM /messages/modules/one/outputs/output1 INTO BrokeredEndpoint("/modules/echo/inputs/input1")
I now restart the 'one module'.
The message is sent after the restart.
The message arrives at the echo module:
But I see no actual resend of the same message over and over. So it seems the routing is limited to only other modules.
To prove this, I added a second echo module.
So the routing goes:
FROM /messages/modules/one/outputs/output1 INTO BrokeredEndpoint("/modules/echo/inputs/input1")
FROM /messages/modules/echo/outputs/output1 INTO BrokeredEndpoint("/modules/echo2/inputs/input1")
FROM /messages/modules/echo2/outputs/output1 INTO BrokeredEndpoint("/modules/echo/inputs/input1")
This time we see the infinite loop:
Conclusion: Routing is protected against sending a message to itself. But you can fool it by putting a (the same) module in between.