inbound-connector相关逻辑

1.概述

connector承担的职责 是 zeebe的task跟外部系统通信,其中inboundConnector则是监听外部系统的信息,目前git社区已经支持其中包括 kafka 、rabbitMQ、rest-http、sqs、slack等。

在代码实现层面,每一个 inboundConnector 就是一个listener,监听外部系统的变化,进而触发zeebe的相关任务

在这里插入图片描述

2. inboundConnector发现、注册

inboundConnector一共有三种加载方式:
1.通过spi加载
2.通过配置文件指定(会覆盖 @IutboundConnector 中指定的属性)
3.通过spring 的beanProcessor扫描注解 @IutboundConnector

具体的跟outboundConnector的处理是类似的,此处只列举关键方法:

通过spi、注解发现的关键方法:
io.camunda.connector.runtime.core.inbound.DefaultInboundConnectorFactory#loadConnectorConfigurations

在这里插入图片描述

通过spring 的beanProcessor扫描注解 @IutboundConnector 关键处理类: InboundConnectorAnnotationProcessor
io.camunda.connector.runtime.inbound.lifecycle.InboundConnectorAnnotationProcessor#registerInboundConnector

在这里插入图片描述

3.实例化 inboundConnector

由定时任务触发: io.camunda.connector.runtime.inbound.importer.ProcessDefinitionImporter#scheduleImport
在这里插入图片描述
io.camunda.connector.runtime.inbound.importer.ProcessDefinitionImporter#handleImportedDefinitions
在这里插入图片描述

io.camunda.connector.runtime.inbound.lifecycle.InboundConnectorManager#handleNewProcessDefinitions
在这里插入图片描述

3.1 connector的激活

关键方法,激活 inboundConnector
io.camunda.connector.runtime.inbound.lifecycle.InboundConnectorManager#activateConnector

在这里插入图片描述

对于激活connector,以 HttpPollingConnector 为示例说明:
在这里插入图片描述

如图,其委托给了 ProcessInstancesFetcherTask 处理具体逻辑。
在这里插入图片描述

最后具体的执行逻辑在 子线程的run()方法中:
io.camunda.connector.http.polling.task.ProcessInstancesFetcherTask#run
在这里插入图片描述

发起http请求之后,其response会通过 发送事件 的方式回写至zeebe broker
io.camunda.connector.runtime.core.inbound.correlation.InboundCorrelationHandler#correlate
在这里插入图片描述

io.camunda.connector.runtime.core.inbound.correlation.InboundCorrelationHandler#triggerMessage
在这里插入图片描述

  • 25
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值