feat(example-mqtt): new MQTT heartBeat broker and client examples#9336
Merged
normanmaurer merged 6 commits intonetty:4.1from Jul 10, 2019
RobinGG:4.1
Merged
feat(example-mqtt): new MQTT heartBeat broker and client examples#9336normanmaurer merged 6 commits intonetty:4.1from RobinGG:4.1
normanmaurer merged 6 commits intonetty:4.1from
RobinGG:4.1
Conversation
|
Can one of the admins verify this patch? |
normanmaurer
requested changes
Jul 8, 2019
example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatBrokerHandler.java
Outdated
Show resolved
Hide resolved
example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatBrokerHandler.java
Outdated
Show resolved
Hide resolved
example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatBrokerHandler.java
Outdated
Show resolved
Hide resolved
example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatBrokerHandler.java
Outdated
Show resolved
Hide resolved
example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatBrokerHandler.java
Outdated
Show resolved
Hide resolved
example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatClientHandler.java
Outdated
Show resolved
Hide resolved
example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatClientHandler.java
Outdated
Show resolved
Hide resolved
example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatClient.java
Outdated
Show resolved
Hide resolved
example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatClient.java
Outdated
Show resolved
Hide resolved
example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatBroker.java
Show resolved
Hide resolved
normanmaurer
reviewed
Jul 8, 2019
example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatBrokerHandler.java
Outdated
Show resolved
Hide resolved
Member
|
@netty-bot test this please |
Member
|
@netty-bot test this please |
normanmaurer
approved these changes
Jul 8, 2019
njhill
approved these changes
Jul 9, 2019
Member
njhill
left a comment
There was a problem hiding this comment.
LGTM, thanks! Just one minor comment
example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatClientHandler.java
Outdated
Show resolved
Hide resolved
Member
|
@netty-bot test this please |
Member
|
Cherry-picked as b02ee11... Thanks! |
normanmaurer
pushed a commit
that referenced
this pull request
Jul 10, 2019
) Motivation: Recently I'm going to build MQTT broker and client based on Netty. I had MQTT encoder and decoder founded, while no basic examples. So I'm going to share my simple heartBeat MQTT broker and client as an example. Modification: New MQTT heartBeat example under io.netty.example/mqtt/heartBeat/. Result: Client would send CONNECT and PINGREQ(heartBeat message). - CONNECT: once channel active - PINGREQ: once IdleStateEvent triggered, which is 20 seconds in this example Client would discard all messages it received. MQTT broker could handle CONNECT, PINGREQ and DISCONNECT messages. - CONNECT: send CONNACK back - PINGREQ: send PINGRESP back - DISCONNECT: close the channel Broker would close the channel if 2 heartBeat lost, which set to 45 seconds in this example.
normanmaurer
pushed a commit
that referenced
this pull request
Jul 10, 2019
) Motivation: Recently I'm going to build MQTT broker and client based on Netty. I had MQTT encoder and decoder founded, while no basic examples. So I'm going to share my simple heartBeat MQTT broker and client as an example. Modification: New MQTT heartBeat example under io.netty.example/mqtt/heartBeat/. Result: Client would send CONNECT and PINGREQ(heartBeat message). - CONNECT: once channel active - PINGREQ: once IdleStateEvent triggered, which is 20 seconds in this example Client would discard all messages it received. MQTT broker could handle CONNECT, PINGREQ and DISCONNECT messages. - CONNECT: send CONNACK back - PINGREQ: send PINGRESP back - DISCONNECT: close the channel Broker would close the channel if 2 heartBeat lost, which set to 45 seconds in this example.
Contributor
Author
|
It was my pleasure, and thanks for your and Nick's kindly help! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
Recently I'm going to build MQTT broker and client based on Netty. I had MQTT encoder and decoder founded, while no basic examples. So I'm going to share my simple heartBeat MQTT broker and client as an example.
Modification:
New MQTT heartBeat example under io.netty.example/mqtt/heartBeat/.
Result:
Client would send CONNECT and PINGREQ(heartBeat message).
Client would discard all messages it received.
MQTT broker could handle CONNECT, PINGREQ and DISCONNECT messages.
Broker would close the channel if 2 heartBeat lost, which set to 45 seconds in this example.