{"id":20108958,"url":"https://github.com/cdon-dev/cmp.servicefabricreceivers","last_synced_at":"2026-05-10T13:05:44.653Z","repository":{"id":134134746,"uuid":"206021551","full_name":"cdon-dev/CMP.ServiceFabricReceivers","owner":"cdon-dev","description":"Utils for consuming event hubs on service fabric","archived":false,"fork":false,"pushed_at":"2020-03-23T07:44:20.000Z","size":126,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-13T05:29:21.552Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/cdon-dev.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-09-03T07:58:03.000Z","updated_at":"2020-03-17T10:22:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"74cfab28-e58b-4a5b-8127-44fe16dae4ba","html_url":"https://github.com/cdon-dev/CMP.ServiceFabricReceivers","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/cdon-dev%2FCMP.ServiceFabricReceivers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdon-dev%2FCMP.ServiceFabricReceivers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdon-dev%2FCMP.ServiceFabricReceivers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdon-dev%2FCMP.ServiceFabricReceivers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdon-dev","download_url":"https://codeload.github.com/cdon-dev/CMP.ServiceFabricReceivers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241549454,"owners_count":19980534,"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":[],"created_at":"2024-11-13T18:06:29.085Z","updated_at":"2026-05-10T13:05:39.622Z","avatar_url":"https://github.com/cdon-dev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CMP.ServiceFabricReceivers\nUtils for consuming event hubs on service fabric.\n\n## Introduction\n\nThis project contains two util projects for consuming eventhubs in service fabric.\nOne using Service Fabric's state for checkpointing (stateful) and one using Azure Storare for checkpointing (stateless).\n\nBoth use EventProcessor libraries, stateful uses the [Service fabric vesion \nin preview](https://www.nuget.org/packages/Microsoft.Azure.EventHubs.ServiceFabricProcessor/)\n\n(in preview) and the stateful uses the  [EventProcessor package](https://www.nuget.org/packages/Microsoft.Azure.EventHubs.Processor/).\n\nThe approch and signature is the same in both cases, it only differs in servicetype, configuration and the option type.\n\n### Sample\n\n          var pipeline = Composition.Combine(\n                                 CMP.ServiceFabricReceiver.Common.Features.PartitionLogging(),\n                                 CMP.ServiceFabricReceiver.Common.Features.OperationLogging(telemetryClient),\n                                 CMP.ServiceFabricReceiver.Common.Features.Logging(),\n                                 CMP.ServiceFabricReceiver.Common.Features.Retry(),\n                                 CMP.ServiceFabricReceiver.Common.Features.Handling(x =\u003e EventHandler.Handle(\"Sample\", table, x.Events)),\n                                 CMP.ServiceFabricReceiver.Common.Features.Checkpointing()\n                                 );\n\n\n\n                ServiceRuntime.RegisterServiceAsync(\n                    \"ReceiverServiceType2\",\n                    context =\u003e\n                        new SampleService(\n                         context,\n                         logger,\n                         settings,\n                         ServiceEventSource.Current.Message,\n                         ct =\u003e Task.CompletedTask,\n                         partitionId =\u003e ctx =\u003e pipeline(ctx),\n                         options)\n                        ).GetAwaiter().GetResult();\n\nThe samples folder includes a publisher that just pushes test event to a given hub.\n\nThere is also an service fabric application using the stateful approch.\n\n*Note* - the sample shows a sample service that inherits the util service. It seems like service fabric wants registered service in the same project that runs register.\n\n##### Event Handler\nNote that the `Func\u003cstring, Func\u003cIReadOnlyCollection\u003cEventData\u003e, CancellationToken, Task\u003e\u003e` is a way of passing your event handler into the service and it relies on a functional programming concept known as Partial Application. This gives you access to the partitionId, events and cancellation token in your event handler.\n\nThe real event handling function that is returned in the end, e.g. `(events, ct) =\u003e EventHandler.Handle(events.ToArray())`, will be created every time a batch of events comes in from EventHubs. This means that **no state** is maintained between the differnet executions of the function.\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdon-dev%2Fcmp.servicefabricreceivers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdon-dev%2Fcmp.servicefabricreceivers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdon-dev%2Fcmp.servicefabricreceivers/lists"}