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
fix: STOMP heartbeat #12920
base: master
Are you sure you want to change the base?
fix: STOMP heartbeat #12920
Conversation
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.
Thanks for your contribution. but I have a suggestion for optimization.
@@ -700,6 +700,16 @@ parse_incoming( | |||
|
|||
parse_incoming(<<>>, Packets, State) -> | |||
{Packets, State}; | |||
parse_incoming( |
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.
Since emqx_gateway_conn is generic code for all gateways, we should not handle stomp-related frame here.
It's better to handle it in emqx_stomp_frame.erl module
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.
OK, let me try
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.
In emqx_stomp_frame.erl module, not have the channel info, how can i do?
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.
IMO, you can return a new frame type, i.e. heartbeat and handle it in the channel module. But I am not sure if the heartbeat message contains only one \n
char.🤔
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.
I have updated it, if it is not perfect, maybe you can improve it.
96bb72f
to
51f202c
Compare
Fixes #12911
Fix server not send heartbeat to client and client send heartbeat to server, the server keep alive.
Summary
PR Checklist
Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:
changes/(ce|ee)/(feat|perf|fix|breaking)-<PR-id>.en.md
filesChecklist for CI (.github/workflows) changes
changes/
dir for user-facing artifacts update