第 14 章 Red Hat Decision Manager Red Hat build of Kogito Operator 与 Kafka 交互
Red Hat Decision Manager Red Hat build of Kogito Operator 使用 AMQ Streams Operator 自动配置带有 Kafka 的 Kogito 微服务的红帽构建。
当您通过 KogitoInfra 部署启用基础架构机制时,红帽决策管理器 红帽构建的 Kogito Operator 会使用相关的第三方操作器来配置基础架构。
您必须定义自定义基础架构资源,并在 KogitoInfra 文件中链接它。您可以在 spec.resource. name 和 配置中指定您的自定义基础架构资源。
spec.resource.namespace
Red Hat Decision Manager 红帽为自定义消息传递构建 Kogito 基础架构资源示例
apiVersion: rhpam.kiegroup.org/v1 # Red Hat build of Kogito API for this microservice
kind: KogitoInfra # Application type
metadata:
name: my-kafka-infra
spec:
resource:
apiVersion: kafka.strimzi.io/v1beta2 # AMQ Streams API
kind: Kafka # AMQ Streams Application Type
name: my-kafka-instance
namespace: my-namespace
在本例中,ko gitoInfra 自定义资源从 my-namespace 连接到 my-namespace 中的 Kafka 集群 my-kafka-instance 以进行事件消息传递。
要将 Red Hat build of Kogito 微服务连接到 Kafka,您需要定义 infra 配置以使用对应的基础架构。
红帽使用消息传递构建 Kogito 微服务资源配置示例
apiVersion: rhpam.kiegroup.org/v1 # Red Hat build of Kogito API for this microservice
kind: KogitoRuntime # Application type
metadata:
name: example-quarkus # Application name
spec:
image: <final-image-name> # Kogito image name
insecureImageRegistry: true # Can be omitted when image is pushed into secured registry with valid certificate
infra:
- my-kafka-infra
Red Hat Decision Manager Red Hat build of Kogito Operator 会配置必要的属性,以便您的应用程序可以连接到 Kafka 实例。