[MGNLRESTCL-46] Timeout a REST request Created: 14/Feb/19  Updated: 04/Jun/21  Resolved: 27/Sep/19

Status: Closed
Project: REST Client
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0

Type: Story Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Quach Hao Thien
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 2.5d
Original Estimate: Not Specified

Issue Links:
causality
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: Declarative REST clients
Sprint: Declarative REST 6, Declarative REST 7
Story Points: 8

 Description   

As a developer, I can configure a timeout on a REST connection, so that my integration does not block my application.

A REST Client might not be able to get a response in a timely manner (for example due to the external system not responding, a change in the API of the external system, or a network issue). A developer needs tools to handle this eventuality, in particular that the system can continue without blocking.

For Example:

  • Some content is of secondary importance such as offers and promotions. Even if the REST source where you are getting the promos stops responding you still want to render the primary content of your site immediately.

Acceptance Criteria:

  • Ability to setup a timeout, and what should happen when a timeout is reached.
  • Ability to timeout on either the time-of-first-response, time-of-completion, or both.
  • Ability to fallback to cache when timeout is reached.
  • Abilty to return error when timeout is reached.


 Comments   
Comment by Quach Hao Thien [ 12/Sep/19 ]

Hi czimmermann,

I have one question, do you want to configure timeout for the restClient or for the specific restCall in that restClient or both?

Comment by Christopher Zimmermann [ 12/Sep/19 ]

I think only configuring it on the restClient itself is sufficient.

Comment by Christopher Zimmermann [ 12/Sep/19 ]

I am removing the "fallback to cache" acceptance criteria, because once the cache ticket is implemented (https://jira.magnolia-cms.com/browse/MGNLRESTCL-45) then the restClient will automatically use the cache when it is available.

Comment by Christopher Zimmermann [ 30/Sep/19 ]

thien.quach Please add a comment describing how this feature is used/configured by a developer - or pointing to one/some example restClient configurations.

Comment by Quach Hao Thien [ 30/Sep/19 ]

czimmermann please use this repo for timeout configuration https://git.magnolia-cms.com/users/thien.quach/repos/rest-timeout-demo/browse

the _boostrap dir contains importable groovy script use for testing.

Please ping me if you need more information. 

Generated at Mon Feb 12 10:42:40 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.