Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken with Feign 12.5+ #2126

Open
nilo85 opened this issue Mar 5, 2024 · 5 comments
Open

Broken with Feign 12.5+ #2126

nilo85 opened this issue Mar 5, 2024 · 5 comments
Labels

Comments

@nilo85
Copy link
Contributor

nilo85 commented Mar 5, 2024

Resilience4j version: 1.7.x (cant run java17) (but very likely same issue in latest as same builder pattern is applied)

Java version: java11

Thanks for raising a Resilience4j issue.

I opened up this issue with Feign today:
OpenFeign/feign#2341

They have in Feign 12.5 onwards made the builder return a new builder at some point and the Resilience4jFeign.Builder is effectively not used when hitting build..

To workaround in my project I have injected the following class in your package:

package io.github.resilience4j.feign;

import feign.Feign;

public final class PatchedResilience4jFeign {

  public static Feign.Builder setInvocationHandler(Feign.Builder builder, FeignDecorator invocationDecorator) {
    return builder.invocationHandlerFactory(
        (target, dispatch) -> new DecoratorInvocationHandler(target, dispatch,
            invocationDecorator));
  }

}

Where I call PatchedResilience4jFeign.setInvocationHandler() just before I build the builder =)

Cant be done from my packages as DecoratorInvocationHandler is not public

@nilo85
Copy link
Contributor Author

nilo85 commented Mar 5, 2024

I see someone suggested this in one of the comments of another issue with same cause:
OpenFeign/feign#2163 (comment)

However, important it gets back ported to 17.x as we are a few who are stuck in older java versions =/

@nilo85
Copy link
Contributor Author

nilo85 commented Mar 5, 2024

I guess another option could be to extend internalBuild() instead of build() (as they made build final)
https://github.com/OpenFeign/feign/blob/master/core/src/main/java/feign/BaseBuilder.java#L302

@nilo85
Copy link
Contributor Author

nilo85 commented Mar 5, 2024

I made a pull request addressing the issue here #2127

@RobWin
Copy link
Member

RobWin commented Mar 7, 2024

Unfortunately it's difficult for me to still support 1.7.x:
A lot of changed in the deployment and release pipeline between 1.7 and 2.0, because JFrog shut down JCenter/Bintray

I'm so busy at work at the moment, that it's difficult for me to find time to merge the changes from 2.x back to 1.7.x. :(
Not sure if someone could support here?

@RobWin RobWin added the bug label Mar 7, 2024
@nilo85
Copy link
Contributor Author

nilo85 commented Mar 8, 2024

I understand =) Not sure I can be of much aid there, I have created 3 PRs, one for each branch but was very long time ago I tried to get something published in a public repo.

Well in the meantime maybe you can merge the change based on the master branch PR and get the fix for all current version users of resilience4j to get it to work. Its quite nasty as it does not produce any errors or warnings or anything as of now, it just dont work, so if you dont have good tests verifying the fallbacks etc, you wouldn't notice.

Regarding 1.7.x in my personal case, we have a central middleware library that controls it all and I could live with a custom hack there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants