Class LinkEndpoint
The base class of an AMQP link endpoint.
Inherited Members
Namespace: Amqp.Listener
Assembly: Amqp.Net.dll
Syntax
public abstract class LinkEndpoint
Remarks
A link endpoint represents a target or a source terminus of a node. A target link endpoint is a message sink and is also called receiving link endpoint. A source link endpoint is a message source and is also called sending link endpoint in this document.
Methods
OnDisposition(DispositionContext)
Processes a received disposition performative.
Declaration
public abstract void OnDisposition(DispositionContext dispositionContext)
Parameters
Type | Name | Description |
---|---|---|
DispositionContext | dispositionContext | Context of the received disposition performative. |
Remarks
The endpoint should handle the delivery state and the message settlement. The delivery state indicates the outcome of the delivery on the remote peer.
- Accepted: message is accepted and should be retied (e.g. removed from the queue or deleted from the storage).
- Released: message is no longer acquired and should be made available for redelivery.
- Rejected: message cannot be processed and required action (e.g. redelivery and deadlettering) should be taken.
- Modified: similar to Released except message can be modified by the outcome. After the outcome is handled, the endpoint should call dispositionContext.Complete (with an error if any). If the delivery is not settled (as indicated by dispositionContext.Settled flag), an outcome is sent to the remote peer and the delivery is settled.
OnFlow(FlowContext)
Processes a received flow performative.
Declaration
public abstract void OnFlow(FlowContext flowContext)
Parameters
Type | Name | Description |
---|---|---|
FlowContext | flowContext | Context of the received flow performative. |
Remarks
A sending endpoint should send messages per the requested message count. A receiving endpoint may receive a flow if the sender wants to exchange flow state or send custom properties.
OnLinkClosed(ListenerLink, Error)
The method is called when the link is closed. Derived classes may override this method to perform necessary cleanup work.
Declaration
public virtual void OnLinkClosed(ListenerLink link, Error error)
Parameters
Type | Name | Description |
---|---|---|
ListenerLink | link | The link that is being closed. |
Error | error | The error, if any, that causes the link to be closed. |
OnMessage(MessageContext)
Processes a received message.
Declaration
public virtual void OnMessage(MessageContext messageContext)
Parameters
Type | Name | Description |
---|---|---|
MessageContext | messageContext | Context of the received message. |
Remarks
A receiving endpoint must implement this method to process messages. The endpoint should call messageContext.Complete to finish processing the message. An Accepted outcome or a Rejected outcome with the specified error will be sent to the client. A sending endpoint never receives messages and should not override this method.