Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interlok 4071 expose timeout options #1167

Merged
merged 2 commits into from
Jun 9, 2023

Conversation

jameswickham
Copy link
Contributor

Motivation

So we can expose the timeout options that are available in the standard http producer.

Modification

Updated the class HttpRequestServiceImp so it gives the timeout options in the UI and when creating a StandardHttpProducer object we pass in the timeout values that have been set.

Also added a new unit test that tests that the read timeout will throw an exception if it is exceeded.

PR Checklist

  • been self-reviewed.
  • Added javadocs for most classes and all non-trivial methods
  • Added supporting annotations (like @XStreamAlias / @ComponentProfile)
  • [n/a] Added DefaultValue annotation when there is a default value (e.g. @DefaultValue('true'))
  • Added validation annotation (@NotNull...) when required and add @Valid when nested class has some validation
  • [n/a] Checked that @NotNull and @notblank annotations have a meaningful message when appropriate.
  • [n/a] Checked that new 3rd party dependencies are appropriately licensed
  • Added comments explaining the "why" and the intent of the code wherever it would not be obvious for an unfamiliar reader
  • Added unit tests or modified existing tests to cover new code paths
  • Tested new/updated components in the UI and at runtime in an Interlok instance
  • Reviewed java class members so that missing annotations are added (InputFieldDefault/ComponentProfile etc)
  • Checked that javadoc generation doesn't report errors
  • Checked the display of the component in the UI
  • [n/a] Remove any config/license annotations
  • Check the gradle build file to make sure the dependencies section is more explicit "implementation/api".

Result

The end user is now able to choose and swet connect and read timeout durations when using this service.

Testing

You can create a channel->workflow that creates a request using a polling consumer and the HttpRequestService(making sure you have the read timeout set) then create a second channel->workflow that can mock a http endpoint by using a Jetty connection and consumers. Within that workflow include a wait service followed by a jetty response service. Make sure the wait service time period is longer than whatever the read timeout is.

@codecov
Copy link

codecov bot commented Jun 8, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.06 ⚠️

Comparison is base (f5e7f97) 93.41% compared to head (0cc011d) 93.36%.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #1167      +/-   ##
=============================================
- Coverage      93.41%   93.36%   -0.06%     
+ Complexity     10859    10853       -6     
=============================================
  Files           1054     1054              
  Lines          29097    29095       -2     
  Branches        2034     2034              
=============================================
- Hits           27182    27164      -18     
- Misses          1493     1510      +17     
+ Partials         422      421       -1     
Impacted Files Coverage Δ
...s/core/http/client/net/HttpRequestServiceImpl.java 100.00% <100.00%> (ø)
...services/metadata/AddTimestampMetadataService.java 100.00% <100.00%> (ø)

... and 7 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@higgyfella higgyfella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@higgyfella higgyfella merged commit e753b11 into develop Jun 9, 2023
8 checks passed
@higgyfella higgyfella deleted the INTERLOK-4071-expose-timeout-options branch June 9, 2023 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants