question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected dependency on httpclient-cache

See original GitHub issue

Description

Using the spring-boot-starter httpclient-cache seems to be a mandatory dependency, despite no caching is enabled.

Expected Behavior

If no caching is configured, httpclient-cache should not be a mandatory depdendency.

Actual Behavior

In DefaultRiptideRegistrar the class HttpCacheStorage is always loaded, failing if httpclient-cache is not on the classpath.

Possible Fix

Only try to load the class if dependency is available.

Steps to Reproduce

  1. Add the spring-boot-starter to your app
  2. Configure a client (without caching)
  3. See java.lang.NoClassDefFoundError: org/apache/http/client/cache/HttpCacheStorage

Your Environment

Running version 3.0.0-RC.2.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fatroomcommented, Sep 5, 2019

yep

1reaction
whiskeysierracommented, Jul 17, 2019

What would be the preferred way?

I’d like to have it as a real optional dependency.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is Dot Net HttpClient Unexpectedly Caching Responses?
I'm attempting to write a curl-like tool that demonstrates the effect of various HTTP caching headers on dot net's HttpClient class.
Read more >
HTTPClient Caching in .Net - Technovert
A static property DefaultCachePolicy once set on WebRequest(or HttpWebRequest) can affect the caching behavior for all HttpClient instance.
Read more >
DotNet HttpClient Cache - Notes
DotNet HttpClient Cache. Everywhere in our code we may see something like (pseudo):. var cached = _cache.Get("foo"); if (cached) { return cached; } ......
Read more >
Caching challenges and strategies - Amazon AWS
Data from this dependency is a good candidate for caching if such a cache would ... in the service client (for example, by...
Read more >
Caching With Apache HTTP Client and Spring RestTemplate
Getting Started. Initialize two Maven projects for the product service and the web server. Product Service Dependencies. <parent> <groupId>org.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found