Skip to content

Conversation

@rohanshah18
Copy link
Contributor

@rohanshah18 rohanshah18 commented Sep 18, 2023

Problem

The java sdk currently relies on AsyncHttpClient but keeping the long term goal in mind, will like to replace it with OkHttpClient. Also the errors raised are not clear enough for the users.

Solution

Replaced OkHttpClient for create and delete index functionalities. Also added httpErrorMapper which will provide details on why the exception occurred rather than throwing a high level IOException.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)
    This is neither a bug fix nor a new feature but knowing that in future we'll like to rely on OkHttpClient, it is best to replace it now before implementing rest of the control plane operations.

Test Plan

Added unit tests and ran integration locally to make sure the client works as it used to before and is backwards compatible.

@rohanshah18 rohanshah18 marked this pull request as ready for review September 19, 2023 15:24
Copy link
Contributor

@jhamon jhamon left a comment

Choose a reason for hiding this comment

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

In general I like the direction, OkHttpClient seems quite nice. But I do think we need some more iteration on this before merging (see comments below). I'm going to mark this as "Approve" so you can not be blocked while we're out of town if you make the requested changes and feel confident merging. But if you want another round of reviews, let us know.

@rohanshah18 rohanshah18 changed the title Update http client Update http client and improve error handling Sep 20, 2023
Copy link
Contributor

@jhamon jhamon left a comment

Choose a reason for hiding this comment

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

I left a few more suggestions, but overall it's looking great. Nice work.

Copy link
Contributor

@austin-denoble austin-denoble left a comment

Choose a reason for hiding this comment

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

Great work here swapping out AsyncHttpClient for OkHttpClient. Really appreciate your attention to detail and improving our error handling. 🎉

@rohanshah18 rohanshah18 merged commit 7b9de85 into main Sep 22, 2023
@rohanshah18 rohanshah18 deleted the rohan/updateHttpClient branch September 22, 2023 20:21
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.

4 participants