Interface IReceiverLink
Represents an AMQP receiver link.
Inherited Members
Namespace: Amqp
Assembly: Amqp.Net.dll
Syntax
public interface IReceiverLink : ILink, IAmqpObject
Methods
Accept(Message)
Accepts a message. It sends an accepted outcome to the peer.
Declaration
void Accept(Message message)
Parameters
Type | Name | Description |
---|---|---|
Message | message | The message to accept. |
Modify(Message, Boolean, Boolean, Fields)
Modifies a message. It sends a modified outcome to the peer.
Declaration
void Modify(Message message, bool deliveryFailed, bool undeliverableHere, Fields messageAnnotations)
Parameters
Type | Name | Description |
---|---|---|
Message | message | The message to modify. |
System.Boolean | deliveryFailed | If set, the message's delivery-count is incremented. |
System.Boolean | undeliverableHere | Indicates if the message should not be redelivered to this endpoint. |
Fields | messageAnnotations | Annotations to be combined with the current message annotations. |
Receive()
Receives a message. The call is blocked until a message is available or after a default wait time.
Declaration
Message Receive()
Returns
Type | Description |
---|---|
Message | A Message object if available; otherwise a null value. |
Receive(TimeSpan)
Receives a message. The call is blocked until a message is available or the timeout duration expires.
Declaration
Message Receive(TimeSpan timeout)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | timeout | The time to wait for a message. |
Returns
Type | Description |
---|---|
Message | A Message object if available; otherwise a null value. |
Remarks
Use TimeSpan.MaxValue or Timeout.InfiniteTimeSpan to wait infinitely. If TimeSpan.Zero is supplied, the call returns immediately.
ReceiveAsync()
Receives a message asynchronously.
Declaration
Task<Message> ReceiveAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Message> | A Task for the asynchronous receive operation. The result is a Message object if available within a default timeout; otherwise a null value. |
ReceiveAsync(TimeSpan)
Receives a message asynchronously.
Declaration
Task<Message> ReceiveAsync(TimeSpan timeout)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | timeout | The time to wait for a message. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Message> | A Task for the asynchronous receive operation. The result is a Message object if available within the specified timeout; otherwise a null value. |
Remarks
Use TimeSpan.MaxValue or Timeout.InfiniteTimeSpan to wait infinitely. If TimeSpan.Zero is supplied, the task completes immediately.
Reject(Message, Error)
Rejects a message. It sends a rejected outcome to the peer.
Declaration
void Reject(Message message, Error error = null)
Parameters
Type | Name | Description |
---|---|---|
Message | message | The message to reject. |
Error | error | The error, if any, for the rejection. |
Release(Message)
Releases a message. It sends a released outcome to the peer.
Declaration
void Release(Message message)
Parameters
Type | Name | Description |
---|---|---|
Message | message | The message to release. |
SetCredit(Int32, CreditMode, Int32)
Sets a credit on the link and the credit management mode.
Declaration
void SetCredit(int credit, CreditMode creditMode, int flowThreshold = -1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | credit | The new link credit. |
CreditMode | creditMode | The credit management mode. |
System.Int32 | flowThreshold | If credit mode is Auto, it is the threshold of restored credits that trigers a flow; ignored otherwise. |
SetCredit(Int32, Boolean)
Sets a credit on the link. The credit controls how many messages the peer can send.
Declaration
void SetCredit(int credit, bool autoRestore)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | credit | The new link credit. |
System.Boolean | autoRestore | If true, this method is the same as SetCredit(credit, CreditMode.Auto); if false, it is the same as SetCredit(credit, CreditMode.Manual). |
Start(Int32, MessageCallback)
Starts the message pump.
Declaration
void Start(int credit, MessageCallback onMessage)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | credit | The link credit to issue. |
MessageCallback | onMessage | If specified, the callback to invoke when messages are received. If not specified, call Receive method to get the messages. |