apache / eventmesh

EventMesh is a new generation serverless event middleware for building distributed event-driven applications.
https://eventmesh.apache.org/
Apache License 2.0
1.6k stars 635 forks source link

[Question] After runtime crashes and reconnects, TCP and GRPC will resend subscription information, but HTTP does not #4592

Open hhuang1231 opened 9 months ago

hhuang1231 commented 9 months ago

Search before asking

Question

Both tcp and grpc will resend the subscription information after the runtime is disconnected. Why doesn't http resend the subscription information?And after testing, it was indeed found that when keeping sub started and restarting the runtime, sending events through pub again, only grpc and tcp sub can be consumed again, while http sub cannot consume events.


tcp和grpc都会在runtime断开连接后重新发送订阅信息,为什么http不重新发送订阅信息?并且经过测试也确实发现,当保持sub启动,而重启runtime后,再次通过pub发送事件,仅有grpc和tcp的sub可以再次消费,而http sub无法消费事件。

image (org.apache.eventmesh.client.grpc.consumer.EventMeshGrpcConsumer#heartBeat)

image (org.apache.eventmesh.client.http.consumer.EventMeshHttpConsumer#heartBeat)

image (org.apache.eventmesh.client.tcp.impl.cloudevent.CloudEventTCPSubClient#reconnect) (org.apache.eventmesh.client.tcp.impl.eventmeshmessage.EventMeshMessageTCPSubClient#reconnect)

pandaapo commented 9 months ago

I think we should add this re-subscription mechanism to the HTTP protocol subscription, just like other protocols. What do you think? @xwm1992

我觉得我们应该和其他协议一样也给http协议的订阅加上这种重新订阅的机制。您觉得呢?@xwm1992

xwm1992 commented 9 months ago

I think we should add this re-subscription mechanism to the HTTP protocol subscription, just like other protocols. What do you think? @xwm1992

我觉得我们应该和其他协议一样也给http协议的订阅加上这种重新订阅的机制。您觉得呢?@xwm1992

http的订阅信息会保存在meta中,需要eventmesh启动后重新从meta里读取这部分订阅信息数据,tcp与grpc是因为要建立长链接所以会由sdk主动发起重新订阅,连接断开后,客户端能主动感知,http因为缺少这部分内容,因此客户端不会感知到,所以将http订阅信息放到了meta中。

pandaapo commented 9 months ago

http的订阅信息会保存在meta中,需要eventmesh启动后重新从meta里读取这部分订阅信息数据,tcp与grpc是因为要建立长链接所以会由sdk主动发起重新订阅,连接断开后,客户端能主动感知,http因为缺少这部分内容,因此客户端不会感知到,所以将http订阅信息放到了meta中。

@xwm1992 也就是说目前http方式的client与EventMesh Server之间的连接用的是短连接,对吗?是否有改成长连接的需要?

xwm1992 commented 9 months ago

http的订阅信息会保存在meta中,需要eventmesh启动后重新从meta里读取这部分订阅信息数据,tcp与grpc是因为要建立长链接所以会由sdk主动发起重新订阅,连接断开后,客户端能主动感知,http因为缺少这部分内容,因此客户端不会感知到,所以将http订阅信息放到了meta中。

@xwm1992 也就是说目前http方式的client与EventMesh Server之间的连接用的是短连接,对吗?是否有改成长连接的需要?

这个需要社区内部评估一下才好,目前看没有特别必要改为长连接。

github-actions[bot] commented 5 months ago

It has been 90 days since the last activity on this issue. Apache EventMesh values the voices of the community. Please don't hesitate to share your latest insights on this matter at any time, as the community is more than willing to engage in discussions regarding the development and optimization directions of this feature.

If you feel that your issue has been resolved, please feel free to close it. Should you have any additional information to share, you are welcome to reopen this issue.