dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
865 stars 467 forks source link

Make CircuitBreakerUrl class more informative about when it fails #26373

Open victoralfaro-dotcms opened 1 year ago

victoralfaro-dotcms commented 1 year ago

User Story

As a Java backend developer, I want to add a property to the CircuitBreakerUrl class to act as a flag to throw (or not) an exception when the gotten response status from the HTTP client is not in the 2xx range. The default value for this property will be true to avoid breaking any existing functionality. When it's false, then it should not throw any exception and let the caller deal with the non-2xx HTTP status. Additionally, I want to leverage this user story to add some debugging information on the time elapsed when making requests to the CubeJS server.

Acceptance Criteria

  1. Create a property in the CircuitBreakerUrl class to control exception throwing for non-2xx HTTP responses.
  2. Set the default value of this property to true.
  3. Update the AnalyticsAPI, EventLogRunnable, and CubeJSClient components to set the flag to false where needed.
  4. Add logging for the time elapsed when making requests to the CubeJS server.
  5. Ensure that the code changes are well-documented and unit tested.

dotCMS Version

master

Proposed Objective

Core Features

Proposed Priority

Priority 2 - Important

External Links

Link to Slack Conversations Link to Support Tickets Link to Figma Designs

Assumptions & Initiation Needs

Quality Assurance Notes & Workarounds

Sub-Tasks & Estimates

  1. Create the property in CircuitBreakerUrl class - Estimated time: 2 hours
  2. Update AnalyticsAPI, EventLogRunnable, and CubeJSClient - Estimated time: 4 hours
  3. Add logging for time elapsed - Estimated time: 3 hours
  4. Documentation and testing - Estimated time: 5 hours
victoralfaro-dotcms commented 1 year ago

PR: https://github.com/dotCMS/core/pull/26364