网址: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/v1alpha1
kind: Subscription
metadata:name: api-mssql-go-event-sub
spec:filter:filters:- eventSource:property: sourcetype: exactvalue: ""eventType:property: typetype: exactvalue: sap.kyma.custom.mp-commerce-mock.order.created.v1protocol: ""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 即可:

更多Jerry的原创文章,尽在:“汪子熙”:

如何使用 SAP Kyma 控制台手动发送 SAP Commerce Cloud Mock 应用暴露的事件相关推荐

  1. SAP Kyma(Extension Factory on SAP Cloud Platform)的架构简介

    SAP kyma主要分三大块组成: (1) Application connector simplify and securely connect external systems to Kyma a ...

  2. SAP Kyma的environmment和SAP 云平台的Global Account

    这两个概念可以做类比. SAP Kyma里不同的environment可以导入或新建不同的service: 每个environment里可以分别进行Lambda函数的开发工作: 而SAP云平台Clou ...

  3. 为SAP Spartacus安装后台必须的Commerce Cloud

    Sample custom.properites file To get Spartacus working with local SAP Commerce Cloud Not to be used ...

  4. 一步步把 SAP UI5 应用部署到 SAP BTP Kyma 运行环境中去

    这是 Jerry 2021 年的第 40 篇文章,也是汪子熙公众号总共第 317 篇原创文章. Jerry 2018年曾经写过两篇文章,介绍了如何在 Kubernetes 这个容器编排平台上运行一个包 ...

  5. 如何创建最简单的 SAP Kyma Function

    登录 SAP Kyma 控制台,创建一个新的 function: 实现方式选择 nodejs: 自动生成一个同名的 service. 点击 service 面板右下角的 Expose service ...

  6. 第三方应用如何在SAP Kyma上进行服务注册

    Jerry之前的公众号文章 什么?在SAP中国研究院里还需要会PHP开发?提到了一个SAP Kyma的应用场景: 旅行兼社交达人伊森,使用经过SAP Kyma扩展之后的WordPress这个网站来写博 ...

  7. 从ABAP Netweaver的SICF到SAP Kyma的Lambda Function

    ABAP Netweaver里的事务码SICF是Jerry做原型开发时非常喜欢使用的一个工具:但凡遇到需要把ABAP系统里的资源以服务的方式暴露出来的场景,Jerry都喜欢在SICF里创建一个服务节点 ...

  8. 在 SAP Kyma 上使用 Redis 服务

    链接:https://developers.sap.com/tutorials/cp-kyma-redis-function.html 本地文件:C:\Code\referenceCode\SAP K ...

  9. 把运行在 Docker 容器内的 Microsoft SQL 服务器部署到 SAP Kyma 中

    在阅读这篇文章之前,Jerry 假设您已经读过了这篇在 Docker 里运行 Microsoft SQL 服务器. 本地项目地址:C:\Code\referenceCode\SAP Kyma教程例子 ...

最新文章

  1. 从官网下载的python包如何使用-如何下载python包
  2. django Error: [Errno 10013]
  3. windows 技术篇 - 启动项里没有的程序设置为开机启动方法
  4. React面试题总结,就是这么简单
  5. 前端学习(2627):node安装
  6. VC++等待光标的两种实现方式
  7. 计算机网络中TCP连接管理,计算机网络 TCP协议
  8. java 深拷贝 序列化_java 之 利用序列化实现深拷贝
  9. DOA——MUSIC算法
  10. html5用户注册页面代码,HTML5注册页面示例代码_html5教程技巧
  11. 人工势场法脱离极小值点
  12. VSFTPD (500 Illegal PORT command 500 OOPS: vsf_sysutil_bind) 错误解决方法
  13. html match函数,match函数的使用方法 match函数的实例
  14. LeetCode 热题 HOT 100 -------31. 下一个排列(数组,数学问题)128. 最长连续序列(数组) 11. 盛最多水的容器(数组) 621. 任务调度器 (数组)
  15. SQL 中判断条件的先后顺序,会引起索引失效么?
  16. badger 一个高性能的LSM K/V store
  17. Spring集成Redis键值乱码\xac\xed\x00\x05t\x00\tb
  18. pandas获得指定行_如何用pandas实现选取特定索引的行
  19. Oracle数据同步解决方案之databus
  20. 外校保研北大计算机,外校保研北大条件

热门文章

  1. 性价比泛滥后,网易严选情怀路线还能否继续吃香?
  2. amazeui学习笔记--css(布局相关3)--辅助类Utility
  3. 云将与行业走向深度融合
  4. 把握三大计划 抓住ERP项目实施的灵魂
  5. oVirt Reports Portal 3.4 added to ovirt-engine
  6. Python入门之中文乱码
  7. 预定义异常 - PHP手册笔记
  8. PL/SQL - 03
  9. ASP.NET MVC 第一章 我们的第一个MVC例子
  10. Linux系统下***软件大荟萃