Class RedeliveryPolicy
A policy used to customize exactly how you want the redelivery to work.
Inherited Members
Namespace: CodersRealm.AmqpClient
Assembly: CodersRealm.AmqpClient.dll
Syntax
public abstract class RedeliveryPolicy : IRedeliveryPolicy, ICloneable
Properties
BackOffMultiplier
Gets or sets the back off multiplier.
Declaration
public virtual int BackOffMultiplier { get; set; }
Property Value
| Type | Description |
|---|---|
| int | The back off multiplier. |
CollisionAvoidancePercent
Gets or sets the collision avoidance percent. This causes the redelivery delay to be adjusted in order to avoid possible collision when messages are redelivered to concurrent consumers.
Declaration
public virtual int CollisionAvoidancePercent { get; set; }
Property Value
| Type | Description |
|---|---|
| int | The collision avoidance factor. |
InitialRedeliveryDelay
The time in milliseconds to initially delay a redelivery
Declaration
public virtual int InitialRedeliveryDelay { get; set; }
Property Value
| Type | Description |
|---|---|
| int | The initial redelivery delay. |
MaximumRedeliveries
Gets or sets the maximum redeliveries. A value less than zero indicates that there is no maximum and the NMS provider should retry forever.
Declaration
public virtual int MaximumRedeliveries { get; set; }
Property Value
| Type | Description |
|---|---|
| int | The maximum redeliveries. |
UseCollisionAvoidance
Gets or sets a value indicating whether to [use collision avoidance].
Declaration
public virtual bool UseCollisionAvoidance { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
UseExponentialBackOff
Gets or sets a value indicating whether [use exponential back off].
Declaration
public virtual bool UseExponentialBackOff { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Methods
Clone()
Clone this object and return a new instance that the caller now owns.
Declaration
public object Clone()
Returns
| Type | Description |
|---|---|
| object |
GetOutcome(IDestination)
Returns the provider-specific outcome to use when a message is rejected by the client after reaching the maximum redelivery threshold for the specified destination.
The returned integer should map to an outcome defined by the specific provider implementation:
For AMQP:
0 - ACCEPTED
1 - REJECTED
2 - RELEASED
3 - MODIFIED_FAILED
4 - MODIFIED_UNDELIVERABLE_HERE
For OpenWire:
0 - DeliveredAck
1 - PoisonAck
2 - ConsumedAck
3 - RedeliveredAck
4 - IndividualAck
5 - UnmatchedAck
6 - ExpiredAck
It is the responsibility of the provider to interpret the returned value appropriately.
Declaration
public abstract int GetOutcome(IDestination destination)
Parameters
| Type | Name | Description |
|---|---|---|
| IDestination | destination | The destination the message was received from. |
Returns
| Type | Description |
|---|---|
| int | An integer representing the provider-specific outcome code. |
RedeliveryDelay(int)
The time in milliseconds to delay a redelivery
Declaration
public virtual int RedeliveryDelay(int redeliveredCounter)
Parameters
| Type | Name | Description |
|---|---|---|
| int | redeliveredCounter | The redelivered counter. |
Returns
| Type | Description |
|---|---|
| int |