{"id":26035981,"url":"https://github.com/azure/go-shuttle","last_synced_at":"2025-04-10T06:00:28.788Z","repository":{"id":37810299,"uuid":"304553337","full_name":"Azure/go-shuttle","owner":"Azure","description":"go-shuttle is a light wrapper around the azure servicebus sdk for go. It is aimed at providing an api more in line with service implementation in a pub-sub context","archived":false,"fork":false,"pushed_at":"2025-03-24T20:35:18.000Z","size":638,"stargazers_count":14,"open_issues_count":6,"forks_count":21,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-09T10:12:01.526Z","etag":null,"topics":["azure","pubsub","servicebus"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Azure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-16T07:32:56.000Z","updated_at":"2025-01-20T05:27:05.000Z","dependencies_parsed_at":"2023-02-10T19:46:12.958Z","dependency_job_id":"6865fa61-a6cc-4dbc-a678-ceed32409855","html_url":"https://github.com/Azure/go-shuttle","commit_stats":{"total_commits":255,"total_committers":19,"mean_commits":"13.421052631578947","dds":"0.44313725490196076","last_synced_commit":"b3e1a0e899e47e9cd02de603a02bfeb24d211719"},"previous_names":[],"tags_count":68,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fgo-shuttle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fgo-shuttle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fgo-shuttle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fgo-shuttle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure","download_url":"https://codeload.github.com/Azure/go-shuttle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166937,"owners_count":21058481,"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":["azure","pubsub","servicebus"],"created_at":"2025-03-07T06:01:30.108Z","updated_at":"2025-04-10T06:00:28.746Z","avatar_url":"https://github.com/Azure.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-shuttle\n\n[![Coverage Status](https://coveralls.io/repos/github/Azure/go-shuttle/badge.svg)](https://coveralls.io/github/Azure/go-shuttle)\n\ngo-shuttle serves as a wrapper around the [azure service-bus go SDK](https://github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus) to facilitate the implementation of a pub-sub pattern on Azure using service bus.\n\n\u003e NOTE: This library is in early development and should be considered experimental. The api is still moving and can change. \n\u003e We do have breaking changes in v0.*. Use at your own risks.\n\n## Conventions \u0026 Assumptions\nWe are assuming that both the publisher and the listener are using go-shuttle\n\n## Processor\n\nThe processor handles the message pump and feeds your message handler.\nIt allows concurrent message handling and provides a message handler middleware pipeline to compose message handling behavior\n\n### Processor Options\n\n`MaxConcurrency` and `ReceiveInterval` configures the concurrent message handling for the processor.\n\n`StartMaxAttempt` and `StartRetryDelayStrategy` configures the retry behaviour for the processor.\n\n```golang\n// ProcessorOptions configures the processor\n// MaxConcurrency defaults to 1. Not setting MaxConcurrency, or setting it to 0 or a negative value will fallback to the default.\n// ReceiveInterval defaults to 2 seconds if not set.\n// StartMaxAttempt defaults to 1 if not set (no retries). Not setting StartMaxAttempt, or setting it to non-positive value will fallback to the default.\n// StartRetryDelayStrategy defaults to a fixed 5-second delay if not set.\ntype ProcessorOptions struct {\n    MaxConcurrency  int\n    ReceiveInterval *time.Duration\n    \n    StartMaxAttempt         int\n    StartRetryDelayStrategy RetryDelayStrategy\n}\n```\n\n### MultiProcessor\n\n`NewMultiProcessor` takes in a list of receivers and a message handler. It creates a processor for each receiver and starts them concurrently.\n\nsee [Processor and MultiProcessor examples](v2/processor_test.go)\n\n## Middlewares:\nGoSHuttle provides a few middleware to simplify the implementation of the message handler in the application code\n\n### SettlementHandler\n\nForces the application handler implementation to return a Settlement. This prevents 2 common mistakes:\n- Exit the handler without settling the message.\n- Settling the message, but not exiting the handler (forgetting to return after calling abandon, for example)\n\nsee [SettlementHandler example](v2/settlehandler_example_test.go)\n\n### ManagedSettlingHandler\n\nAllows your handler implementation to just return error. the ManagedSettlingHandler settles the message based on your \nhandler return value.\n- nil = CompleteMessage\n- error -\u003e Abandon or Deadletter, depending on your configuration of the handler.\n\nsee [ManagedSettlingHandler](v2/managedsettling_example_test.go)\n\n### Enable automatic message lock renewal\n\nThis middleware will renew the lock on each message every 30 seconds until the message is `Completed` or `Abandoned`.\n\n```golang\nrenewInterval := 30 * time.Second\nshuttle.NewRenewLockHandler(\u0026shuttle.LockRenewalOptions{Interval: \u0026renewInterval}, handler)\n```\n\nsee setup in [Processor example](v2/processor_test.go)\n\n## Contributing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Trademarks\n\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft \ntrademarks or logos is subject to and must follow \n[Microsoft's Trademark \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fgo-shuttle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazure%2Fgo-shuttle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fgo-shuttle/lists"}