cancel
Showing results for 
Search instead for 
Did you mean: 

CAP: Consuming services in a monorepo

kosmopilot
Explorer
0 Kudos
561

Hello,

how does service consumption work in a monorepo environment? Consider, for instance, the example repository cloud-cap-samples and the 'app' bookstore. Bookstore consumes/mashes up multiple services: bookshop, reviews, orders etc. . Are those consumed services considered to be remote services? In other words, would the query

GET /Books?$expand=reviews

be automatically resvoled by CAP in a deployed environment (cloud) or is a custom implementation required as described in the documentation?

Background: I'd like to use a monorepo for multiple connected apps building on each other. Apps may have entities that have associations/compositions to entities in other apps. I'd like to have CAP resolve expands and navigations automatically as done in a monolith app. However, as far as I understand it, I would have to implement each expand manually because the entities from other apps are considered to be remote entities.

If that is the case, is there a way to circumvent this or am I stuck with a monolithic approach?

Related questions:

- CAP Java: Several small CAP projects vs. one big CAP project

- How to create a reuse service with a custom handler in CAP Java?

Accepted Solutions (0)

Answers (1)

Answers (1)

lars_lutz
Advisor
Advisor
0 Kudos

It doesn't matter if multiple services, that are used as remote services, are in a monorepo or spread over multiple repos. They should run independently and each remote service is a separate instance when deployed. As you already mentioned, please follow the documentation to work with remote services.