Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Latest commit

 

History

History
36 lines (27 loc) · 1.03 KB

README.md

File metadata and controls

36 lines (27 loc) · 1.03 KB

SqsPoller

Join the chat at https://gitter.im/SqsPoller/SqsPoller

A small library that helps ASP.NET Core applications easily consume messages from a SQS queue

Example

Register SqsPoller with IServiceCollection

  services.AddSqsPoller(...);

Create a message object and consumer that consumes the message

  public class UserCreated
  {
      public long Id { get; set; }
      public string FirstName {get; set; }
      public string LastName {get; set; }
      public string Email {get; set; }
  }
  
  public class SendConfirmationMessageConsumer: IConsumer<UserCreated>
  {
      public Task Consume(UserCreated message, CancellationToken cancellationToken)
      {
          // Some code
      }
  }

Constraint

Each message should have a MessageType header and value should the name of the type that you are going to consume (i.e. UserCreated).