Proxying Agent for Dynamic Circuit Breaker Instrumentation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current circuit breaker technologies are primitive, requiring manual integration, coding, and are persistent, making them difficult to implement and manage, especially in third-party libraries and legacy code, and lack dynamic control and removal capabilities.
Innovation Solution
A proxying agent loads a circuit breaker framework into a class loader and instruments selected methods, allowing for dynamic monitoring and control of latency and exceptions, enabling circuit breakers to be applied without code changes and providing dynamic on/off capabilities.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If manual integration and coding are used to implement circuit breakers, then circuit breaker functionality can be achieved, but development resources and release timeframes are impacted
Solution Approach 1:
The patent introduces an intermediary framework that automatically instruments methods with circuit breaker logic. This framework acts as a mediator between the application code and circuit breaker implementation, eliminating the need for manual wrapping and integration code while preserving circuit breaker functionality.
Solution Approach 2:
The circuit breaker framework performs self-integration by automatically instrumenting target methods through bytecode manipulation or aspect-oriented programming. The system configures itself by scanning for annotated methods and applying circuit breaker logic without requiring manual coding or wrapping by developers.
2Reliability
If circuit breakers are integrated into application code, then circuit breaker control is achieved, but the integration becomes persistent and cannot be dynamically removed
Solution Approach 1:
The patent implements dynamic circuit breaker integration where the framework can be enabled or disabled at runtime without recompiling or reconfiguring application code. The instrumentation is applied dynamically through class loaders or runtime bytecode manipulation, allowing the circuit breaker functionality to be adapted, removed, or modified while the application is running.
3Reliability
If manual wrapping and subclassing are used to implement circuit breakers, then circuit breaker functionality is achieved, but code complexity and integration effort increase
Solution Approach 1:
The patent extracts circuit breaker logic from manual implementation and consolidates it into a separate framework. Instead of requiring developers to write wrapping code or create subclasses, the framework independently instruments target methods and manages circuit breaker state, significantly reducing code complexity and integration effort.
Solution Approach 2:
The framework provides universal circuit breaker functionality that can be applied to any annotated method across the application. A single framework implementation serves multiple methods and services, eliminating the need for separate wrapping code for each target method and reducing overall system complexity.
4Ease of manufacture
If third party libraries are excluded from circuit breaker control, then library functionality is preserved, but comprehensive monitoring and protection are reduced
Solution Approach 1:
The framework uses an intermediary approach that allows it to instrument and control third-party library calls without modifying the library code itself. By intercepting method calls at the application level or through bytecode transformation, the framework can apply circuit breaker logic to external dependencies while preserving their original functionality and maintaining compatibility.
Data Source
AI summary
In one embodiment, a proxying agent loaded at application startup loads a circuit breaker framework into a class loader, and also loads a circuit breaker proxy into an extension class loader seen by the proxying agent and by the application. The proxying agent may also instrument selected methods of the application, such that, when calling to run an instrumented method: an ID of the circuit breaker proxy is set to a trackable context, and the proxy execution may be held until exit of the run method (and if exit of the run method is due to a particular exception, an exception of the proxy may also be set to reflect the particular exception). The circuit breaker may then monitor the proxy for latency, exceptions, and circuit breaker trip criteria, and stops the run method in response to the latency, exceptions, or circuit breaker trip criteria surpassing a particular respective threshold.


