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

Unable to unsubscribe from multiple topics at once #199

Open
ctron opened this issue May 27, 2021 · 6 comments
Open

Unable to unsubscribe from multiple topics at once #199

ctron opened this issue May 27, 2021 · 6 comments
Milestone

Comments

@ctron
Copy link
Contributor

ctron commented May 27, 2021

Describe the feature

Currently there is an unsubscribe method, which only allows to unsubscribe from a single topic. However, with MQTT you can unsubscribe from multiple topic filters at the same time.

Use cases

Unsubscribe from multiple topics, in a single message.

@ctron ctron added the enhancement New feature or request label May 27, 2021
@chenzhiguo
Copy link

Yeah, MQTT topic filters are a very important feature, look at the source implementation, it doesn't seem to do this specifically, right?

@vietj vietj modified the milestones: 4.1.0, 4.1.1 May 31, 2021
@vietj vietj modified the milestones: 4.1.1, 4.2.0 Jul 2, 2021
@tsegismont tsegismont added help wanted and removed enhancement New feature or request labels Oct 14, 2021
@tsegismont tsegismont modified the milestones: 4.2.0, 4.3.0 Oct 14, 2021
@tsegismont
Copy link
Contributor

@ctron would you like to contribute?

@ctron
Copy link
Contributor Author

ctron commented Oct 15, 2021

I could draft up a PR. However I am not sure I can find the time to follow up on this to get it merged. I think this should come from the project.

@vietj vietj modified the milestones: 4.3.0, 4.3.1 May 12, 2022
@SivaAkiro
Copy link
Contributor

Hi @vietj i would like to contribute. Let me know what is the process.

@SivaAkiro
Copy link
Contributor

MqttClientImpl Class.

@OverRide
public Future unsubscribe(List topics) {

MqttFixedHeader fixedHeader = new MqttFixedHeader(
  MqttMessageType.UNSUBSCRIBE,
  false,
  AT_LEAST_ONCE,
  false,
  0);

MqttMessageIdVariableHeader variableHeader = new MqttMessageIdAndPropertiesVariableHeader(
  nextMessageId(), MqttProperties.NO_PROPERTIES);

MqttUnsubscribePayload payload = new MqttUnsubscribePayload(topics);

io.netty.handler.codec.mqtt.MqttMessage unsubscribe = MqttMessageFactory.newMessage(fixedHeader,
  variableHeader, payload);

this.write(unsubscribe);

return ctx.succeededFuture(variableHeader.messageId());

}

Changed the corresponding other classes also.

Tested the same with sample server and client.

@vietj vietj modified the milestones: 4.3.4, 4.3.5 Oct 1, 2022
@vietj vietj modified the milestones: 4.3.5, 4.4.0 Nov 18, 2022
@vietj vietj modified the milestones: 4.4.0, 4.4.1 Mar 2, 2023
@vietj vietj modified the milestones: 4.4.1, 4.4.2 Mar 31, 2023
@vietj vietj modified the milestones: 4.4.2, 4.4.3 May 12, 2023
@vietj vietj modified the milestones: 4.4.3, 4.4.4-SNAPSHOT Jun 7, 2023
@vietj vietj modified the milestones: 4.4.4, 4.4.5 Jun 22, 2023
@vietj vietj modified the milestones: 4.4.5, 4.4.6 Aug 30, 2023
@vietj vietj modified the milestones: 4.4.6, 4.5.0 Sep 12, 2023
@vietj vietj modified the milestones: 4.5.0, 4.5.1 Nov 15, 2023
@vietj vietj modified the milestones: 4.5.1, 4.5.2 Dec 13, 2023
@vietj vietj modified the milestones: 4.5.2, 4.5.3 Jan 30, 2024
@vietj vietj modified the milestones: 4.5.3, 4.5.4 Feb 6, 2024
@vietj vietj modified the milestones: 4.5.4, 4.5.5 Feb 22, 2024
@vietj vietj modified the milestones: 4.5.5, 4.5.6 Mar 14, 2024
@vietj vietj modified the milestones: 4.5.6, 4.5.7, 4.5.8 Mar 21, 2024
@vietj vietj modified the milestones: 4.5.8, 4.5.9 May 24, 2024
@vietj vietj modified the milestones: 4.5.9, 4.5.10 Jul 17, 2024
@vietj vietj modified the milestones: 4.5.10, 4.5.11 Sep 4, 2024
@vietj vietj modified the milestones: 4.5.11, 4.5.12 Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants