Skip to content

Incorrect casting in v5 ClientState persistBufferedMessage #1073

@Jugen

Description

@Jugen

The two MqttPublish casts in the following piece of code should be changed to MqttPersistable otherwise subscribe and unsubsribed messages throw ClassCastException

try {
persistence.put(key, (MqttPublish) message);
} catch (MqttPersistenceException mpe) {
// @TRACE 515=Could not Persist, attempting to Re-Open Persistence Store
log.fine(CLASS_NAME, methodName, "515");
persistence.open(this.clientComms.getClient().getClientId());
persistence.put(key, (MqttPublish) message);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions