Introduction

In this article, we are going to follow on the previous parts to build a reusable queue service that can process generic messages.

Introducing Jobs

We are going to introduce a concept called Jobs. A job is a piece of code that is executed given a specific data input. So instead of having multiple queue for multiple type of messages, we are going to have one queue that can process an infinite number of message types (or jobs).

The public IJob interface is defined as below.

In order to be easier to implement, we…


This is the Part 2 of this series. You can read the Part 1 here.

https://medium.com/nuages-org/aws-sqs-background-service-net-5-part-1-63e3e730e3a2

Introduction

As mentioned in my previous post, we need to code a “more production ready” version of the tutorial.

This post will focus on implementing best practices so you will have a good starting point for your worker application.

You want to go straight to it? Go directly to the source code available here :

https://github.com/martin-masse/SQSDemoBackgroundService_Part2

What’s in the box ?

The solution includes three projects:

  • Nuages.QueueService : A class library to support generic queue services.
  • Nuages.QueueService.SQS : Implementation of the IQueueService interface from AWS SQS
  • Demo.API: A demo Web…


The scope of this article it to get you started building a SQS background services using .NET 5 (should work with 3.1 as well).

SQS stands for Simple Queue Service. That is, it’s a queue service. What you can do with it is pretty straightforward.

  1. You create a queue
  2. You put messages in the queue
  3. You read messages from the queue
  4. You process the messages
  5. On success, you remove the messages from the queue

What happens when something fails? Well, the message stay in the queue for reprocessing until future success. …

Martin Massé

I’m a .NET developer with almost 20 years of experience. I have 7 years of experience with the AWS stack. I’m a businessman having founded two companies.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store