feat: added retryMax middleware#2808
feat: added retryMax middleware#2808BohdanStarunskyi wants to merge 1 commit intolabstack:masterfrom
Conversation
|
is not the retry something that API consumer should do and not the API itself? I am little bit reluctant to accept this as this is quite complex and experience from timeout middleware shows that there are times that people add core middlewares to their application without understanding in which use-case they actually need it (without considering if they have transactions etc complex functionality withing their application business layer). |
Thanks for sharing your experience! I get that retries are usually handled on the client side, and adding them on the server can get tricky—especially when there’s complex logic or transactions involved. The idea of this middleware is just to make retries optional and easy for developers who want them—kind of like Express’s retryMax. It doesn’t force retries; it’s just a helper you can choose to use. I’m happy to discuss adding some warnings in the docs or tweaking the approach to make it safer if you think that’s needed. |
Add RetryMax Middleware for Automatic Request Retries
Description
Implements a new
RetryMaxmiddleware that provides automatic retry functionality for failed requests, addressing the need for production-ready retry mechanisms in Echo applications.Feature request #2507
Features
Core Functionality
Advanced Features
Configuration Options
Usage Examples
Basic Usage
Advanced Configuration
With External Store
Implementation Details
Retry Flow
Storage Interface
The middleware supports pluggable storage through the
RetryMaxStoreinterface:Default Behavior
Error Handling
RetryableCheckerfunctionTesting
Comprehensive test suite covering:
Migration from Custom Implementation
For users with existing retry implementations:
Performance Considerations
Breaking Changes
None - this is a new middleware addition with no impact on existing code.