Magnus Mårtensson
Microsoft Regional Director, Azure MVP, CEO Loftysoft
Avirag Jain
Director & CTO R Systems
Mahesh Chand
Founder C# Corner, CEO Mindcracker
Chris Gali
CEO & Co-Founder Graphite
Subinder Khurana
Chief Architect StoryProcess, Founder NASSCOM DeepTech Club
Bryan Rishforth
Investor, Chairman Graphite
Bryn Everson
Director Biz Dev Graphite
Raj Tiwari
Digital Transformation Leader, Futurist and Visionary
Joseph Guadagno
Microsoft MVP, Lead Quicken Loans
Nikita Sachdev
Entrepreneur, Blockchain Enthusiast & Advisor, Social Media Influencer
Doug Wagner
COO & Founder Adapt Technical Group
Ritesh Modi
Architect, Senior Evangelist, Cloud Architect
Crystal Wenrick
Director Communications Mindcracker
Allen O’Neill
Microsoft MVP, Consulting Engineer/Architect
Praveen Kumar
CEO MCN Solutions
Chris Love
Founder Love2Dev, Microsoft MVP, Author
Sanjay Vyas
Microsoft Regional Director, Microsoft MVP, Founder & CEO SkillLabs Technologies
Veena Sarda
Deep Learning Consultant, Author
Sekhar Srinivasan
C# Corner MVP, Microsoft Certified Trainer, Pluralsight Author
Lalit Bansal
Founder & CEO - EIY SYS
Navdeep Garg
CEO Revinfotech
Prakash Tripathi
Tech Manager/Leader, Microsoft MVP, Blogger
Bhavna Jain
Breakthrough Consultant
Naveen Sharma
Enterprise Architect, Leadership Coach, Author
Vidya Vrat Agarwal
Principal Architect, Microsoft MVP, Author
Sheetal Agarwal
Founder Clownselors, Medical Clown, Trainer
Abhishek Kant
Founder GTM Catalyst
Vishnu Saran
Founder & CEO VoiceQube
Sandeep Soni
Founder & CEO Deccansoft, Microsoft Certified Trainer
Parveen Malik
AVP InfoSec & Vulnerability Management, Information Security Expert
Nitin Pandit
Microsoft MVP, Developer Evangelist, Author
Niloshima Srivastava
C# Corner MVP, Tech Architect, Trainer, Blogger
Bala Chirtsabesan
Senior Software Engineer at Microsoft, Author
Manoj Mittal
Sr. Technical Architect, C# Corner MVP, Author
Chandni Di
Co-Founder Voice of Slum
Vithal Wadje
Technical Lead, Microsoft MVP, Author
Shivam Ahuja
Founder SkillCircle, Business Mentor
Chervine Bhiwoo
Solution Architect, Microsoft MVP, Author
Saurabh Jain
Vice President Paytm, Founder Fun2Do Labs, Author
Vinay Solanki
Head IoT at Lenovo, Founder IoT-NCR
Anshu kumari
Founder Blockchainkids, Inventor, Trainer
Amit Singal
CEO Startup Buddy
Dev Pratap
Co-Founder & CEO Voice of Slum
Amey Vartak
Technology Consultant, Full Stack Developer, C# Corner MVP, Author
Viswanatha Swamy
Principal Software Engineer, C# Corner MVP, Author
Sanket Verma
Research Engineer @ Ballistics (Forensics) and Chair, PyData Delhi
Sourabh Somani
Lead Developer, Microsoft MVP, Author
Abhishek Mishra
Software Architect, C# Corner MVP, Author
Siddharth Vaghasia
Technical Consultant, C# Corner MVP, Blogger
Bassam Alugili
Senior Software Specialist, Database Expert
S Ravi Kumar
Solution Architect, C# Corner MVP, Author
Sundaram Subramanian
Full Stack Developer, C# Corner MVP, Speaker
Deepesh Somani
Solution Architect, Microsoft MVP, Author
Debasis Saha
Technical Project Manager, C# Corner MVP, Blogger, Author
Vipul Jain
Software Architect, C# Corner MVP, Author
Akshay Patel
Technical Architect, Microsoft Certified Trainer, C# Corner MVP, Author
Stephen Simon
RPA Developer, Evangelist, Author
Vivek Sharma
Founder Kingster636, AR/VR Specialist
Jeetendra Gund
Technical Lead, C# Corner MVP, Author
Sujal Beniwal
AI Enthusiast, Student
M Viknaraj
Microsoft MVP, Azure Architect, Author
Prasham Sabadra
Software Architect, C# Corner MVP, Trainer, Author
Aakash Maurya
Senior Developer, C# Corner MVP, Speaker
Ankit Sharma
Senior Software Engineer, C# Corner MVP, Author
Mangesh Gaherwar
Team Lead, C# Corner MVP, Author
Viral Jain
Technical Consultant, C# Corner MVP, Author
Bhasker Das
Solution Architect, Evangelist
Manish Dwivedi
Associate Project Manager
Ck Nitin
Programmer, Author
Rohit Gupta
Technical Trainer, Author
Manish Tewatia
Full-stack Marketer, UX Designer
Bhavya Gaur
Technical Illustrator
Rohit Tomar
SEO/SMO Expert
Web Track
Cloud & Data Track
Dev Track
Registration & Breakfast
Future of Desktop Apps with JS (ElectronJs)
Nitin Pandit
Building Serverless Microservices Using Microsoft Azure
Vithal Wadje
Innovating RPA: A Robot for Every Person
Stephen Simon
Managing Cloud Storage Accounts using Logic Apps
Viknaraj Manogararajah
Data visualization using Python
Sekhar Srinivasan
Going Cross platform with AR Foundation
Vivek Sharma
Keynote
Managing your Azure dependencies in ASP.NET Core apps using VS
Bala Chirtsabesan
Securing Applications on Intelligent Azure
Abhishek Mishra
Getting started with Blazor the Framework of Future
S Ravi Kumar
Lunch
Build Progressive Web Apps using Angular 9
Debasis Saha
Build and deploy to any platform using Azure DevOps
Chervine Bhiwoo
Deep Dive in Azure Service Bus
Akshay Patel
Build a Native Mobile Application using React Native and JavaScript
Joseph Guadagno
Making sense of Web Job, Web Job SDK and Functions in Azure
Prakash Tripathi
CloudFront Distribution in AWS
Viral Jain
Tea Break
Introduction to PowerBI
Aakash Maurya
Build Advanced SPFx solutions with React and Graph API
Siddharth Vaghasia
Build Business Intelligence Analyst (BIA) Skills
Sundaram Subramanian
Deep dive of Power Platform – AI BUILDER
Prasham Sabadra
Panel 1
What's new in SharePoint development
Vipul Jain
Build a SSO (Single Sign On) based Native JavaScript application with Microsoft Identity within 10 minutes
Manoj Mittal
Panel 2
Applications and working of AI
Veena Sarda
Deploying serverless API's with .Net core 3.0 on AWS & Azure
Amey Vartak
Panel 3
Blockchain with .NET Core (Ark)
Anshu Kumari
Closing Note & Prize Distribution
Dev Track
Cloud Track
Architecture Track
Emerging Tech Track
Registration & Breakfast
Creating Full-Stack Web Apps Using Server-Side Blazor
Ankit Sharma
Real time face recognition with MS Cognitive Services
Niloshima Srivastava
Building Scalable APIs with GraphQL
Jeetendra Gund
Future of development with AI and Blockchain
Navdeep Garg
Debugging Tips and Tricks with Visual Studio 2019
Joseph Guadagno
Azure Containers
Abhishek Kant
Enterprise Architecture
Naveen Sharma
Bot Framework - learn it fast and look like a boss!
Allen O’Neill
Keynote
.Net Core & C# 8 Performance
David McCarter
Working with Azure kubernetes services
Ritesh Modi
Becoming an Architect
Vidyavrat Agarwal
Why Techies Need to Learn Product Management
Saurabh Jain
Lunch
Build a rules engine in .Net Core
Sanjay Vyas
Building CI and CD Pipeline using Azure DevOps
Sandeep Soni
Entity Framework Core - Tips and Tricks, Performance Optimization, and Tuning
Bassam Alugili
Hacking your way into Data Science
Sanket Verma
Speed up your .Net Core Website
Sourabh Somani
Azure
Magnus Mårtensson
Demystifying Open Distro for Elasticsearch
Suman Debnath
Future of Data
Shivam Ahuja
Tea Break
gRPC with C# and .Net Core
Mangesh Gaherwar
Panel 1
Essentials of Cloud security
Parveen Malik
Power platform and Dynamics 365
Deepesh Somani
Microservices - the gRPC Way
Viswanatha Swamy
Panel 2
Reserved
Reserved
Closing Note & Prize Distribution
Retry and backoff decorators in C#
Cloud-backed C# systems rarely fail in a tidy way. A request can time out while crossing an internet connection, an Azure endpoint can return a temporary 503, or a dependency can reset a socket after accepting the operation. Retrying those failures can restore the user experience, but retrying every error can duplicate work and turn a minor incident into a retry storm.
The practical pattern is a retry-and-backoff decorator: an operation is wrapped with a policy that decides whether another attempt is safe and how long to wait. For developers following the C#, Azure and DevOps themes at C# Corner Annual Conference 2020, this is a practical bridge between clean application design and the unpredictable behaviour of distributed services.
Why retries belong in a decorator
A decorator receives the original operation as a dependency and exposes a similar contract. Here, the inner dependency is Func<CancellationToken, Task<T>>, while the decorator adds attempts, delays and failure classification. Business code still requests a result, but it no longer needs to know whether that result came from a cache, a local service or a remote API.
The boundary matters because retry behaviour is operational policy rather than business logic. A payment confirmation and a read-only catalogue lookup may use the same delegate but require different limits. Keeping those decisions in policy objects also makes them testable and prevents every call site from inventing a different delay. Retry ownership should also sit at one layer: if an HTTP handler, SDK and application each retry three times, one user request can create 27 downstream calls.
Australian teams in Sydney, Melbourne and Brisbane commonly combine Australian-hosted workloads with global SaaS and payment providers. Many Australian NBN connections are strong, yet mobile access, congested links and last-mile faults still produce timeouts; a decorator can absorb a brief interruption without pretending the network is perfectly reliable.
How to implement a retry and backoff decorator in C#
Start with a generic decorator that delegates one cancellable asynchronous operation. The policy controls the maximum attempts and decides whether an exception is transient. The catch filter deliberately excludes a cancelled token, so caller cancellation ends the sequence immediately instead of being mistaken for a retryable timeout.
public sealed class RetryBackoffDecorator<T>
{
private readonly Func<CancellationToken, Task<T>> _inner;
private readonly RetryPolicy _policy;
public RetryBackoffDecorator(
Func<CancellationToken, Task<T>> inner,
RetryPolicy policy)
{
_inner = inner ?? throw new ArgumentNullException(nameof(inner));
_policy = policy ?? throw new ArgumentNullException(nameof(policy));
}
public async Task<T> ExecuteAsync(CancellationToken cancellationToken)
{
for (var attempt = 1; ; attempt++)
{
try
{
return await _inner(cancellationToken);
}
catch (Exception exception) when (
attempt < _policy.MaxAttempts &&
!cancellationToken.IsCancellationRequested &&
_policy.IsTransient(exception))
{
await Task.Delay(
_policy.GetDelay(attempt),
cancellationToken);
}
}
}
}
After a transient failure, the decorator calculates a delay and waits through Task.Delay. The filter also stops after the final attempt, allowing that exception to propagate with its original stack trace. Because the loop sits around the delegate, one policy can protect an HTTP call, a queue publish or a database command without changing those implementations.
public sealed class RetryPolicy
{
private static readonly Random RandomSource = new Random();
private static readonly object RandomLock = new object();
private readonly TimeSpan _baseDelay;
private readonly TimeSpan _maximumDelay;
public int MaxAttempts { get; }
public Func<Exception, bool> IsTransient { get; }
public RetryPolicy(
int maxAttempts,
TimeSpan baseDelay,
TimeSpan maximumDelay,
Func<Exception, bool> isTransient)
{
if (maxAttempts < 1)
throw new ArgumentOutOfRangeException(nameof(maxAttempts));
if (baseDelay < TimeSpan.Zero)
throw new ArgumentOutOfRangeException(nameof(baseDelay));
if (maximumDelay < baseDelay)
throw new ArgumentOutOfRangeException(nameof(maximumDelay));
MaxAttempts = maxAttempts;
_baseDelay = baseDelay;
_maximumDelay = maximumDelay;
IsTransient = isTransient ??
throw new ArgumentNullException(nameof(isTransient));
}
public TimeSpan GetDelay(int failedAttempt)
{
var exponential = _baseDelay.TotalMilliseconds *
Math.Pow(2, failedAttempt - 1);
var ceiling = Math.Min(
exponential,
_maximumDelay.TotalMilliseconds);
double sample;
lock (RandomLock)
{
sample = RandomSource.NextDouble();
}
var jitter = 0.5 + (sample * 0.5);
return TimeSpan.FromMilliseconds(ceiling * jitter);
}
}
The broad HttpRequestException predicate is safe only when it represents a transport failure. If application code calls EnsureSuccessStatusCode, the predicate should inspect the status code and exclude permanent responses such as 400, 401, 403 and 404. On older .NET targets, map the status into a custom exception when HttpRequestException.StatusCode is unavailable.
var policy = new RetryPolicy(
maxAttempts: 4,
baseDelay: TimeSpan.FromMilliseconds(200),
maximumDelay: TimeSpan.FromSeconds(5),
isTransient: exception =>
exception is TimeoutException ||
exception is HttpRequestException);
var status = await new RetryBackoffDecorator<string>(
token => apiClient.GetStatusAsync(token),
policy)
.ExecuteAsync(cancellationToken);
Designing delays that reduce contention
Backoff grows the wait after each failed attempt, commonly as base delay × 2^(attempt - 1), and caps it at a maximum. A policy with a 200-millisecond base delay calculates 200, 400 and 800 milliseconds before jitter, while a ceiling prevents a long outage from producing minute-long pauses inside a request.
Jitter prevents many clients from retrying in lockstep. Equal jitter keeps half of the calculated delay fixed and randomises the other half, spreading retries while still guaranteeing some pause. Randomised timing also reduces synchronised pressure on a recovering dependency, which matters when hundreds of Australian users begin the same workday together.
An end-to-end deadline is more useful than an attempt count alone. The caller supplies a cancellation token with enough remaining time for the operation, its delays and a final response. Timestamps should be stored in UTC: Sydney and Melbourne observe daylight saving while Brisbane does not, and mixed local and UTC logs can otherwise resemble unexplained gaps in service history.
Classifying failures before retrying
A useful classifier divides failures into transient and permanent categories. Timeouts, connection resets, temporary DNS failures and selected HTTP responses such as 408, 429, 502, 503 and 504 may justify another attempt. Validation failures, authentication problems, missing resources and unhandled application exceptions should normally travel directly to the caller.
The response code alone does not tell the whole story. A 500 can indicate a permanent defect, while a 503 may include a Retry-After value. Honour that server guidance within the caller's deadline, but cap it so a remote hint cannot extend the operation indefinitely. A client-side maximum must remain the final authority.
Choosing an Australian cloud region can reduce round-trip time, but it cannot remove upstream dependencies. An Azure workload in Australia East, around Sydney, or Australia Southeast, around Melbourne, may still call identity, payment or content services elsewhere. Classify the observed failure and avoid assuming that local placement guarantees availability.
Protecting business operations from duplicates
Retries are straightforward for idempotent reads and much riskier for writes. A timeout can mean that a server never received a request, or that it committed the change and the response was lost. Repeating an unsafe POST can therefore create a duplicate payment, order or database record even though every network attempt failed.
Give write operations an idempotency key or client-generated operation identifier, and require the server to store and deduplicate that key. Australian banks, fintech businesses and online retailers commonly reconcile AUD amounts and GST records, so a duplicated ledger entry can create a real compliance and customer-support problem rather than a harmless extra API call.
The decorator should also pass through correlation identifiers and preserve the original operation’s semantic data. Retrying a changed request, such as one with a newly generated invoice number, breaks the protection offered by a stable key. For non-idempotent work, use a queue with server-side deduplication or a workflow that can reconcile uncertain outcomes.
Testing retry behaviour under real conditions
Unit tests should control time rather than sleep through it. Inject a delay scheduler or delay calculator, supply a deterministic random sample, and assert the number of attempts, selected exceptions, calculated waits and final outcome. The tests can then cover cancellation and deadline expiry in milliseconds without making the build slow or flaky.
Integration tests need controlled dependency faults. A proxy can reset connections, delay responses, return 429 or 503, and then recover on schedule. Run these tests against a staging dependency with realistic concurrency, since a decorator can pass a sequential unit test while creating a retry storm when many requests fail together.
Resilience planning resembles the discipline of open-water events such as the Lake Powell Challenge, where currents, weather and pacing make a fixed plan insufficient. The technical parallel is direct: assume conditions will change, rehearse recovery paths and preserve enough control to stop when the environment becomes unsafe.
Production guidance for resilient services
Telemetry should distinguish the first attempt from later attempts. Record the dependency name, attempt number, elapsed time, exception type, status code and terminal result, then attach the trace and correlation identifiers. This makes a degraded dependency visible without treating expected retries as separate business transactions.
Retry budgets also protect availability and cloud costs. Repeated calls can increase metered requests, queue operations and network egress; those charges appear on Australian invoices in AUD, commonly with GST. Cap attempts, coordinate limits with the dependency and use a circuit breaker when failures persist rather than asking every client to retry indefinitely.
- Set explicit attempt, delay and end-to-end deadline limits for each dependency.
- Retry only failures classified as transient, with separate policies for reads and writes.
- Apply exponential backoff with jitter and respect bounded
Retry-Afterguidance. - Require idempotency keys or reconciliation before retrying business writes.
- Emit per-attempt telemetry and alert on retry volume and terminal failure rates.
A production-ready decorator is therefore more than a loop: it is a bounded, observable and operation-aware resilience layer that improves recovery without amplifying failure.
1, CBD, Maharaj Surajmal Road, Near Yamuna Sports Complex, Delhi, 110032
GENERAL QUERIES
Manish Tewatia
manish@csharpcon.com
+91-9718-431-042
TICKET QUERIES
Atul Gupta
conference@csharpcon.com
+91-9910-125-804