activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Himer MARTINEZ (JIRA)" <>
Subject [jira] [Created] (APLO-398) NullPointerException when Client Identifier not set
Date Mon, 07 Nov 2016 20:44:59 GMT
Himer MARTINEZ created APLO-398:

             Summary: NullPointerException when Client Identifier not set
                 Key: APLO-398
             Project: ActiveMQ Apollo
          Issue Type: Improvement
          Components: apollo-mqtt
    Affects Versions: 1.7
         Environment: All
            Reporter: Himer MARTINEZ
            Priority: Blocker
             Fix For: 1.7.1


In some cases, some specific MQTT clients does not set the Client Identifier when stablishing
a connection, in this case the client_id.toString is generating a NullPointerException,

I saw this with some specific MQTT clients from IoT manufacturers like Adafruit, they provide
a C API and do not check if the client identifier is set.

Because the Client Identifier is mandatory, I think it could be better to check if is set
and, if not, exit gracefully with a specific error.

This can be blocking for people (it was my case) because they do not understand why the connection
is not stablished and they have juste a NullPointerException.

I could submit a patch but since a I'm not still contributor, I think it will be faster you
do it,


public void on_mqtt_connect() {

        final CONNACK connack = new CONNACK();

        if (connect_message.version() != 3) {
            die(connack, "Unsupported protocol version: " + connect_message.version());

        UTF8Buffer client_id = connect_message.clientId();

This message was sent by Atlassian JIRA

View raw message