CDCgov / prime-reportstream

ReportStream is a public intermediary tool for delivery of data between different parts of the healthcare ecosystem.
https://reportstream.cdc.gov
Creative Commons Zero v1.0 Universal
72 stars 40 forks source link

refactor RestTransport and SoapTransport use of ktor client to use Apache5 engine instead of Apache engine #15450

Open david-navapbc opened 3 months ago

david-navapbc commented 3 months ago

User Story

AS a RS developer WHEN I write code that makes REST calls THEN I want system resources resultant from that call to be freed upon completion of the call

Description/Use Case

RestTransport and SoapTransport both use ktor with the Apache4 engine. The Apache4 engine does not free connection pool resources upon completion of the http call. Over time this can create performance and system stability challenges as system resources are not judiciously managed for our use case. Instead we should be using the Apache5 engine, which DOES free resources upon completion of an http call.

Risks/Impacts/Considerations

This should be a low-impact change. The only considerations are API changes between Apache4 and Apache5 engines may require minor refactoring of production and test logic.

Dev Notes

The changes that need to be made are simple and should be low impact. See HttpClientUtils to see how to replace the Apache engine with the Apache5 engine in our use of the ktor library for making http calls.

This ticket is resultant from aforementioned work done on HttpClientUtils. See ticket 13925 - particularly the last few comments in the work log - for all the gory detail and investigation in validating the hypothesis that the Apache5 engine will indeed free resources upon completion of an http call.

Acceptance Criteria

arnejduranovic commented 3 months ago

@david-navapbc Is this still needed considering PR https://github.com/CDCgov/prime-reportstream/pull/15658 reverts the Apache5 change?