在事件驱动管道中处理CRUD事件
我正在转换一个将CRUD事件处理为多个微服务的整体应用。每个微服务都被设计为具有特定功能的Kafka流。想法是允许单独缩放每个微服务。 挑战是,创建和更新事件的处理流程存在差异,在这些事件中,创建事件必须通过管道中的多个功能微服务(过滤,丰富)进行,其中AS AS Update事件不必经过这些处理器。但是,为了按顺序处理创建和更新事件,如果没有更新事件(从Kafka主题读取/写入),则更新事件也必须在处理CREATE EVENT进行处理之前也可以发布。
event publisher(create/update event) =>(kafka topic)=> filter =>(kafka topic)=> enrichment=>..=>...=>(output topic)
该解决方案是否可以使用虚拟管道/服务以进行更新事件流以实现订购?
另一种方法是,我没有将每个微服务作为Kafka流设计,而是使用同步REST接口创建每个微服务,并从单个Kafka流应用程序调用它,然后可以管理处理和更新事件的处理顺序。
event publisher(create/update event) =>(kafka topic)=> event processor=>(output topic)
事件处理器使用REST接口调用每个功能微服务。 在这种情况下,尽管我仍然可以为每个函数实现单独的微服务,这些函数可以单独扩展,在异步流应用程序中调用其余的调用可能会影响其可扩展性和其他潜在问题。
对两种方法和任何替代方法建议的任何评论/建议都将有所帮助。
I am converting a monolithic application which was handling CRUD events into multiple microservices. Each microservice being designed as kafka stream with specific function. Idea was to allow scaling each microservice individually.
The challenge is, there is a difference in the processing flow of Create and update events where Create event has to go through multiple functional microservices( filtering, enriching) in the pipeline where as update event need not go through these processors. But in order to process the create and update event in order, update events also have to flow through all the microservices( read/write from kafka topics)if not update event can get published even before create event is processed.
event publisher(create/update event) =>(kafka topic)=> filter =>(kafka topic)=> enrichment=>..=>...=>(output topic)
Is this solution ok to have dummy pipe/service for update event flow to achieve ordering?
Another approach is, instead of designing each microservice as kafka stream, i create each microservice with a synchronous rest interface and call it from a single kafka stream application which can then manage the order of processing create and update events.
event publisher(create/update event) =>(kafka topic)=> event processor=>(output topic)
where event processor invoked each functional microservice with rest interface.
In this case, although i still achieve separate microservice for each function which can scale individually, invoking the rest calls inside an async streaming application might impact its scalability and other potential problems.
Any comments/suggestion on both the approaches and any alternative approach recommendation would help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论