cancel
Showing results for 
Search instead for 
Did you mean: 

"Order" or "filter" events in Event Mesh

Hi,

is it possible to push an event into a specific queue depending on the payload? I would like to "order" or "filter" events in the SAP Event Mesh. Or is there another way to filter events in the event mesh?

Best regards,
Manuel

Accepted Solutions (1)

Accepted Solutions (1)

Tobias_Griebe
Advisor
Advisor

Hi manuel.henninger,

SAP Event Mesh doesn't offer any capabilities out-of-the-box to do a routing/filtering based on the payload. Event Mesh is routing the messages based on the topic patterns and doesn't even "know" about the payload or it's structure.

Depending on what the source of your events is, it might be possible (e.g. for custom events via ASANWEE add-on) to add the needed information as part of the topic structure. Other use-cases are SAP CPI, a serverless function or a small CF application as the initial consumer of the event, analyzing the payload and distributing it to the final consumers either directly or putting it back in Event Mesh on defined topics/queues.

Best regards,
Tobias

JaySchwendemann
Active Contributor
0 Kudos

Hi Tobias,

thanks for providing meaningful insight. Let me add my 2c, if I may 🙂

You say...
"Depending on what the source of your events is, it might be possible (e.g. for custom events via ASANWEE add-on) to add the needed information as part of the topic structure"

We use the mentioned add-on. We basically want to provide the event consumer multiple queues based on content of the event, say country. So we want to have the following structure

  • queue/pricing/DE
  • queue/pricing/FR
  • queue/pricing/RU
  • ...

As far as I understood, in theory we would set up multiple topics for each country then and have a 1:1 queue subscription for those

  • topic/pricing/DE --> queue/pricing/DE
  • topic/pricing/FR --> queue/pricing/FR
  • topic/pricing/RU --> queue/pricing/RU

We could then also have a "one catch all" queue that subscribes to all related topics and then holds all events for all countries like so

  • topic/pricing/DE --> queue/pricing/ALL
  • topic/pricing/FR --> queue/pricing/ALL
  • topic/pricing/RU --> queue/pricing/ALL

My questions

  1. If the above is correct from a theoretical POV, how would we best set this up in ASANWEE? (just some rough cornerstones / ideas)
  2. In other words of 1.: Is there any posibility to set the SAP_EM_TOPIC Header value dynamically (e.g. via BAdI)?
  3. If the above is not correct, can you roughly explain where we do wrong?

PS: Cloud Integration might come to rescue, you're right. But I would like to have as few components in the flow, also this would be a matter of licensing for us (being on a message metric on Cloud Integration)

Many thanks and kind regards

Jens

JaySchwendemann
Active Contributor
0 Kudos

Additional information: As it looks like (at leas on first glance) the topic is not dynamic (at least from a code's perspective)

See /ASADEV/CL_ACI_SAP_EM_HANDLER->_CALL_CLOUD

Would be nice to have some extension posibility there, thoug 🙂

Tobias_Griebe
Advisor
Advisor

Hi jens.schwendemann,

Unfortunately I'm not an ABAP developer and not really expert with the ASANWEE add-on. But my understading from other discussions was, that something like this should be possible. But at least I know whom to ask. 😉

martin.schffler, maybe you could help us here?

But my theory would have been exactly how you described it:

Setup multiple topics for each country then and have a 1:1 queue subscription for those

  • topic/pricing/DE --> queue/pricing/DE
  • topic/pricing/FR --> queue/pricing/FR
  • topic/pricing/RU --> queue/pricing/RU

The "one catch all" queue could be described in just one single line for simplification:

  • topic/pricing/* --> queue/pricing/ALL

Now we just need to clarify if it is possible to have the topic defined by the country information of a business object. 🙂

Best regards,
Tobias

mig1
Participant

A dynamic topic is also on my wishlist!

0 Kudos

Hello tobias.griebe

We have to filter our Event Queue on some criteria . It would be really helpful , if you can give me some hint .

It would be really helpful to do my research in the right direction .Because reading over the net , I am too much confused .

Business Scenario we are trying to achieve

Step 1 :- Event Mesh captures events From Business Partner Creation

Step 2 :- Triggers Function as a service

Step 3 :- Fetches the roles using the Odata API_BUSINESS_PARTNER .

Step 4 :- On the basis of the Repose delete or Put back an Event back on the Event Mesh .

Questions:-

Now I see there are two tools for creating FaaS

Serverless Runtime on Cloud Foundry BAS

Serverless Runtime on Kyma

Which one should I choose .And is it possible to achieve what we are trying do .

SS

Tobias_Griebe
Advisor
Advisor
0 Kudos

Hi bodhisattwa.pal2,

that is an absolutely valid use-case. You get an notification event for Business Partner Creation from the backend system (I assume we are talking about S/4) and have your consumer call the respective API to get additional details.

Technicall you can use both serverless runtimes to get to the same result. Both will be able to be triggered by the event and call the OData API. In one of the latest Kyma releases they have released a tighter integration with Event Mesh. So if you have Kyma available I would start with this.

Best regards,
Tobias

Answers (0)