Make usage of http clients (apache, OkHttp, Jetty, Asynch) easier
@ManishS6 đang làm issue này rồi.
Từ ngày 4/10/2024.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu bằng việc đọc Cloudinary.loadStrategies(), Cloudinary.class và Configuration.class để hiểu cách tải strategy hiện tại và cấu hình dựa trên Map. Xem lại cách các strategy Apache, OkHttp, Jetty và Asynch được chọn, cũng như cách cấu hình được truyền đến constructor. Done cần cung cấp một cách thức đã được quyết định và có tài liệu để consumer chọn HTTP client và cấu hình chúng mà không cần một Map không minh bạch.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Feature request for Cloudinary Java SDK
General idea: making the settings of http client library to be used easier for consumers of the SDK,
by enabling configuration via new Cloudinary(...) constructor.
Explain your use case
I want to use plain java http client, instead of Apache one.
Describe the problem you’re trying to solve
In Cloudinary.loadStrategies() there's a fixed list of strings with classnames, which a consumer of the SDK can't change.
This means even if I provide my own strategy, this will not loaded and I still being forced to add dependency for apache http.
(hint: technically: when the class om.cloudinary.http5.ApiStrategy is not found, an UnknownError is thrown, which is bad)
Also this brings me to another point: the constructor of Cloudinary should better accept Configuration object, instead of Map config. It's very annoying for me as an SDK user, to provide a Map with configs.
I get no auto-completion on Maps and must find details in either source code or documentation (which is just cumbersome).
So I don't know immediately what config options are available, that I could e.g. provide HTTP proxy address.
(Sorry, if I mix two problems here ... I came to these two, when I thought about a solution proposal, below)
Do you have a proposed solution?
YES.
The constructor of Cloudinary.class (or better the Configuration.class) could have some new field apiStrategy of type class<AbstractApiStrategy>. And another one for the UploadStrategy.
Then, the loadStragies() method will not load by name (which can contain typos), but rather by class(type) directly.
On the second problem, adding a new (overloaded) constructor to Cloudinary is easy to add, but that's not sufficient.
Ideally, the Configuration class will provide a convenient Builder function, so users of the SDK are better guided,
and plausibility checks can easier be implemented.
I'm happy to provide a PR, if this resonates with you.
- Ngôn ngữ chính
- Java
- Star
- 176
- Fork
- 113
- Merge trung bình
- 9 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cloudinary/cloudinary_java
-
`options` map modified directlyCó thể làm lại được @adimiz1 đã nhận 481 ngày trước và không có pull request nào đang mở. Đang mở
cloudinary/cloudinary_java#383 · 3 bình luận · 1 reaction · 1 người được giao ·
-
Api#resourceByAssetID does not support same options as in documentationCó thể làm lại được @adimiz1 đã nhận 646 ngày trước và không có pull request nào đang mở. Đang mở
cloudinary/cloudinary_java#357 · 2 bình luận · 1 người được giao ·
-
Readme - Maven dependencyCó thể làm lại được @adimiz1 đã nhận 754 ngày trước và không có pull request nào đang mở. Đang mở
cloudinary/cloudinary_java#349 · 1 bình luận · 1 người được giao ·
-
cloudinary-http5 ignores system propertiesCó thể làm lại được @adimiz1 đã nhận 754 ngày trước và không có pull request nào đang mở. Đang mở
cloudinary/cloudinary_java#348 · 2 bình luận · 1 người được giao ·
-
Missing contributing guidelinesCó thể làm lại được @debnath003 đã nhận 768 ngày trước và không có pull request nào đang mở. Đang mở
cloudinary/cloudinary_java#339 · 2 bình luận · 1 người được giao ·
Tất cả issue của cloudinary/cloudinary_java
Issue tương tự
-
bug(core): skip_nodes.json is missing SELECT and PRE, causing Python and Java to insert separators into dropdown options and preformatted textCó thể đã có người làm @Bhumit267 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ExceptionThrowShouldUseContext: NullPointerException on a catch block inside an annotation typeCó thể đã có người làm @Carbon14-48 đã nhận hôm nay. Đang mởapproved
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
checkstyle/checkstyle#22784 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
ASSERT-KTH/depclean#591 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Api537FlareFlameModel.setStackHeightM accepts a negative heightCó thể đã có người làm @EvenSol đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày