serkanince / NetCoreBackgroundJobsSample

This project contains sample code for making calls from a background job (IHostedService) to exchange rates.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NetCoreBackgroundJobsSample

Description

This project contains sample code for making calls from a background job (IHostedService) to exchange rates.

Read More Detail on Blog Post (Turkish):

Blog Medium

Exchange Rate Sources

Name URL
Exchange Rate https://api.exchangerate.host
Free Forex API https://www.freeforexapi.com
TCMB http://www.tcmb.gov.tr

Features

  • .Net 5 Framework
  • Native .Net Hosted Services ( REF )
  • Strategy Pattern ( REF )
  • Producer and Consumer (Pub/Sub Technique)
  • Retry Policy ( POLLY )
  • Concurrent Queue List (thread safe)
  • Queued Background Tasks
  • Clean Code
  • SOLID
  • Native DI ( REF )

Build & Run

dotnet restore
dotnet build
dotnet run

Sample Console App Response

Got a new message: 1 Currency Data : Code : USD , Rate : 14.6897 (4/13/2022 1:18:23 PM). (Queue size: 0)

About

This project contains sample code for making calls from a background job (IHostedService) to exchange rates.

License:MIT License


Languages

Language:C# 100.0%