sap-tutorials / btp-foundation

Learn with BTP Foundation tutorials. Get an introduction to SAP technology and configuration options.
Creative Commons Attribution 4.0 International
0 stars 11 forks source link

Trigger a Microservice with an Event #2133

Open MDJoerg opened 4 months ago

MDJoerg commented 4 months ago

Tutorials: https://developers.sap.com/tutorials/cp-kyma-microservice-trigger.html

Hi, I have tried this tutorial witg a fresh installation of a kyma cluster in a Trial account. The event.yaml from the github repo uses apiVersion eventing.kyma-project.io/v1alpha1. My new installed kyma cluster have eventing.kyma-project.io/v1alpha2 installed.

This leads to the error:

kubectl -n dev apply -f .\event.yaml

error: resource mapping not found for name: "api-mssql-go-event-sub" namespace: "" from ".\event.yaml": no matches for kind "Subscription" in version "eventing.kyma-project.io/v1alpha1" ensure CRDs are installed first

Then I have modified event.yaml to

apiVersion: eventing.kyma-project.io/v1alpha2
kind: Subscription
metadata:
  name: api-mssql-go-event-sub
spec:
  source: "mysource"
  sink: http://api-mssql-go.dev.svc.cluster.local:80/orderCodeEvent 
  typeMatching: exact
  types:
    - sap.kyma.custom.mp-commerce-mock.order.created.v1

The deployment was succesful with this yaml.

Next problem was missing items in the commerce mock web app. There are no items in the tab "Remote APIs". I tried to fix it via registering the same configuration as in Local APIs for entry "SAP Commerce Cloud - Events". But the event is not processed by the api-mssql-go pod (no logs found).

Please check the tutorial and make it running in newer installations.

Thank you!