Skip to content

refactor(mqtt-component): 重构 MQTT 组件相关实现代码#740

Open
PengyuDeng wants to merge 5 commits intojetlinks:2.11from
PengyuDeng:reactor-mqtt
Open

refactor(mqtt-component): 重构 MQTT 组件相关实现代码#740
PengyuDeng wants to merge 5 commits intojetlinks:2.11from
PengyuDeng:reactor-mqtt

Conversation

@PengyuDeng
Copy link
Contributor

主要是server部分重构了认证逻辑,认证逻辑前置了。看看还有啥要改的不

@PengyuDeng
Copy link
Contributor Author


org.jetlinks.community
reactor-mqtt-core
1.0-SNAPSHOT
依赖编译不过。先看看逻辑


@Override
public Flux<MqttMessage> subscribe(List<String> topics, int qos) {
return Flux.create(sink -> {
Copy link
Member

Choose a reason for hiding this comment

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

用create 连接无法感应背压. create 可能堆积导致占用大量内存

@Override
public Mono<Void> publish(MqttMessage message) {
if (isLoading()) {
return Mono.create(sink -> {
Copy link
Member

Choose a reason for hiding this comment

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

直接doPublish 就行了吧?

* @author zhouhao
* @since 1.0
* @author PengyuDeng
* @since 2.11
Copy link
Member

Choose a reason for hiding this comment

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

建议单独实现一个Provider

@PengyuDeng
Copy link
Contributor Author

client AI写完还没咋看,先搞定了server。等会改Client的代码

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.

2 participants