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

messageId attribute of MqttMessage always returns zero #87

Closed
gholadr opened this issue May 25, 2016 · 9 comments
Closed

messageId attribute of MqttMessage always returns zero #87

gholadr opened this issue May 25, 2016 · 9 comments
Assignees
Milestone

Comments

@gholadr
Copy link

gholadr commented May 25, 2016

Please fill out the form below before submitting, thank you!

  • [Dont know ] Bug exists Release Version 1.0.2 (Java Repository Master Branch)
  • [x ] Bug exists in Snapshot Version 1.0.3 (Android Service Repository Master Branch)

Android API Version Bug Seen on: min sdk 17, target sdk 23

Description of Bug:

E.g. Steps to re-create, how often does this happen etc..

When overriding the messageArrived method from the MqttCallback interface, we've noticed that the messageId attribute of the MqttMessage object passed as a parameter is not set and always returns 0. Since we use QoS 2, and according to the MQTT specs, it feels like the messageId should be set to an Integer value. We've verified that the broker does indeed return an integer value. We are not sure but feels like the issue might be when CommsCallback invokes deliverMessage

@gholadr
Copy link
Author

gholadr commented May 25, 2016

I found what the issue is. org.eclipse.paho.client.mqttv3.internal.wire.MqttReceivedMessage extends org.eclipse.paho.client.mqttv3MqttMessage but the messageId logic in MqttReceivedMessage seems wrong.

private int messageId;

    public void setMessageId(int msgId) {
        this.messageId = msgId;
    }

    public int getMessageId() {
        return messageId;
    }

should be:

public void setMessageId(int msgId) {
        super.setId(msgId);
    }
    public int getMessageId() {
        return super.getId();
    }

@jpwsutton jpwsutton added the bug label May 25, 2016
@jpwsutton jpwsutton added this to the 1.2.0 (Neon) milestone May 25, 2016
@jpwsutton jpwsutton self-assigned this May 25, 2016
@jpwsutton
Copy link
Member

@gholadr Where are you seeing ReceivedMqttMessage? That's not a class in paho that I recognise...

@jpwsutton jpwsutton removed this from the 1.2.0 (Neon) milestone May 31, 2016
@jpwsutton jpwsutton removed the bug label May 31, 2016
@gholadr
Copy link
Author

gholadr commented May 31, 2016

@jpwsutton, sorry, its this class org.eclipse.paho.client.mqttv3.internal.wire.MqttReceivedMessage

@jpwsutton jpwsutton added this to the 1.3.0 milestone May 31, 2016
@gholadr
Copy link
Author

gholadr commented May 31, 2016

Let me submit a PR for this? We need this to be part of 1.2.0 as we rely on message Id to sort messages.

@jpwsutton
Copy link
Member

We're past the deadline for PRs for 1.2.0 as the IP log has already been submitted, I can look at getting it added myself though.

jpwsutton added a commit to eclipse/paho.mqtt.java that referenced this issue Jun 1, 2016
@gholadr
Copy link
Author

gholadr commented Jun 2, 2016

That would be awesome if you could.

On Wed, Jun 1, 2016, 5:33 PM James Sutton notifications@github.com wrote:

We're past the deadline for PRs for 1.2.0 as the IP log has already been
submitted, I can look at getting it added myself though.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#87 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AD2f1XPj07paJPRzkxxWfxwBsJMvQvXLks5qHVHggaJpZM4ImHbA
.

@jpwsutton
Copy link
Member

Fix is now in the latest 1.0.3-SNAPSHOT and will be in 1.1.0 once released.

@jpwsutton jpwsutton modified the milestones: 1.2.0 (Neon), 1.3.0 Jun 2, 2016
@gholadr
Copy link
Author

gholadr commented Jun 2, 2016

Thank you.

On Thu, Jun 2, 2016, 3:49 PM James Sutton notifications@github.com wrote:

Fix is now in the latest 1.0.3-SNAPSHOT and will be in 1.1.0 once released.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#87 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AD2f1c5fg-008Cuub1bTTeeviNi661Y-ks5qHosQgaJpZM4ImHbA
.

@Amptek-Inc
Copy link

Hi,

I am using version 1.1.1, and the id is still always returning 0. Has this issue been fixed?

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

No branches or pull requests

3 participants