Skip to content
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

优化IntegrationEvent事件发布 #694

Open
magiboys opened this issue Jan 11, 2024 · 2 comments
Open

优化IntegrationEvent事件发布 #694

magiboys opened this issue Jan 11, 2024 · 2 comments

Comments

@magiboys
Copy link

magiboys commented Jan 11, 2024

Description

使用时插入100w级数据,每次插入会发布领域集成事件,发现领域集成事件发布缓慢
阅读源码Masa.Contrib.Dispatcher.IntegrationEvents.Processor.SendByDataProcessor类发现,
分批取出IntegrationEventLog数据后是逐个调用IPublisher.PublishAsync方法,这样与dapr交互是有性能损耗的
优化建议是=>是否可以根据topicName分组,实现批量发布呢?
dapr是支持批量发布的

.NET version

No response

@duiapro
Copy link
Contributor

duiapro commented Apr 3, 2024

请提供具体业务场景

@magiboys
Copy link
Author

请提供具体业务场景

从第三方批量抓取大量数据,在保存每一条数据时都会发布一条分析这条数据的集成事件,目前数据全部保存成功后,从IntegrationEventLog表发布集成事件的任务有性能问题,要很久才能发布完,应该是逐个调用Dapr发布事件导致有性能损耗
优化意见:同样一个topicName,可调用BulkPublishEventAsync批量发布事件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants