cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring BTP Destination in Advanced Event Mesh for CAP Consumer

aa83
Discoverer
0 Kudos
139

Hello Everyone,

I am working on a proof of concept (PoC) where we have configured Advanced Event Mesh (AEM) to track changes in sales orders using the "Order Changed" event. After various initial configurations, we have successfully received messages in AEM when a sales order is modified.

Now, on the consumer side a CAP (Node.js) application has been developed, that can listen to the message queue. The CAP application has been set up and is secured with XSUAA.

To enable AEM to connect to the CAP endpoint, we have configured OAuth 2.0 in AEM. Everything is working fine. However, I was wondering if it is possible to configure a BTP Destination in AEM that directly points to the CAP endpoint.

Does AEM support this kind of integration via BTP Destinations? If so, what would be the recommended approach to achieve this? any relevant documentation links would also be helpful 

 

some further details

AEM is in a different subaccount then the consuming CAP applicaiton. I am not sure if this helps, that if I create a destination in BTP pointing to that AEM instance and then bind it to the CAP application, will I already start receiving messages?

 

View Entire Topic
Willem_Pardaens
Product and Topic Expert
Product and Topic Expert

If I understand your setup correctly, you are using the AEM REST Delivery Point feature to have AEM push the events to CAP? This requires indeed quite some configuration in AEM and (imho) creates a quite tight coupling between AEM and your CAP app. And no, there is no destination support inside AEM.

While it is a valid approach and will work great, I tend to approach the connectivity in the opposite direction, from CAP to AEM (or any other messaging option such as the Event Mesh of SAP Integration Suite or the SAP Cloud Application Event Hub).

Have a look at the following sample repository containing an example for both EM and AEM: https://github.com/willempardaens/cap-eventing. You will notice that it is the CAP application taking the initiative to connect/listen to AEM. The credentials to connect to AEM can come from a service binding to avoid hard-coding.

At this point in time CAP does not have native support for AEM, but the team is working on it (see official roadmap item: https://roadmaps.sap.com/board?q=advanced%252520event%252520mesh&range=CURRENT-LAST#;INNO=0D8AD41AB0...), so for now you can use the sample code to explore the overall approach and POC, and switch to the native support once available.

Also have a look at @ajmaradiaga 's recent eBook on the same topic: https://www.sap-press.com/developing-event-driven-integrations-with-sap-btp_6021/ 

aa83
Discoverer
Thanks for the links 🙂 I was also not fully convinced of the approach that broker was leading the connection. I will try this out, and I think it will be a lesser refractor when cap has inbuilt support for it.
aa83
Discoverer
0 Kudos
Hi Willem, we are facing a weird problem; while using the first approach (i.e. REST call from AEM to CAP endpoint). Although the request comes fine in CAP, I can see my breakpoint being hit but the actual payload is not available in the request body. is there some special config for that?