{"id":22447614,"url":"https://github.com/mattms/try-rabbitmq","last_synced_at":"2025-03-27T11:27:21.600Z","repository":{"id":145868793,"uuid":"601359529","full_name":"MattMS/Try-RabbitMQ","owner":"MattMS","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-31T12:03:04.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T16:11:20.294Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"F#","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/MattMS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-02-13T22:36:47.000Z","updated_at":"2024-08-31T12:03:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"975d9a5e-3a9b-41fb-819a-7c3542734d52","html_url":"https://github.com/MattMS/Try-RabbitMQ","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/MattMS%2FTry-RabbitMQ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattMS%2FTry-RabbitMQ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattMS%2FTry-RabbitMQ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattMS%2FTry-RabbitMQ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MattMS","download_url":"https://codeload.github.com/MattMS/Try-RabbitMQ/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245835075,"owners_count":20680141,"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-12-06T04:17:53.053Z","updated_at":"2025-03-27T11:27:21.594Z","avatar_url":"https://github.com/MattMS.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RabbitMQ experiment\n\nThis repo contains my experiments with trying to get a .NET Solution with RabbitMQ working on Azure.\n\n## Code overview\n\nThe Solution is very simple: a [Giraffe web server][Giraffe], a .NET worker service, and a shared messages library.\n\nThe Dockerfiles are only used for building the projects for cloud deployment, while `dotnet watch` is used for local development.\n\nThe base images are all official:\n\n- Everything builds with the same SDK: [`mcr.microsoft.com/dotnet/sdk:7.0-alpine`](https://hub.docker.com/_/microsoft-dotnet-sdk/)\n- Worker uses the normal runtime: [`mcr.microsoft.com/dotnet/runtime:7.0-alpine`](https://hub.docker.com/_/microsoft-dotnet-runtime/)\n- Site uses the ASP.NET runtime: [`mcr.microsoft.com/dotnet/aspnet:7.0-alpine`](https://hub.docker.com/_/microsoft-dotnet-aspnet/)\n\n[Giraffe]: https://giraffe.wiki/\n\n## Prerequisites\n\n- Since this uses Docker Compose, you likely need [Docker Desktop](https://www.docker.com/products/docker-desktop/).\n  **IMPORTANT:** Please review the licensing costs/terms if this is for business use.\n- For development, you need the [.NET 7 SDK](https://dotnet.microsoft.com/en-us/download)\n- You are strongly encouraged to use the latest stable release of [Posh](https://github.com/PowerShell/PowerShell/releases)\n\n## Getting started\n\nTo start local development, you can use `up.cmd`, which runs the following:\n\n```\ndocker compose -f compose.yaml -f compose.local.yaml up --build -d\n```\n\nYou will then need to open terminals in both the `Server` and `Worker` folders and run `dotnet watch` on each.\n\nThe web server can be accessed on [port 5000](http://localhost:5000) and the RabbitMQ console is on [port 15672](http://localhost:15672).\n\nWhen you are finished, kill the `dotnet watch` jobs and then run `down.cmd`, which does the following:\n\n```\ndocker compose -f compose.yaml -f compose.local.yaml down\n```\n\n### Setting up for Azure\n\n**REMEMBER:** Take note of whatever you choose for the uppercase names in this section, as they are needed later.\n\nFrom your Posh terminal, install the Az module:\n\n```\ninmo az\n```\n\nIn future sessions, you can use `ipmo az` to `Import-Module`, instead of `inmo az` (`Install-Module`).\n\nTo work with Azure, you obviously need an account, so I assume that has been done and you are logged into it in your default browser.\nNow you need to connect your terminal session to it:\n\n```\nConnect-AzAccount\n```\n\nCreate a Resource Group for all this junk:\n\n```\nNew-AzResourceGroup -Location australiasoutheast -Name MY-RESOURCE-GROUP\n```\n\nPick a fancy, globally-unique name to create a Container Registry for your Docker Images:\n\n```\nNew-AzContainerRegistry -Name MY-REGISTRY -ResourceGroupName MY-RESOURCE-GROUP -Sku Basic\n```\n\nYou need a Docker Context that is connected to your Azure account:\n\n```\ndocker context create aci MY-AZURE-CONTEXT\n```\n\nYou now have enough information to generate the secrets that are needed for deployment.\nFirst make up a username and password for your RabbitMQ user:\n\n```\n$User = Get-Credential\n```\n\nThen use the registry details along with your new credential object to create all the files:\n\n```\n./New-Secrets.ps1 -AzureRegistry MY-REGISTRY -RabbitMQUser $User\n```\n\n### Azure\n\nTo be able to push images, you must be in your default context (rather than the Azure one you just created):\n\n```\ndocker context use default\n```\n\nThe Azure registry seems to complain about Docker Hub images, so they need to be tagged and pushed:\n\n```\ndocker tag rabbitmq:3.11.9-management-alpine MY-REGISTRY.azurecr.io/rabbitmq:3.11.9-management-alpine\n\ndocker push MY-REGISTRY.azurecr.io/rabbitmq:3.11.9-management-alpine\n```\n\nThen push the service images:\n\n```\ndocker compose -f compose.yaml -f compose.azure.yaml push\n```\n\nNow switch to your Azure context:\n\n```\ndocker context use MY-AZURE-CONTEXT\n```\n\nYou can finally start the containers to see all your hard work:\n\n```\ndocker compose -f compose.yaml -f compose.azure.yaml up -d\n```\n\nUse `docker ps -a` to find the IP address for the server container, and then you can navigate to this in your browser.\n\nWhen you're finished:\n\n```\ndocker compose -f compose.yaml -f compose.azure.yaml down\n```\n\n## Documentation\n\n- [Tutorial: Deploy a multi-container group using Docker Compose](https://learn.microsoft.com/en-au/azure/container-instances/tutorial-docker-compose)\n\n### Giraffe\n\n- [Giraffe docs](https://giraffe.wiki/docs)\n\n### RabbitMQ on .NET\n\n- [NuGet](https://www.nuget.org/packages/RabbitMQ.Client)\n- [API documentation](https://rabbitmq.github.io/rabbitmq-dotnet-client/index.html)\n- [API guide](https://www.rabbitmq.com/dotnet-api-guide.html)\n- [`ConnectionFactory`](https://rabbitmq.github.io/rabbitmq-dotnet-client/api/RabbitMQ.Client.ConnectionFactory.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattms%2Ftry-rabbitmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattms%2Ftry-rabbitmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattms%2Ftry-rabbitmq/lists"}