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

fix: STOMP heartbeat #12920

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix: STOMP heartbeat #12920

wants to merge 1 commit into from

Conversation

cisiqo
Copy link
Contributor

@cisiqo cisiqo commented Apr 23, 2024

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:

  • Added tests for the changes
  • Added property-based tests for code which performs user input validation
  • Changed lines covered in coverage report
  • Change log has been added to changes/(ce|ee)/(feat|perf|fix|breaking)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • Created PR to emqx-docs if documentation update is required, or link to a follow-up jira ticket
  • Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • If changed package build workflow, pass this action (manual trigger)
  • Change log has been added to changes/ dir for user-facing artifacts update

@cisiqo cisiqo requested review from lafirest and a team as code owners April 23, 2024 18:10
Copy link
Member

@HJianBo HJianBo left a 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(
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let me try

Copy link
Contributor Author

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?

Copy link
Member

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.🤔

Copy link
Contributor Author

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.

@cisiqo cisiqo force-pushed the patch-6 branch 2 times, most recently from 96bb72f to 51f202c Compare April 25, 2024 14:41
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

Successfully merging this pull request may close these issues.

STOMP GW does not send heartbeat to client
2 participants