docker
4 TopicsHow to have dynamic Jittered Back-off for wait and retry in .Net core using polly
Hi, I am implementing wait and https://github.com/Polly-Contrib/Polly.Contrib.WaitAndRetry#new-jitter-recommendation see below. In the example below the delay is same. How can I make delay dynamic? var delay = Backoff.DecorrelatedJitterBackoffV2(medianFirstRetryDelay:TimeSpan.FromSeconds(1), retryCount: 3); var retryPolicy = Policy.Handle<FooException>().WaitAndRetryAsync(delay); In my Project, I have Azure function https://docs.microsoft.com/en-us/azure/azure-functions/functions-dotnet-dependency-injection public class Startup : FunctionsStartup { public override void Configure(IFunctionsHostBuilder builder) { var configuration = builder.GetContext().Configuration; builder.Services.RegisterService(configuration); } } public static IHttpClientBuilder RegisterService(this IServiceCollection serviceCollection,IConfiguration configuration) { return serviceCollection.AddHttpClient<IService, Service() .AddPolicyHandler(RetryPolicyHandler.GetRetryPolicy()) } public static IAsyncPolicy<HttpResponseMessage> GetRetryPolicy(IConfiguration configuration) { var delay =Backoff.DecorrelatedJitterBackoffV2(medianFirstRetryDelay: TimeSpan.FromSeconds(1), retryCount: 3); return HttpPolicyExtensions.HandleTransientHttpError().WaitAndRetryAsync(delay); } If you see the update code. Startup class override configure method that call register service>RetryPolicy. Startup-> Configure-> Register Service -> RetryPolicy My understanding is RetryPolicy will be called once (function startup) that will set the delay duration. Correct me if I am wrong? Sorry I am new to polly and github wiki does not have this information.How can I make delay dynamic?Please advice. Thanks2.1KViews0likes0CommentsOpen Source Microservices Platform Now Available
Hello! I have recently published a new open source microservices platform on GitHub. It is available under the MIT permissive license and is free to use for commercial purposes. I'm asking the .NET community for some help. https://ServiceBricks.com I am currently BETA testing and I'm looking for developers and architects to help me with the final push to make it production ready. I could use another set of eyes to help shore up the last remaining bits. ServiceBricks is a powerful platform designed to streamline the development, deployment, and maintenance of distributed systems. It provides domain-driven design, event-based architecture and a wealth of features to rapidly build new microservices and application quickly. Deploy single monoliths or distributed, multi-web applications using docker or kubernetes. There are several pre-built microservices to start from to build your own application infrastructures. They are also open source and all source code is available. Please drop me a line if you would like to help! I'm looking for discussions on microservices architecture and how they are implemented in code. Thanks! Danny313Views0likes0CommentsQuestion about Kubernetes Deployment tutorial on Microsoft Learn
I am going through the tutorial Module on Microsoft Learn titled "Deploy a .NET Microservice to Kubernetes" and am on the third unit located here: https://learn.microsoft.com/en-us/training/modules/dotnet-deploy-microservices-kubernetes/3-exercise-push-to-docker-hub. I am stuck under the "Verify the Docker images by creating containers in the codespace" heading on the fourth step. It tells you to select the port for the front end and open the service in a browser. However, there were no ports here that the step seemed to suggest were already there and I had to set it up. Given that the port for the frontend service of this tutorial is 32000:8080 according to the docker-compose.yml file for this tutorial project, is this what I should put in the ports tab? If so, the service does not display in my browser when I click on the globe icon as instructed by the tutorial and all I see is an HTTP 502 message. What should I do so that I can view the service? The repository for this tutorial service is located at https://github.com/MicrosoftDocs/mslearn-dotnet-cloudnative in the dotnet-kubernetes folder and I have attached images as well of the discussed configuration and error message below:93Views0likes0Comments