-
Notifications
You must be signed in to change notification settings - Fork 641
[ISSUE #4652]Fix EventMeshGrpcConsumer subscribe webhook send heartBeat throw NPE #4653
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
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4653 +/- ##
============================================
- Coverage 17.39% 17.39% -0.01%
- Complexity 1757 1758 +1
============================================
Files 797 797
Lines 29774 29787 +13
Branches 2573 2575 +2
============================================
+ Hits 5178 5180 +2
- Misses 24118 24129 +11
Partials 478 478 ☔ View full report in Codecov by Sentry. |
| * @param url The URL to subscribe to. | ||
| * @return A response containing information about the subscription result. | ||
| */ | ||
| public Response subscribe(final List<SubscriptionItem> subscriptionItems, final String url) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my question. What is the correlation between using this method for subscription and the Webhook mechanism? Will EventMesh push consumers through this URL when new messages are generated?
这是我的疑问,使用该方法进行订阅和Webhook机制是什么关联?是产生新消息时,EventMesh会通过该URL推送给消费者吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my question. What is the correlation between using this method for subscription and the Webhook mechanism? Will EventMesh push consumers through this URL when new messages are generated?
这是我的疑问,使用该方法进行订阅和Webhook机制是什么关联?是产生新消息时,EventMesh会通过该URL推送给消费者吗?
Yes, Previously, gRPC subscriptions were divided into two categories: normal subscription consumption (stream), and webhook subscriptions. These were primarily handled by the SubscribeProcessor. Within this, we can clearly see some validation for webhooks. When a producer sends a message, the runtime receives it and then sends it to the corresponding URL address provided during subscription via the URL given. Therefore, this is where the problem arises, and when there is no stream subscription, it is necessary to switch to a heartbeating method to resolve the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when there is no stream subscription, it is necessary to switch to a heartbeating method to resolve the issue.
Thank you for your answer. What does this sentence mean? Is it true that heartBeat() is only used for non stream subscriptions (webhook), and its effect is not significant when normal subscriptions are in progress?
感谢您的解答。这句是什么意思?是说“heartBeat()只是用于非流的方式订阅(webhook),流方式订阅时该heartBeat()其实作用不大”吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when there is no stream subscription, it is necessary to switch to a heartbeating method to resolve the issue.
Thank you for your answer. What does this sentence mean? Is it true that heartBeat() is only used for non stream subscriptions (webhook), and its effect is not significant when normal subscriptions are in progress?
感谢您的解答。这句是什么意思?是说“heartBeat()只是用于非流的方式订阅(webhook),流方式订阅时该heartBeat()其实作用不大”吗?
It is important to send heartbeats whether in webhook or stream mode, both of which are to keep the abstract ConsumerGroupClient of the runtime online. However, if the EventMeshGrpcConsumer only uses webhook subscriptions and not Stream subscriptions, then sending heartbeats can only be achieved by resubscribing through the subscribeWebhook method. If there are Stream subscriptions, both webhook subscriptions and Stream subscriptions can use Stream to send heartbeats to keep the runtime ConsumerGroupClient online.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So "it is necessary to switch to a heartbeating method" means using another heartbeat logic, which is subscribeWebhook() you extracted.
所以“it is necessary to switch to a heartbeating method”意思是改用另一种心跳逻辑,即您提取出来的subscribeWebhook()方法。
…eartBeat throw NPE (apache#4653) * [ISSUE apache#4652]Fix EventMeshGrpcConsumer subscribe webhook send heartBeat throw NPE * fix code style * fix runtime code style
Fixes #4652
Motivation
Explain the content here.
Explain why you want to make the changes and what problem you're trying to solve.
Modifications
Describe the modifications you've done.
Documentation