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 subscribe method with IMqttMessageListener #451

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

Conversation

ididdidi
Copy link

@ididdidi ididdidi commented Mar 9, 2021

  • You have signed the Eclipse ECA
  • All of your commits have been signed-off with the correct email address (The same one that you used to sign the CLA)
  • If This PR fixes an issue, that you reference the issue below. OR if this is a new issue that you are fixing straight away that you add some Description about the bug and how this will fix it.
  • If this is new functionality, You have added the appropriate Unit tests.

Possible error: subscribe have no call back when the message arrived when i use this method "public IMqttToken subscribe(String[] topicFilters, int[] qos, IMqttMessageListener[] messageListeners)" can be fixed like this.

@@ -1146,7 +1146,7 @@ public IMqttToken subscribe(String[] topicFilters, int[] qos, Object userContext
String activityToken = storeToken(token);
mqttService.subscribe(clientHandle, topicFilters, qos, null, activityToken, messageListeners);

return null;
return token;
Copy link
Contributor

@hannesa2 hannesa2 Mar 11, 2021

Choose a reason for hiding this comment

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

Copy link
Author

@ididdidi ididdidi Mar 11, 2021

Choose a reason for hiding this comment

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

Hi Hannes, I saw your solution and tested it, but unfortunately it didn't help me.

I make a call to this method:

client.subscribe(topic, qos, new IMqttMessageListener() {
            @Override
            public void messageArrived(String topic, MqttMessage message) throws Exception {
                Log.i(topic, message.toString());
            }
 });

When publishing messages in, nothing happens.

However, the message sent from the device under test appears in the TextView (in a different implementation) after the screen is turned off and on. But other messages don't go through like that.

Copy link
Author

Choose a reason for hiding this comment

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

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.

None yet

2 participants