PacktPublishing / Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud

Hands-On Microservices with Spring Boot and Spring Cloud, published by Packt
MIT License
464 stars 406 forks source link

Chapter 13 - Resilience4J with SpringBoot 2.4.0 #21

Closed ClimberBear closed 3 years ago

ClimberBear commented 3 years ago

Hi,

I have suffered the bug you reported about incompatibility between Resilience4J 1.6.1 and SpringBoot 2.4.0

The Reactor based RetryOperator uses a deprecated method that is removed in Reactor 3.4.0 used by Spring Boot 2.4.0

I'm trying to update to version 1.7.0. For this, I have tried to update my build.gradle to

// ... Not relevant
ext {
   resilience4jVersion = "1.7.0"
}
dependencies {
// ... Not relevante
    implementation("io.github.resilience4j:resilience4j-spring-boot2:${resilience4jVersion}")
    implementation("io.github.resilience4j:resilience4j-reactor:${resilience4jVersion}")
}

But then, when I try gradle build, I the test phase, I get the error

Caused by: java.lang.ClassNotFoundException: io.github.resilience4j.core.ContextAwareScheduledThreadPoolExecutor

Have you got this working? Which are the right dependencies?

BTW, I have also tried (with the same result) adding all dependencies, as

  implementation("io.github.resilience4j:resilience4j-spring-boot2:${resilience4jVersion}")
  implementation("io.github.resilience4j:resilience4j-reactor:${resilience4jVersion}")
  implementation "io.github.resilience4j:resilience4j-circuitbreaker:${resilience4jVersion}"
  implementation "io.github.resilience4j:resilience4j-ratelimiter:${resilience4jVersion}"
  implementation "io.github.resilience4j:resilience4j-retry:${resilience4jVersion}"
  implementation "io.github.resilience4j:resilience4j-bulkhead:${resilience4jVersion}"
  implementation "io.github.resilience4j:resilience4j-cache:${resilience4jVersion}"
  implementation "io.github.resilience4j:resilience4j-timelimiter:${resilience4jVersion}"
ClimberBear commented 3 years ago

Hi,

I found this issue with a workaround of the problem, making possible to use version 1.7.0 of relience4j. Testing now.

https://github.com/resilience4j/resilience4j/issues/1361

magnus-larsson commented 3 years ago

Hello!

Sorry for not responding earlier, but I have been very busy lately finishing the 2'nd edition of my book.
(I have also written a blog post on the updates in the 2nd edition, if you are interested)

Yes, I'm using Resilience4J 1.7.0 and SpringBoot 2.5.2 in the 2nd edition! Please take a look at https://github.com/PacktPublishing/Microservices-with-Spring-Boot-and-Spring-Cloud-2E/blob/main/Chapter13/microservices/product-composite-service/build.gradle.

Hope it helps!

Please reopen the issue if you have further questions, Magnus.

ClimberBear commented 3 years ago

Congrats!

It's a great notice the book success!

Do you know if packt let me download the new edition if I own the 1st one?

In any case, thank you. I will continue recommending it to my colleagues.

Regards

Jose Manuel Albarrán

b-Thinking software

+34 616 968 262

@.***


From: Magnus Larsson @.> Sent: Friday, August 13, 2021 8:08:26 AM To: PacktPublishing/Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud @.> Cc: Jose Manuel Albarrán @.>; Author @.> Subject: Re: [PacktPublishing/Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud] Chapter 13 - Resilience4J with SpringBoot 2.4.0 (#21)

Closed #21https://github.com/PacktPublishing/Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud/issues/21.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/PacktPublishing/Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud/issues/21#event-5153925804, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFQBD37W2QE6JTWTCWGZAW3T4SZFVANCNFSM4ZZ3LFXA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.

craigwarsaw commented 3 years ago

Hello Magnus,

The link to your blog post gives me a 404. Thanks for your hard work keeping the repo up to date.

Craig Warsaw, Chief Engineer

w (301) 543-6510 | c (410) 336-7702 | @.**@.>

CACI/NSIS/ASG/NS/Critical Insight Solutions | www.caci.comhttp://www.caci.com/

formerly Next Century Corporation


From: Magnus Larsson @.> Sent: Friday, August 13, 2021 2:08 AM To: PacktPublishing/Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud @.> Cc: Subscribed @.***> Subject: Re: [PacktPublishing/Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud] Chapter 13 - Resilience4J with SpringBoot 2.4.0 (#21)

EXTERNAL EMAIL - This email originated from outside of CACI. Do not click any links or attachments unless you recognize and trust the sender.

Hello!

Sorry for not responding earlier, but I have been very busy lately finishing the 2'nd edition of my bookhttps://www.amazon.com/Microservices-Spring-Boot-Cloud-microservices/dp/1801072973. (I have also written a blog post on the updates in the 2nd editionhttps://github.com/callistaenterprise/callistaenterprise.github.io/blob/master/_posts/teknik/2021-08-09-microservices-book-2nd-edition-updates.md, if you are interested)

Yes, I'm using Resilience4J 1.7.0 and SpringBoot 2.5.2 in the 2nd edition! Please take a look at https://github.com/PacktPublishing/Microservices-with-Spring-Boot-and-Spring-Cloud-2E/blob/main/Chapter13/microservices/product-composite-service/build.gradle.

Hope it helps!

Please reopen the issue if you have further questions, Magnus.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/PacktPublishing/Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud/issues/21#issuecomment-898214991, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACIEBKMQS4B7OSGMIVD3ZKTT4SZFXANCNFSM4ZZ3LFXA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.


This electronic message contains information from CACI International Inc or subsidiary companies, which may be company sensitive, proprietary, privileged or otherwise protected from disclosure. The information is intended to be used solely by the recipient(s) named above. If you are not an intended recipient, be aware that any review, disclosure, copying, distribution or use of this transmission or its contents is prohibited. If you have received this transmission in error, please notify the sender immediately.

magnus-larsson commented 3 years ago

Hello Craig, thanks for pointing out the invalid link!

The link to the blog post is now corrected!