Implements AMQ-4990: Add support for the changes in MQTT 3.1.1

This commit is contained in:
Hiram Chirino 2014-01-23 13:23:01 -05:00
parent 95d20e5b47
commit ad3041034b
3 changed files with 19 additions and 6 deletions

View File

@ -124,12 +124,13 @@ public class MQTTProtocolConverter {
break; break;
} }
case CONNECT.TYPE: { case CONNECT.TYPE: {
onMQTTConnect(new CONNECT().decode(frame)); CONNECT connect = new CONNECT().decode(frame);
LOG.debug("MQTT Client " + getClientId() + " connected."); onMQTTConnect(connect);
LOG.debug("MQTT Client {} connected. (version: {})", getClientId(), connect.version());
break; break;
} }
case DISCONNECT.TYPE: { case DISCONNECT.TYPE: {
LOG.debug("MQTT Client " + getClientId() + " disconnecting"); LOG.debug("MQTT Client {} disconnecting", getClientId());
onMQTTDisconnect(); onMQTTDisconnect();
break; break;
} }

View File

@ -668,9 +668,21 @@ public class MQTTTest extends AbstractMQTTTest {
@Override @Override
public void debug(String message, Object... args) { public void debug(String message, Object... args) {
LOG.info(message, args); LOG.info(String.format(message, args));
} }
}; };
} }
@Test(timeout=60 * 1000)
public void testMQTT311Connection()throws Exception{
addMQTTConnector();
brokerService.start();
MQTT mqtt = createMQTTConnection();
mqtt.setClientId("foo");
mqtt.setVersion("3.1.1");
final BlockingConnection connection = mqtt.blockingConnection();
connection.connect();
connection.disconnect();
}
} }

View File

@ -64,7 +64,7 @@
<geronimo-version>1.0</geronimo-version> <geronimo-version>1.0</geronimo-version>
<hadoop-version>1.0.0</hadoop-version> <hadoop-version>1.0.0</hadoop-version>
<hawtbuf-version>1.9</hawtbuf-version> <hawtbuf-version>1.9</hawtbuf-version>
<hawtdispatch-version>1.18</hawtdispatch-version> <hawtdispatch-version>1.19</hawtdispatch-version>
<howl-version>0.1.8</howl-version> <howl-version>0.1.8</howl-version>
<hsqldb-version>1.8.0.12</hsqldb-version> <hsqldb-version>1.8.0.12</hsqldb-version>
<httpclient-version>4.2.5</httpclient-version> <httpclient-version>4.2.5</httpclient-version>
@ -90,7 +90,7 @@
<leveldb-version>0.6</leveldb-version> <leveldb-version>0.6</leveldb-version>
<leveldbjni-version>1.8</leveldbjni-version> <leveldbjni-version>1.8</leveldbjni-version>
<log4j-version>1.2.17</log4j-version> <log4j-version>1.2.17</log4j-version>
<mqtt-client-version>1.6</mqtt-client-version> <mqtt-client-version>1.7</mqtt-client-version>
<openjpa-version>1.2.0</openjpa-version> <openjpa-version>1.2.0</openjpa-version>
<opensymphony-version>2.4.2</opensymphony-version> <opensymphony-version>2.4.2</opensymphony-version>
<org-apache-derby-version>10.10.1.1</org-apache-derby-version> <org-apache-derby-version>10.10.1.1</org-apache-derby-version>