FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat!: Upgrading java-http-client to use apache httpclient5 by ryantomlinson95 · Pull Request #148 · sendgrid/java-http-client · GitHub

feat!: Upgrading java-http-client to use apache httpclient5 - #148

Open
ryantomlinson95 wants to merge 2 commits into
sendgrid:mainfrom
ryantomlinson95:upgrade-to-httpclient5
Open

feat!: Upgrading java-http-client to use apache httpclient5#148
ryantomlinson95 wants to merge 2 commits into
sendgrid:mainfrom
ryantomlinson95:upgrade-to-httpclient5

Conversation

Copy link
Copy Markdown

Fixes #147

sendgrid-java, specifically the constructor that consumes a Client is currently incompatible with apache httpclient5 due to it's dependency on this repository, a simplified version of the http client. In order for projects on httpclient5 to use sendgrid-java, this dependency needs to be updated first.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

If you have questions, please file a support ticket, or create a GitHub Issue in this repository.

sendgrid-java is currently incompatible with apache httpclient5 due to it's dependency on this simplified version of the http client. In order for projects on httpclient5 to use sendgrid-java, this dependency needs to be updated first.

Copy link
Copy Markdown
Author

I used the official Apache guide for the migration: https://hc.apache.org/httpcomponents-client-5.3.x/migration-guide/migration-to-classic.html, as well as other resources like some of the namespace mappings from here: https://docs.openrewrite.org/recipes/apache/httpclient5/upgradeapachehttpclient_5_classmapping.

Comment thread src/main/java/com/sendgrid/Client.java Outdated
throw ex;
}
uri = buildUri(request.getBaseUri(), request.getEndpoint(), request.getQueryParams());
httpGet = new HttpGet(uri.toString());

jkosternl Sep 7, 2024
edited
Loading

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You can even move the declaration and assignment to the same line, to merge line 170 with 173. The same is valid for the other methods: post, patch, put below.. etc.
Looking good, for the rest. 👍🏻

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks, fixed!

jkosternl left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looking good to me! (I am not a maintainer on this project btw). Hopefully it gets merged and approved by others as well.

ryantomlinson95 commented Sep 9, 2024
edited
Loading

Copy link
Copy Markdown
Author

My suggestion for this PR would be to release it under a new major version, such that it is clear that it is a breaking change for consumers. Then we can also update sendgrid-java with a major version change, again to not break existing functionality for consumers of that library.

Copy link
Copy Markdown

Opened a linking issue in the main repo to hopefully make this more visible: sendgrid/sendgrid-java#772

Copy link
Copy Markdown

Is anyone watching this?

The-Funk commented Apr 28, 2026
edited
Loading

Copy link
Copy Markdown

Bumping this, I have a big project going to Spring 6 and this library might be problematic. We may have to move away from SendGrid. At this point the Apache HTTP Client V4 hasn't received an update in 4 years. It's probably worth reviving this. Let me know if help is needed. I have experience replacing the Apache V4 Client with other clients.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump Sendgrid http client library to use latest apache http client 5

5 participants


Back | FazBrowse Home | New Git URL