Commands | AMQP1 Links
In the AMQP (Advanced Message Queuing Protocol) 1.0.0 specification, a link represents a unidirectional communication channel between an AMQP client and a message broker. Let's delve deeper into what AMQP 1.0.0 links entail:
- Communication Channel: A link serves as a pathway through which messages flow between an AMQP sender and receiver. It allows for the transmission of messages in one direction, either from the sender to the receiver or vice versa.
- Unidirectional Flow: Each link is unidirectional, meaning that messages can only travel in one direction along the link. If bidirectional communication is needed, two links must be established—one for each direction.
- Message Transfer: Messages are transferred across links according to the AMQP protocol rules. These messages can include payloads, message properties, and additional metadata required for communication.
- Resource Binding: Links are associated with specific resources within the AMQP broker, such as queues, topics, or exchanges. Messages sent or received via a link are directed to or originate from these resources.
- Flow Control: Links support flow control mechanisms to regulate the rate at which messages are sent or received. Flow control ensures that neither the sender nor the receiver is overwhelmed by the volume of messages being exchanged.
- Lifetime Management: Links have a lifecycle that begins when they are established and ends when they are closed. They can be created dynamically as needed and closed when they are no longer required.
- Addressing: Links are identified by unique addresses that specify the source and target endpoints of the communication. These addresses allow clients and brokers to identify and establish connections to the appropriate endpoints.
- Transactional Boundaries: Links define transactional boundaries for message operations. They enable the grouping of multiple message sends or receives into a single atomic unit, ensuring consistency and reliability in message delivery.
In summary, AMQP 1.0.0 links provide a means for unidirectional communication between AMQP clients and brokers, facilitating the transfer of messages while supporting flow control, resource binding, addressing, and transactional integrity within the messaging system. They form the fundamental building blocks of message exchange in the AMQP protocol.
There are 2 types of Links:
Every time a new link is created or deletes, the following events are fired:
- OnAMQPLinkOpen: this event is triggered when a new link is created. Use the aLink.Mode property to check if the link is in receiver or sender mode.
- OnAMQPLinkClose: this event is triggered when a link is closed.