cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CAP Java: replace spring boot

0 Likes
1,742

Hi,

I am wondering if it is possible and recommended to replace the spring boot framework with another java farmework eg. Quarkus or another one?

What issues do you see if we try to do it?

Thanks a lot in adavnce!

View Entire Topic
marcbecker
Product and Topic Expert
Product and Topic Expert
0 Likes

Great question! In general CAP Java was built in a way, that Spring Boot largely remains an optional component. All integration of CAP into Spring Boot is centralized in the cds-framework-spring-boot dependency. Other packages don't have a dependency to Spring Boot directly. Nevertheless currently we only support the integration with Spring Boot out-of-the-box.

What the cds-framework-spring-boot dependency mostly does is perform a lot of auto-configuration. It configures the CdsRuntime with all its services, registers event handlers (which can be Spring beans) on services, configures authentication integration with Spring security, registers CAPs protocol adapters as Servlets in the Spring Boot web context, integrates with Spring Boot's Environment abstraction to load properties and many more.

You basically need to repeat all of that (or what you need specifically) when integrating with a different framework.
Especially the APIs around building/configuration of the CdsRuntime are unfortunately not yet documented in capire, as they are not required for a standard use case. You might want to take a look at the CdsRuntimeConfigurer class, in case you want to get started: https://javadoc.io/doc/com.sap.cds/cds-services-api/latest/com/sap/cds/services/runtime/CdsRuntimeCo...

Hey Marc!

Thanks a lot for your answer. This was very helpful! I have another question regarding performance. Spring Boot has usually a blocking I/O model, but I´ve seen that in the CAP Java project spring-boot-starter-webflux is included as a dependency which would make Spring non-blocking. Am I correct? And If yes, have you some benchmarks between your node.js and java approaches?

Thanks a lot!

Best regards,

Danilo