{"id":16990325,"url":"https://github.com/mizrael/webapiwithbackgroundworker","last_synced_at":"2025-07-30T16:11:11.043Z","repository":{"id":145131896,"uuid":"219742071","full_name":"mizrael/WebApiWithBackgroundWorker","owner":"mizrael","description":"Small demo showing how to implement Pub/Sub with a BackgroundWorker in .NET Core","archived":false,"fork":false,"pushed_at":"2023-03-03T14:44:51.000Z","size":34,"stargazers_count":78,"open_issues_count":0,"forks_count":20,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T21:50:02.968Z","etag":null,"topics":["dotnet","dotnet-core","pubsub","rabbitmq","webapi","webapi-core"],"latest_commit_sha":null,"homepage":"https://www.davidguida.net/consuming-message-queues-using-net-core-background-workers-part-1-message-queues/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mizrael.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-05T12:40:02.000Z","updated_at":"2024-10-25T16:50:17.000Z","dependencies_parsed_at":"2024-05-17T13:15:07.373Z","dependency_job_id":null,"html_url":"https://github.com/mizrael/WebApiWithBackgroundWorker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizrael%2FWebApiWithBackgroundWorker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizrael%2FWebApiWithBackgroundWorker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizrael%2FWebApiWithBackgroundWorker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizrael%2FWebApiWithBackgroundWorker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mizrael","download_url":"https://codeload.github.com/mizrael/WebApiWithBackgroundWorker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858169,"owners_count":20359253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","dotnet-core","pubsub","rabbitmq","webapi","webapi-core"],"created_at":"2024-10-14T03:09:43.372Z","updated_at":"2025-03-17T09:30:32.869Z","avatar_url":"https://github.com/mizrael.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\nThis repository contains a simple implementation of Pub/Sub in .NET Core. This code has been used as example accompaining a series of articles on my personal blog: https://www.davidguida.net/consuming-message-queues-using-net-core-background-workers-part-1-message-queues/\n\n\n## The Publisher\nThe Publisher is implemented a simple Console application. The user will be prompted to write a text message which will be sent to a RabbitMQ fanout exchange.\n\n## The Subscriber\nThe Subscriber is implemented as a .NET Core Background Worker hosted in a Web API. The Worker is starting the subscriber and listening for incoming messages. \n\nMessages are internally processed using a Producer/Consumer mechanism leveraging the System.Threading.Channels library.\n\nOnce a message is received, the worker will send it to a Producer which will then dispatch on a Channel. A certain number of Consumers has been registered at bootstrap. The first available Consumer will pick up the message and store it in a repository.\n\nThe Web API exposes a single GET endpoint /messages which will return the list of received messages.\n\nFor more details about Producer/Consumer, check this article: https://www.davidguida.net/how-to-implement-producer-consumer-with-system-threading-channels/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizrael%2Fwebapiwithbackgroundworker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmizrael%2Fwebapiwithbackgroundworker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizrael%2Fwebapiwithbackgroundworker/lists"}