Innovt Platform
Search Results for

    Show / Hide Table of Contents

    Class QueueService<T>

    Provides functionalities to interact with an Amazon SQS queue for a specified message type T.

    Inheritance
    object
    AwsBaseService
    QueueService<T>
    Implements
    IDisposable
    IQueueService<T>
    Inherited Members
    AwsBaseService.Configuration
    AwsBaseService.ExponentialBackoffInSeconds
    AwsBaseService.Logger
    AwsBaseService.Dispose()
    AwsBaseService.GetServiceRegionEndPoint()
    AwsBaseService.CreateService<T>()
    AwsBaseService.CreateDefaultRetryAsyncPolicy()
    AwsBaseService.CreateDefaultRetryPolicy()
    AwsBaseService.CreateRetryAsyncPolicy<T>()
    AwsBaseService.CreateRetryAsyncPolicy<T, T1>()
    AwsBaseService.CreateRetryAsyncPolicy<T, T1, T2>()
    AwsBaseService.CreateRetryAsyncPolicy<T, T1, T2, T3>()
    AwsBaseService.CreateRetryAsyncPolicy<T, T1, T2, T3, T4>()
    AwsBaseService.CreateCircuitBreaker<T, T1>()
    AwsBaseService.Dispose(bool)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Innovt.Cloud.AWS.SQS
    Assembly: Innovt.Cloud.AWS.SQS.dll
    Syntax
    public class QueueService<T> : AwsBaseService, IDisposable, IQueueService<T> where T : IQueueMessage
    Type Parameters
    Name Description
    T

    Type of the messages in the queue, must implement IQueueMessage.

    Constructors

    | Edit this page View Source

    QueueService(ILogger, IAwsConfiguration, string, ISerializer)

    Initializes a new instance of the QueueService<T> class.

    Declaration
    public QueueService(ILogger logger, IAwsConfiguration configuration, string queueName = null, ISerializer serializer = null)
    Parameters
    Type Name Description
    ILogger logger

    Logger instance.

    IAwsConfiguration configuration

    AWS configuration.

    string queueName

    Optional queue name, defaults to the name of type T.

    ISerializer serializer

    Custom serializer (optional).

    | Edit this page View Source

    QueueService(ILogger, IAwsConfiguration, string, string, ISerializer)

    Initializes a new instance of the QueueService<T> class.

    Declaration
    public QueueService(ILogger logger, IAwsConfiguration configuration, string region, string queueName = null, ISerializer serializer = null)
    Parameters
    Type Name Description
    ILogger logger

    Logger instance.

    IAwsConfiguration configuration

    AWS configuration.

    string region
    string queueName

    Optional queue name, defaults to the name of type T.

    ISerializer serializer

    Custom serializer (optional).

    Properties

    | Edit this page View Source

    QueueName

    Gets the name of the queue.

    Declaration
    public string QueueName { get; protected set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    QueueUrl

    Gets the URL of the queue.

    Declaration
    public string QueueUrl { get; }
    Property Value
    Type Description
    string

    Methods

    | Edit this page View Source

    ApproximateMessageCountAsync(CancellationToken)

    Retrieves the approximate message count of the queue asynchronously.

    Declaration
    public Task<int> ApproximateMessageCountAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    Cancellation token (optional).

    Returns
    Type Description
    Task<int>

    The approximate message count of the queue.

    | Edit this page View Source

    CreateIfNotExistAsync(CancellationToken)

    Creates the queue if it does not exist asynchronously.

    Declaration
    public Task CreateIfNotExistAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    Cancellation token (optional).

    Returns
    Type Description
    Task

    A task representing the asynchronous operation.

    | Edit this page View Source

    DeQueueAsync(string, CancellationToken)

    Dequeues a message asynchronously from the queue using the provided pop receipt.

    Declaration
    public Task DeQueueAsync(string popReceipt, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string popReceipt

    The pop receipt of the message to be dequeued.

    CancellationToken cancellationToken

    Cancellation token (optional).

    Returns
    Type Description
    Task

    A task representing the asynchronous operation.

    | Edit this page View Source

    DisposeServices()

    Disposes of the Amazon SQS client.

    Declaration
    protected override void DisposeServices()
    Overrides
    AwsBaseService.DisposeServices()
    | Edit this page View Source

    EnQueueAsync<TK>(TK, int?, CancellationToken)

    Declaration
    public Task<string> EnQueueAsync<TK>(TK message, int? visibilityTimeoutInSeconds = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TK message
    int? visibilityTimeoutInSeconds
    CancellationToken cancellationToken

    // Gets and sets the property DelaySeconds. The length of time, in seconds, for which to delay a specific message. Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive

    DelaySeconds
    value become available for processing after the delay period is finished. If you don't specify a value, the default value for the queue applies. When you set
    FifoQueue
    , you can't set
    DelaySeconds
    per message. You can set this parameter only on a queue level.
    Returns
    Type Description
    Task<string>
    Type Parameters
    Name Description
    TK
    | Edit this page View Source

    EnQueueBatchAsync(IEnumerable<MessageBatchRequest>, int?, CancellationToken)

    Enqueues a batch of messages asynchronously to the queue.

    Declaration
    public Task<IList<MessageQueueResult>> EnQueueBatchAsync(IEnumerable<MessageBatchRequest> message, int? delaySeconds = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    IEnumerable<MessageBatchRequest> message

    The messages to be enqueued.

    int? delaySeconds

    The delay in seconds for message delivery (optional).

    CancellationToken cancellationToken

    Cancellation token (optional).

    Returns
    Type Description
    Task<IList<MessageQueueResult>>

    A list of message queue results indicating success or failure for each message.

    | Edit this page View Source

    GetMessagesAsync(int, int?, int?, CancellationToken)

    Enable user to receive messages

    Declaration
    public Task<IList<T>> GetMessagesAsync(int quantity, int? waitTimeInSeconds = null, int? visibilityTimeoutInSeconds = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    int quantity

    1-10

    int? waitTimeInSeconds

    To enable long pooling

    int? visibilityTimeoutInSeconds
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<IList<T>>

    Implements

    IDisposable
    IQueueService<T>

    Extension Methods

    Extensions.IsNull(object)
    Extensions.ToStringOrDefault(object)
    SimpleMapper.MapTo<T1>(object)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX