Upgrading CP to SpringBoot 2.0

Palanivelrajan B

June 2, 2020

SpringBoot 2.0 Why?

  • SpringBoot 1.4 release on July 28, 2016
  • A lot of core 3rdparty libraries deprecated ( spring native tracer, feign)
  • Numerous performance fixes and bug fixes.
  • Faster startup
  • Has support for spring context indexer  - will help us further optimize server startup.
  • We can adopt GraalVM .. Lightning fast startup and very less memory usage.

SpringBoot 2.0 Why?

SpringBoot 2.0 Major Changes

  • Netflix Feign to Open Feign - no longer needed, since we don’t use feign anymore.
  • Major changes the Database upgrade support
  • Sleuth to Brave tracing
  • Few changes to in Spring MVC api's
  • Good amount of changes to spring data , but we don’t care
  • Major changes to Spring Security. Spring Security 5 now has native support for OAuth.

Upgrading Wiretap to SpringBoot 2.0

  • Top Down approach
  • Use all the framework jar compiled on springboot 1.4 and use it in springboot 2
  • Identify runtime failure and fix them ( use new api / adopt to new methods etc)
  • Upgrade to grade 5.6.x
  • Use Google JIB to build docker images.

Wiretap to SB 2.0 - Whats complete

  • Able to successfully bring up wiretap (running on springboot 2.x and CFW 2020.01 BOM)
  • Deployed wiretap in production with image built using Google JIB
  • Security works!
  • Posting message to queue works!
  • Broadcasting works!
  • Caching works!
  • All entity fw api works!

Wiretap to SB 2.0 - Whats complete

  • Wiretap is running in production for close to 3 months with no major issues. No one even noticed that its running on springboot 2.x

How did i do?

  • Had to hack few fw classes to make it work ( close to 22 files changes).
  • Major changes to DB upgrader, but safer. Now it follows the same pattern taken by liquibase/flyway. Think of our DB upgrader as another plugin similar to liquibase / flyway.
  • Disabled existing springboot oauth2 support and use spring security native support ( 3 classes)
  • Replace Tracer with Brave Trace and Span.
  • Few changes in context creation filter.

Whats more?

  • Authserver will have adoptions. Not sure how much. Jim can try out
  • build.gradle changes on all the fw and get all test cases to work.
  • Can we support both SpringBoot 2.x and 1.x? Is it even worth it given few classes are removed in springboot 2.x. So compilation will be challenging.
  • Beta release so that teams and adopt and estimate the cost.
  • Full adoption. 

Whats next?

Upgrading to SpringBoot 2.x

By Palanivel Rajan Balasubramanian

Upgrading to SpringBoot 2.x

  • 286