activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Reinhold <brianreinh...@lampreynetworks.com>
Subject Embedded MQTT Apollo broker does not follow MQTT protocol
Date Tue, 25 Mar 2014 11:59:21 GMT
The embedded side of the Apollo MQTT connection does not follow the MQTT
protocol (however the remote side does).

*Test situation:* 
    a. remote client using MQTT Paho client, 
    b. remote client using Apollo connection secure TLS with client
authentication
    c. remote client uses QoS 2, no clean session, LOST message last will
and testament, no keepalive
    d. embedded client using MQTT Paho client.
    e. embedded client using Apollo connection unsecure tcp
    f. embedded client uses QoS 2, no clean session, LOST message last will
and testament, no keepalive

*Test one:*
Start Server side application which starts the embedded broker
Start remote client which connects and subscribes
remote client publishes connect message and server receives it: Expected
Kill server application abruptly
Remote client receives LOST message. This is expected.

*Test two:*
Start Server side application which starts the embedded broker
Start remote client which connects and subscribes
remote client publishes connect message and server receives it: Expected
Kill remote client abruptly
*Server receives no LOST message. This is incorrect*

*Test three:*
Start Server side application which starts the embedded broker
Start remote client which connects and subscribes
remote client publishes connect message and server receives it: Expected
Publish messages from server
remote client receives publications
Stop remote client
Re-start remote client
remote client publishes connect message and server receives it: Expected
Publish messages from server
*remote client does not receive them, they are queued. This is incorrect;
max one message should be 'queued'*
Continue to publish messages; some messages will be sent, others will remain
in queue.
/Note: queuing observed using the Administrative console. It is very clear
the published messages are getting trapped in the queue of the embedded
connection. All messages that make it to the queue of the remote connection
go out./

*Somehow the embedded client is not behaving to MQTT protocol *event though
the following is set for the embedded client's connection:
        acceptingConnectorDTO = new AcceptingConnectorDTO();
        acceptingConnectorDTO.id = "tcp";
        acceptingConnectorDTO.bind = "tcp://localhost:8440";
        *acceptingConnectorDTO.protocol = "mqtt";*
        broker.connectors.add(acceptingConnectorDTO);

However, the remote client is behaving as expected and its connection is
configured as follows:

        DetectDTO detectDTO = new DetectDTO();
        detectDTO.protocols = "mqtt";

        // Control which ports and protocols the broker binds and accepts:
        // The secure connection from outside
        AcceptingConnectorDTO acceptingConnectorDTO = new
AcceptingConnectorDTO();
        acceptingConnectorDTO.id = "tls";
        acceptingConnectorDTO.bind = mqttServerUrl;
        acceptingConnectorDTO.protocol = "mqtt";

        // From
http://activemq.apache.org/apollo/documentation/api/apollo-dto/index.html
        SslDTO sslDTO = new SslDTO();
        sslDTO.client_auth = "NEED";
        sslDTO.version = "TLSv1";

        ArrayList<ProtocolDTO> protocolDTOs = new ArrayList<ProtocolDTO>();
        protocolDTOs.add(sslDTO);
        protocolDTOs.add(detectDTO);
        acceptingConnectorDTO.protocols = protocolDTOs;
        broker.connectors.add(acceptingConnectorDTO);

        KeyStorageDTO keyStorageDTO = new KeyStorageDTO();
        keyStorageDTO.key_password = "changeit";
        keyStorageDTO.password = "changeit";
        keyStorageDTO.file = new File(sslContextFactory.getKeyStorePath());
        broker.key_storage = keyStorageDTO;

After all the testing and correct behavior of the remote client, I can only
conclude that there is a bug in the  embedded side implementation.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Embedded-MQTT-Apollo-broker-does-not-follow-MQTT-protocol-tp4679501.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Mime
View raw message