I'm am trying to understand the framing part of the AMQP protocol. I get it that AMQP first opens a TCP connection and then uses multiple channels inside this connection to prevent the overhead of setting up multiple TCP connections (this is very well explained here). Now I'm struggling to understand how links come into play. So from my understanding, it works as the follows:
- A connection (TCP most of the time) is set up between two containers (two programs basically)
- Multiple channels are created. They are not tied to any nodes
- A session combines two channels of each direction, still not tied to any nodes
- "Links" bind a session to two nodes from each end
Is my understanding correct? Why do we need the concept of "Links" when we already have channels? Why not just make a channel a connection between two nodes? What, in plain english, is the difference between a channel and a link?
Microsoft states:
A channel is a unidirectional, outbound, virtual transfer path on top of the connection.
and
A link is a communication path created over a session that enables transferring messages in one direction
This sounds to me basically the same. I would be very happy if someone could explain in simple terms how cannels, sessions and links are related.