当前位置:网站首页>如何使用 SAP Kyma 控制台手动发送 SAP Commerce Cloud Mock 应用暴露的事件
如何使用 SAP Kyma 控制台手动发送 SAP Commerce Cloud Mock 应用暴露的事件
2022-06-11 21:20:00 【华为云】
网址:https://developers.sap.com/tutorials/cp-kyma-microservice-trigger.html
本地路径:
C:\Code\referenceCode\SAP Kyma教程例子\api-mssql-go
(1) This tutorial relies on the Commerce mock application to publish events into the Kyma runtime.
(2) bind the Commerce mock application to the dev Namespace
(3) we will create a service instance of the SAP Commerce Cloud - Events.
(4) The service instance will allow for any microservice or lambda function within the dev Namespace to subscribe to these events by defining an event subscription.
借助这个 mock 应用的 service instance,我们可以让 dev 命名空间的任何微服务或者Lambda Function,订阅 service instance 暴露出的事件。
The subscription pairs an event source, the Commerce mock application, and the event type, order.created, to a subscriber.
订阅实际上是一个抽象,包含了事件源,mock 应用,和订阅事件类型。
这个订阅的源代码,用 yaml 文件定义如下:
apiVersion: eventing.kyma-project.io/v1alpha1kind: Subscriptionmetadata: name: api-mssql-go-event-subspec: filter: filters: - eventSource: property: source type: exact value: "" eventType: property: type type: exact value: sap.kyma.custom.mp-commerce-mock.order.created.v1 protocol: "" protocolsettings: {} sink: http://api-mssql-go.dev.svc.cluster.local:80/orderCodeEvent 在cmd/api/main.go 里,为 /orderCodeEvent 这个 endpoint,注册一个处理函数:ConsumeOrderCode

bind the mock application to the dev Namespace. This process is used to enable the usage of the APIs and events of the mock application to the bounded Namespace.
把 mock 应用绑定到 dev namespace,这样才能让该命名空间的应用,消费这个 mock 应用暴露出的事件。


也要为 mock 应用暴露出的 event,创建一个 instance.
点击 dev namespace,进入 Service Management -> Catalog, 选择 mp-commerce-mock 应用:
选择该 mock 应用 service plan 中的 SAP Commerce Cloud - Events:

点 Add 按钮,创建新的实例:
测试
在 API rules 里,点击 commerce-mock 的 host 超链接:
https://commerce.c-46d70f2.kyma.shoot.live.k8s-hana.ondemand.com/

选择 remote API:
选择 SAP Commerce Cloud - Events:
Event topic 下拉列表里,选择 order.created.v1,再点击 Send Event 即可:

边栏推荐
- Product information | Poe network card family makes a collective appearance, the perfect partner of machine vision!
- How to manually drag nodes in the Obsidian relationship graph
- Diary at 16:29:41 on June 9, 2022
- New product release: lr-link Lianrui launched the first 25g OCP 3.0 network card
- Realize the same length of tablayout subscript and text, and change the selected font size
- Go语言for循环
- Serval and rooted Tree (cf1153d) - DP
- JVM之堆区
- BCC tool tool usage
- JVM之对象创建过程
猜你喜欢

JVM方法区
![[nk] deleted number of 100 C Xiaohong in Niuke practice match](/img/f1/a99600e1800c087aceb60a559dee39.png)
[nk] deleted number of 100 C Xiaohong in Niuke practice match

Redis fourth session - redis high performance principle (multiplexing) and high availability analysis (backup, master-slave)

LabVIEW控制Arduino实现超声波测距(进阶篇—5)

Answer fans' questions | count the number and frequency of letters in the text

gateway先启动其他微服务,在启动网关,网关启动不了,且无异常日志;先启动网关,所有服务能正常启动

【博弈论-完全信息静态博弈】 战略式博弈

Goland中在文件模板中为go文件添加个人声明

Which Bluetooth headset is better within 500? Inventory of gifts for girls' Day

A collection of commonly used open source data sets for face recognition
随机推荐
【C語言進階】整型在內存中的存儲
Go language functions
Realize the same length of tablayout subscript and text, and change the selected font size
JUnit tests multithreaded code, and the sub thread does not run
Technical exchange | why should network security equipment use bypass function
Serval and Rooted Tree(CF1153D)-DP
Tensorflow 2. X Getting Started tutorial
I haven't blogged for two months. I sent an article to prove that my account is still alive
Why is your LDO output unstable?
A man always becomes a man and a man always arrives (progress, harvest, growth, self-confidence)
JVM之堆区
Release of version 5.6 of rainbow, add multiple installation methods, and optimize the topology operation experience
SQL的语法
Jenkins+allure integrated report construction
Bug -- coredump usage
Answer fans' questions | count the number and frequency of letters in the text
table_ Display status
Application analysis of Poe image acquisition card in machine vision industrial computer
ASCII code comparison table
Diary at 16:29:41 on June 9, 2022