-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How to elegantly use the extension field in ConnectRecord to sink messages? #4567
Comments
In your multiple questions, regarding the aforementioned point, I think you can create an issue and PR to make The remaining questions are waiting for responses from others in the community. 在您的多个疑问中,关于上述这一点,我觉得您可以创建个issue和PR,使 |
SourceWorker是由connectorRecord转为cloudevents协议,再发给EventMesh;SinkWorker是由cloudevents转为connectorRecord再调用connect api. 因此connect api部分都是connectorRecord,与eventmesh交互部分都是cloudevents. |
@xwm1992 假如我想在应用程序中直接调用eventmesh提供的api来发送事件到mesh,目前我只知道两种方式:
我主要想知道如果想让用户使用更方便的话,是不是应该对在应用程序中发送CloudEvent做更多的优化,例如丰富spring的支持。 |
关于上述这一小点的回复。 |
|
@xwm1992 restful api的方式我不是很确定,是指像这个issue中“Management Interface in EventMesh”部分描述的方式吗 #4400 (comment) ?如果是的,是不是还在完善和补充中? |
我个人觉得spring可能需要支持extension, 一般使用spring的用户, 配置都在spring的environment里, 我觉得可以把spring environment和connector做一个联动. |
@hhuang1231 对于这个问题,目前的解决方案是#4582,通过spring source connector获取配置文件中以 |
@pandaapo @yanrongzhen |
@hhuang1231 Thank you for your feedback and reporting this bug! |
目前EventMesh 的http调用是有两种方式,一种是sdk,另外一种是直接调用eventmesh的uri,你可以看对应http协议下面的processor与uri之间的映射关系 |
Search before asking
Question
Currently I try to use connector-spring's soouce to send messages and then sink in DingTalk.
目前我尝试使用connector-spring的soouce来发送消息,然后在钉钉中下沉。
Since DingTalk requires special extension fields, I first need to add
org.apache.eventmesh.connector.spring.source.connector.SpringSourceConnector#send(java.lang.Object, org.apache.eventmesh.openconnect.api. callback.SendMessageCallback)
method, add the required extension fields toConnectRecord
由于钉钉需要特殊的扩展字段,所以我首先需要在
org.apache.eventmesh.connector.spring.source.connector.SpringSourceConnector#send(java.lang.Object, org.apache.eventmesh.openconnect.api.callback.SendMessageCallback)
方法,将需要的扩展字段添加进ConnectRecord
中And due to CloudEvent's name conventions, I also have to convert the
dingdingtemplatetypekey
to all lowercase before I can put it into theextension
ofCloudEvent
并且由于CloudEvent的命名约束,我也必须将
dingdingtemplatetypekey
转为全部小写,才能将其放入CloudEvent
的extension
中And had to modify the source code of
org.apache.eventmesh.openconnect.SourceWorker#convertRecordToEvent
so that it can getextension
fromConnectRecord
and add it toCloudEvent
并且不得不修改
org.apache.eventmesh.openconnect.SourceWorker#convertRecordToEvent
的源代码使其可以从ConnectRecord
中得到extension
并添加到CloudEvent
中In addition, I found that sinkWoker will call
org.apache.eventmesh.openconnect.util.CloudEventUtil#convertEventToRecord
when receiving events, thereby completing the conversion fromCloudEvent
'sextension
toConnectorRecord
'sextension
, and sourceWoker But they didn't do this. Why?另外我发现sinkWoker接收事件的过程中将会调用
org.apache.eventmesh.openconnect.util.CloudEventUtil#convertEventToRecord
,从而完成从CloudEvent
的extension
转换为ConnectorRecord
的extension
,而sourceWoker却没有这么做,这是为什么呢?My doubts should be similar to #4560, and I hope to understand the community's current plans for this area.
我的疑惑与#4560 应该是类似的,我希望能够了解社区目前对于这一块的计划。
The text was updated successfully, but these errors were encountered: