fix: reuse MicroProfile mirror-node REST client#85
Open
alejandroGM0 wants to merge 1 commit intohiero-ledger:mainfrom
Open
fix: reuse MicroProfile mirror-node REST client#85alejandroGM0 wants to merge 1 commit intohiero-ledger:mainfrom
alejandroGM0 wants to merge 1 commit intohiero-ledger:mainfrom
Conversation
…rror-node Every doGetCall and RestBasedPage constructor built a new jakarta.ws.rs.client.Client without closing it, and only HTTP 404 was translated; other 4xx/5xx responses were parsed as valid JSON payloads and surfaced as silent empty results. - Cache a single Client + WebTarget in MirrorNodeRestClientImpl; make it AutoCloseable; close Response objects with try-with-resources. - Reuse the shared WebTarget in RestBasedPage so pagination no longer spawns a client per page. - Promote MirrorNodeRestClientImpl to an @ApplicationScoped CDI producer and release it via @Disposes. - Non-404 4xx/5xx responses now raise HieroException (or IllegalStateException from RestBasedPage, where Page.next() is unchecked) with the status code and path. - Add MirrorNodeRestClientImplTest covering 200/404/4xx/5xx, query-string parsing, repeated calls, and close() idempotency using a local com.sun.net.httpserver stub. Closes hiero-ledger#78 Signed-off-by: Alejandro <26930485+alejandroGM0@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
Closes #78